feat: harden support, localize knowledge and add operator availability [skip ci]

Source-only publication of reviewed commit 64e96a7f423673dc29ad56485be9fc79bce8af1c.

Passed in isolation: focused frontend/backend tests, race checks, TypeScript typecheck, lint, Go compilation, Flowgram build, and deterministic SDK build/tests.

Not accepted as a production release: Next.js export/native assembly remains blocked by environment memory limits; browser interaction and MySQL staging acceptance remain unverified. No production server, database/schema, runtime configuration, deployment, release tag, or workflow execution was performed.

Expected source tree: 0a4a7528e9.
This commit is contained in:
2026-10-16 15:21:42 +00:00
parent 299ea50fb5
commit 2f7a491666
176 changed files with 11869 additions and 2716 deletions

View File

@@ -1,6 +1,11 @@
// Modified in the independent hardening fork; see docs/hardening.
package dto
import "agent-desk/internal/pkg/enums"
import (
"agent-desk/internal/pkg/enums"
"time"
)
type AuthPrincipal struct {
UserID int64
@@ -11,16 +16,22 @@ type AuthPrincipal struct {
Status enums.Status
Roles []string
Permissions []string
// Session metadata stays internal and binds long-lived connections to the
// original login session and its absolute deadline.
LoginSessionID int64 `json:"-"`
ExpiresAt time.Time `json:"-"`
}
type WebChannelConfig struct {
Title string `json:"title"`
Subtitle string `json:"subtitle"`
ThemeColor string `json:"themeColor"`
Position string `json:"position"`
Width string `json:"width"`
UserTokenSecret string `json:"userTokenSecret,omitempty"`
PromptStarters []string `json:"promptStarters,omitempty"`
Title string `json:"title"`
Subtitle string `json:"subtitle"`
ThemeColor string `json:"themeColor"`
Position string `json:"position"`
Width string `json:"width"`
UserTokenSecret string `json:"userTokenSecret,omitempty"`
RequireSignedIdentity bool `json:"requireSignedIdentity,omitempty"`
PromptStarters []string `json:"promptStarters,omitempty"`
}
type TelegramChannelConfig struct {

View File

@@ -1,3 +1,4 @@
// Modified in AgentDeskFixes: safe, reviewed setup repairs and honest routing diagnostics.
package request
type SetupSimulateRouteRequest struct {
@@ -6,6 +7,8 @@ type SetupSimulateRouteRequest struct {
}
type SetupQuickFixRequest struct {
Action string `json:"action" form:"action"`
EntityID int64 `json:"entity_id" form:"entity_id"`
Action string `json:"action" form:"action"`
EntityID int64 `json:"entity_id" form:"entity_id"`
Apply bool `json:"apply" form:"apply"`
PreviewToken string `json:"preview_token" form:"preview_token"`
}

View File

@@ -0,0 +1,34 @@
package request
import "agent-desk/internal/pkg/enums"
type SupportCalendarPeriod struct {
Start string `json:"start"`
End string `json:"end"`
}
type SupportCalendarWeeklyPeriod struct {
Weekday int `json:"weekday"`
SupportCalendarPeriod
}
type SupportCalendarException struct {
Date string `json:"date"`
Closed bool `json:"closed"`
Periods []SupportCalendarPeriod `json:"periods"`
}
type SupportCalendarRequest struct {
TeamID int64 `json:"teamId"`
Mode string `json:"mode"`
Timezone string `json:"timezone"`
Weekly []SupportCalendarWeeklyPeriod `json:"weekly"`
Exceptions []SupportCalendarException `json:"exceptions"`
}
type SupportCalendarPreviewRequest struct {
Calendar SupportCalendarRequest `json:"calendar"`
At string `json:"at"`
}
type SupportAvailabilityRequest struct {
UserID int64 `json:"userId"`
ServiceStatus enums.ServiceStatus `json:"serviceStatus"`
AbsenceStartAt string `json:"absenceStartAt"`
AbsenceEndAt string `json:"absenceEndAt"`
}

View File

@@ -1,3 +1,4 @@
// Modified in AgentDeskFixes: safe, reviewed setup repairs and honest routing diagnostics.
package response
type SetupIssueItem struct {
@@ -92,7 +93,20 @@ type SetupSimulateRouteResponse struct {
CandidateOperators []SimulatedOperatorCandidate `json:"candidate_operators"`
}
type SetupQuickFixResponse struct {
AppliedActions []string `json:"applied_actions"`
Readiness SetupReadinessResponse `json:"readiness"`
type SetupQuickFixChange struct {
EntityType string `json:"entity_type"`
EntityID int64 `json:"entity_id"`
EntityName string `json:"entity_name"`
Operation string `json:"operation"`
Before map[string]any `json:"before"`
After map[string]any `json:"after"`
}
type SetupQuickFixResponse struct {
Applied bool `json:"applied"`
PreviewToken string `json:"preview_token"`
Changes []SetupQuickFixChange `json:"changes"`
WarningCodes []string `json:"warning_codes"`
AppliedActions []string `json:"applied_actions"`
Readiness *SetupReadinessResponse `json:"readiness,omitempty"`
}

View File

@@ -0,0 +1,41 @@
package response
import (
"agent-desk/internal/pkg/dto/request"
"agent-desk/internal/pkg/enums"
)
type SupportCalendarResponse struct {
request.SupportCalendarRequest
EffectiveTimezone string `json:"effectiveTimezone"`
DeploymentTimezone string `json:"deploymentTimezone"`
}
type SupportCalendarPreviewResponse struct {
Open bool `json:"open"`
Timezone string `json:"timezone"`
Mode string `json:"mode"`
NextOpeningAt string `json:"nextOpeningAt,omitempty"`
}
type SupportAvailabilityResponse struct {
UserID int64 `json:"userId"`
ProfileID int64 `json:"profileId"`
TeamID int64 `json:"teamId"`
DisplayName string `json:"displayName"`
ServiceStatus enums.ServiceStatus `json:"serviceStatus"`
ReturnServiceStatus enums.ServiceStatus `json:"returnServiceStatus"`
EffectiveServiceStatus enums.ServiceStatus `json:"effectiveServiceStatus"`
AbsenceStartAt string `json:"absenceStartAt,omitempty"`
AbsenceEndAt string `json:"absenceEndAt,omitempty"`
Online bool `json:"online"`
Eligible bool `json:"eligible"`
Reason string `json:"reason"`
Calendar SupportCalendarResponse `json:"calendar"`
CalendarOpen bool `json:"calendarOpen"`
NextOpeningAt string `json:"nextOpeningAt,omitempty"`
}
type PublicSupportStatusResponse struct {
Available bool `json:"available"`
Reason string `json:"reason"`
Timezone string `json:"timezone"`
NextOpeningAt string `json:"nextOpeningAt,omitempty"`
}