@sema-agent/client-core 0.99.0 → 0.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/CHANGELOG.md +177 -0
  2. package/README.md +32 -19
  3. package/dist/adapt/arms.js +60 -36
  4. package/dist/adapt/panelTasks.d.ts +2 -1
  5. package/dist/adapt/panelTasks.js +32 -9
  6. package/dist/adapt/textStream.d.ts +1 -1
  7. package/dist/adapt/textStream.js +51 -28
  8. package/dist/adapter/activeRunSelfHeal.d.ts +7 -0
  9. package/dist/adapter/activeRunSelfHeal.js +58 -11
  10. package/dist/adapter/downstream/eventToSdkMessage.d.ts +25 -6
  11. package/dist/adapter/downstream/eventToSdkMessage.js +125 -9
  12. package/dist/adapter/downstream/terminalToSdkResult.js +10 -0
  13. package/dist/adapter/downstream/wiringManifestView.d.ts +3 -1
  14. package/dist/adapter/downstream/wiringManifestView.js +1 -0
  15. package/dist/adapter/runStream.js +32 -5
  16. package/dist/adapter/types.d.ts +2 -0
  17. package/dist/agentsWireCaps.d.ts +7 -0
  18. package/dist/agentsWireCaps.js +100 -15
  19. package/dist/cloudConfigWireCaps.d.ts +10 -1
  20. package/dist/cloudConfigWireCaps.js +156 -62
  21. package/dist/compactionStatus.d.ts +34 -0
  22. package/dist/compactionStatus.js +196 -0
  23. package/dist/decideFailureNote.js +3 -3
  24. package/dist/displayUntrusted.js +150 -5
  25. package/dist/engineAgentPanelStore.d.ts +7 -4
  26. package/dist/engineErrorCodes.d.ts +9 -1
  27. package/dist/engineErrorCodes.js +9 -5
  28. package/dist/engineRowRef.js +1 -0
  29. package/dist/engineToolDirectory.d.ts +3 -0
  30. package/dist/engineToolDirectory.js +4 -2
  31. package/dist/eventLeg.d.ts +1 -7
  32. package/dist/eventLeg.js +7 -8
  33. package/dist/fileHistoryCaptureCapability.d.ts +0 -3
  34. package/dist/fileHistoryCaptureCapability.js +0 -4
  35. package/dist/generated/engineFactTables.d.ts +1 -0
  36. package/dist/generated/engineFactTables.js +27 -0
  37. package/dist/generated/engineNoticeTables.js +3 -0
  38. package/dist/generated/settingsSchemaFns.d.ts +12 -0
  39. package/dist/generated/settingsSchemaFns.js +13 -0
  40. package/dist/generated/settingsSchemaMcpRequestEntry.d.ts +1 -0
  41. package/dist/generated/settingsSchemaMcpRequestEntry.js +162 -0
  42. package/dist/generated/settingsSchemaTables.d.ts +1 -0
  43. package/dist/generated/settingsSchemaTables.js +5 -0
  44. package/dist/generated/settingsSchemaTypes.d.ts +28 -0
  45. package/dist/hitl/allowRuleShadow.js +2 -2
  46. package/dist/hitl/approvalCardReasons.js +2 -2
  47. package/dist/hitl/approvalHolds.d.ts +14 -0
  48. package/dist/hitl/approvalHolds.js +41 -0
  49. package/dist/hitl/askClassPair.d.ts +2 -2
  50. package/dist/hitl/askClassPair.js +2 -2
  51. package/dist/hitl/attributionLadder.d.ts +23 -0
  52. package/dist/hitl/attributionLadder.js +67 -0
  53. package/dist/hitl/decisionLedger.d.ts +55 -0
  54. package/dist/hitl/decisionLedger.js +156 -0
  55. package/dist/hitl/decisionRefusal.d.ts +1 -0
  56. package/dist/hitl/decisionRefusal.js +1 -1
  57. package/dist/hitl/decisionSend.d.ts +113 -0
  58. package/dist/hitl/decisionSend.js +579 -0
  59. package/dist/hitl/hitlBridge.js +18 -6
  60. package/dist/hitl/planReviewWire.js +45 -76
  61. package/dist/hitl/sessionPolicyDeliverable.js +3 -6
  62. package/dist/hitl/toolApprovalWire.js +43 -109
  63. package/dist/hostTurnSettings.d.ts +46 -7
  64. package/dist/hostTurnSettings.js +408 -7
  65. package/dist/humanTurn.d.ts +2 -1
  66. package/dist/humanTurn.js +3 -3
  67. package/dist/i18n/messages.en.d.ts +131 -0
  68. package/dist/i18n/messages.en.js +143 -12
  69. package/dist/i18n/messages.zh.js +148 -12
  70. package/dist/index.d.ts +18 -2
  71. package/dist/index.js +10 -1
  72. package/dist/inheritEnvCapability.d.ts +1 -0
  73. package/dist/inheritEnvCapability.js +9 -2
  74. package/dist/inheritEnvWire.js +2 -2
  75. package/dist/injectionLaneNotice.d.ts +5 -0
  76. package/dist/injectionLaneNotice.js +46 -0
  77. package/dist/mcpPanel.js +2 -0
  78. package/dist/mcpReconnect.js +2 -2
  79. package/dist/mcpToolToggles.d.ts +6 -0
  80. package/dist/mcpToolToggles.js +46 -0
  81. package/dist/mcpWireCaps.d.ts +10 -4
  82. package/dist/mcpWireCaps.js +106 -71
  83. package/dist/mcpWireTransport.d.ts +4 -0
  84. package/dist/mcpWireTransport.js +18 -0
  85. package/dist/modelCapabilityProbe.d.ts +2 -1
  86. package/dist/modelCapabilityProbe.js +10 -9
  87. package/dist/modelIdentityResolvability.d.ts +2 -0
  88. package/dist/modelIdentityResolvability.js +23 -5
  89. package/dist/ownKey.d.ts +26 -0
  90. package/dist/ownKey.js +75 -0
  91. package/dist/panelReduce.d.ts +5 -0
  92. package/dist/panelReduce.js +45 -13
  93. package/dist/panelStateHolder.d.ts +1 -0
  94. package/dist/panelStateHolder.js +10 -1
  95. package/dist/permissionRuleIssue.d.ts +2 -1
  96. package/dist/permissionRuleIssue.js +22 -21
  97. package/dist/pluginHooksWire.js +12 -10
  98. package/dist/prepareRefusal.d.ts +8 -0
  99. package/dist/prepareRefusal.js +72 -0
  100. package/dist/request/taskRequest.d.ts +10 -10
  101. package/dist/request/taskRequest.js +106 -65
  102. package/dist/resumeRefusalCopy.d.ts +3 -1
  103. package/dist/resumeRefusalCopy.js +22 -4
  104. package/dist/retryStatus.d.ts +18 -0
  105. package/dist/retryStatus.js +76 -19
  106. package/dist/ruleRefusalSentence.d.ts +4 -0
  107. package/dist/ruleRefusalSentence.js +58 -0
  108. package/dist/sandboxWire.d.ts +2 -1
  109. package/dist/sandboxWire.js +55 -21
  110. package/dist/scenarioRefusal.d.ts +2 -1
  111. package/dist/scenarioRefusal.js +5 -5
  112. package/dist/seam.d.ts +24 -9
  113. package/dist/seam.js +44 -4
  114. package/dist/seatContract.d.ts +16 -8
  115. package/dist/seatContract.js +21 -6
  116. package/dist/settingsCredentialKeyPaths.d.ts +8 -0
  117. package/dist/settingsCredentialKeyPaths.js +219 -0
  118. package/dist/skillsWireCaps.d.ts +0 -3
  119. package/dist/skillsWireCaps.js +1 -2
  120. package/dist/subagentContentStore.d.ts +1 -0
  121. package/dist/subagentContentStore.js +135 -27
  122. package/dist/toolsFlagNames.d.ts +8 -0
  123. package/dist/toolsFlagNames.js +110 -0
  124. package/dist/turnFailurePresentation.js +15 -7
  125. package/dist/wireRefusalCopy.d.ts +51 -17
  126. package/dist/wireRefusalCopy.js +298 -135
  127. package/docs/INTEGRATION-CLIENTS.md +423 -26
  128. package/package.json +4 -4
@@ -1,5 +1,6 @@
1
- import { FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE, USAGE_WINDOW_EXHAUSTED, USER_ATTACHMENT_INVALID_ERROR_CODE, USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
1
+ import { FLEET_LEASE_UNAVAILABLE, REQUEST_AUTONOMY_LANE_REFUSED, USAGE_WINDOW_EXHAUSTED, USER_ATTACHMENT_INVALID_ERROR_CODE, USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE } from './engineErrorCodes.js';
2
2
  import type { TaskRequestLike } from './request/taskRequest.js';
3
+ import type { UiLanguage } from './env/uiLanguage.js';
3
4
  export declare const CONFLICT_APPROVAL_SETTLED = "conflict.approval_settled";
4
5
  export declare const CONFLICT_RUN_NOT_RUNNING = "conflict.run_not_running";
5
6
  export type CancelConflictKind = 'approval_settled' | 'run_not_running' | 'unrecognized';
@@ -8,26 +9,20 @@ export interface CancelConflictDetail {
8
9
  code?: string;
9
10
  }
10
11
  export declare function cancelConflictFromError(err: unknown): CancelConflictDetail | null;
11
- export declare function cancelConflictContent(detail: Pick<CancelConflictDetail, 'kind'>): string;
12
+ export declare function cancelConflictContent(detail: Pick<CancelConflictDetail, 'kind'>, lang?: UiLanguage): string;
12
13
  export interface UsageWindowExhaustedDetail {
13
14
  code: typeof USAGE_WINDOW_EXHAUSTED;
14
15
  retryAfterSec?: number;
15
16
  }
16
17
  export declare function usageWindowExhaustedFromError(err: unknown): UsageWindowExhaustedDetail | null;
17
- export declare function usageWindowExhaustedContent(detail: UsageWindowExhaustedDetail): string;
18
+ export declare function usageWindowExhaustedContent(detail: UsageWindowExhaustedDetail, lang?: UiLanguage): string;
18
19
  export interface FleetLeaseUnavailableDetail {
19
20
  code: typeof FLEET_LEASE_UNAVAILABLE;
20
21
  reason?: string;
21
22
  retryAfterSec?: number;
22
23
  }
23
24
  export declare function fleetLeaseUnavailableFromError(err: unknown): FleetLeaseUnavailableDetail | null;
24
- export declare function fleetLeaseUnavailableContent(detail: FleetLeaseUnavailableDetail): string;
25
- export interface ScenarioAssignmentUnknownDetail {
26
- code: typeof SCENARIO_ASSIGNMENT_UNKNOWN_ERROR_CODE;
27
- scenario?: string;
28
- source?: 'ruling' | 'deployment';
29
- }
30
- export declare function scenarioAssignmentUnknownFromError(err: unknown): ScenarioAssignmentUnknownDetail | null;
25
+ export declare function fleetLeaseUnavailableContent(detail: FleetLeaseUnavailableDetail, lang?: UiLanguage): string;
31
26
  export type DenyAttributionRefusalKind = 'not_in_proof' | 'decision_conflict' | 'attribution_rejected' | 'retired_key';
32
27
  export interface DenyAttributionRefusalDetail {
33
28
  kind: DenyAttributionRefusalKind;
@@ -36,7 +31,7 @@ export interface DenyAttributionRefusalDetail {
36
31
  field?: string;
37
32
  }
38
33
  export declare function denyAttributionRefusalFromError(err: unknown, sentAttributionKey: boolean): DenyAttributionRefusalDetail | null;
39
- export declare function denyAttributionRefusalContent(detail: Pick<DenyAttributionRefusalDetail, 'kind' | 'field'>): string;
34
+ export declare function denyAttributionRefusalContent(detail: Pick<DenyAttributionRefusalDetail, 'kind' | 'field'>, lang?: UiLanguage): string;
40
35
  export declare const CONFLICT_SESSION_CHILDREN_ALIVE = "conflict.session_children_alive";
41
36
  export type SessionDeleteConflictKind = 'children_alive' | 'active_run' | 'unrecognized';
42
37
  export interface SessionDeleteConflictDetail {
@@ -46,7 +41,7 @@ export interface SessionDeleteConflictDetail {
46
41
  activeTaskId?: string;
47
42
  }
48
43
  export declare function sessionDeleteConflictFromError(err: unknown): SessionDeleteConflictDetail | null;
49
- export declare function sessionDeleteConflictContent(detail: Pick<SessionDeleteConflictDetail, 'kind' | 'remaining' | 'activeTaskId'>): string;
44
+ export declare function sessionDeleteConflictContent(detail: Pick<SessionDeleteConflictDetail, 'kind' | 'remaining' | 'activeTaskId'>, lang?: UiLanguage): string;
50
45
  export type SettingsPermissionBucket = 'allow' | 'deny' | 'ask';
51
46
  export type SettingsPermissionBucketRefusalReason = 'over_cap' | 'bad_entry';
52
47
  export interface SettingsPermissionBucketRefusalDetail {
@@ -58,12 +53,31 @@ export interface SettingsPermissionBucketRefusalDetail {
58
53
  readonly folded?: true;
59
54
  }
60
55
  export declare function settingsPermissionBucketRefusalFromError(err: unknown): SettingsPermissionBucketRefusalDetail | null;
61
- export declare function settingsPermissionBucketRefusalContent(detail: SettingsPermissionBucketRefusalDetail): string;
56
+ export type FieldLimitRefusalReason = 'over_cap' | 'too_long' | 'bad_entry';
57
+ export interface FieldLimitRefusalDetail {
58
+ readonly field: string;
59
+ readonly reason: FieldLimitRefusalReason;
60
+ readonly count?: number;
61
+ readonly cap?: number;
62
+ readonly index?: number;
63
+ readonly folded?: true;
64
+ }
65
+ export declare function fieldLimitRefusalFromError(err: {} | null | undefined): FieldLimitRefusalDetail | null;
66
+ export declare function fieldLimitRefusalContent(detail: FieldLimitRefusalDetail, lang?: UiLanguage): string;
67
+ export declare function settingsPermissionBucketRefusalContent(detail: SettingsPermissionBucketRefusalDetail, lang?: UiLanguage): string;
68
+ declare const PAYLOAD_TOO_LARGE = "request.payload_too_large";
69
+ declare const BLOB_TOO_LARGE_FOR_SQL = "blob_too_large_for_sql";
70
+ export interface AdmissionWallRefusalDetail {
71
+ readonly code: typeof PAYLOAD_TOO_LARGE | typeof BLOB_TOO_LARGE_FOR_SQL;
72
+ readonly wallSource: 'reported' | 'assumed' | 'operator';
73
+ }
74
+ export declare function admissionWallRefusalFromError(err: {} | null | undefined): AdmissionWallRefusalDetail | null;
75
+ export declare function admissionWallRefusalContent(detail: AdmissionWallRefusalDetail): string;
62
76
  export interface ToolDeclarationRefusalDetail {
63
77
  readonly code: string;
64
78
  }
65
79
  export declare function toolDeclarationRefusalFromError(err: unknown): ToolDeclarationRefusalDetail | null;
66
- export declare function toolDeclarationRefusalContent(_detail: Pick<ToolDeclarationRefusalDetail, 'code'>): string;
80
+ export declare function toolDeclarationRefusalContent(_detail: Pick<ToolDeclarationRefusalDetail, 'code'>, lang?: UiLanguage): string;
67
81
  export interface BodyShapeRefusalDetail {
68
82
  readonly unknownKeys?: readonly string[];
69
83
  readonly unsupportedKeys?: readonly string[];
@@ -76,37 +90,57 @@ export interface HostPostureRefusalDetail {
76
90
  readonly askedOpenWriteFace?: true;
77
91
  }
78
92
  export declare function hostPostureRefusalFromError(err: unknown, sentRequest?: TaskRequestLike): HostPostureRefusalDetail | null;
79
- export declare function hostPostureRefusalContent(detail: Pick<HostPostureRefusalDetail, 'askedWholeEnvironment' | 'askedOpenWriteFace'>): string;
93
+ export declare function hostPostureRefusalContent(detail: Pick<HostPostureRefusalDetail, 'askedWholeEnvironment' | 'askedOpenWriteFace'>, lang?: UiLanguage): string;
80
94
  export type HookMatcherRefusal = {
81
95
  readonly reason: 'alias_without_canonical';
82
96
  readonly event: string;
83
97
  readonly alias: string;
84
98
  readonly canonical: string;
99
+ readonly path?: readonly (string | number)[];
85
100
  } | {
86
101
  readonly reason: 'invalid_regex';
87
102
  readonly event: string;
88
103
  readonly groupIndex: number;
104
+ readonly path?: readonly (string | number)[];
89
105
  } | {
90
106
  readonly reason: 'over_budget';
91
107
  readonly event: string;
92
108
  readonly groupIndex: number;
93
109
  readonly budgetMs?: number;
110
+ readonly path?: readonly (string | number)[];
111
+ } | {
112
+ readonly reason: 'budget_exceeded';
113
+ readonly event: string;
114
+ readonly groupIndex: number;
115
+ readonly totalMs?: number;
116
+ readonly path?: readonly (string | number)[];
94
117
  };
95
118
  export declare function hookMatcherRefusalFromError(err: unknown): HookMatcherRefusal | undefined;
119
+ export interface SettingsHooksRefusal {
120
+ readonly reason: string;
121
+ readonly path?: readonly (string | number)[];
122
+ readonly matcher?: HookMatcherRefusal;
123
+ readonly count?: number;
124
+ readonly cap?: number;
125
+ }
126
+ export declare function settingsHooksRefusalFromError(err: {} | null | undefined): SettingsHooksRefusal | undefined;
96
127
  export interface AutonomyLaneRefusalDetail {
97
128
  readonly code: typeof REQUEST_AUTONOMY_LANE_REFUSED;
98
129
  }
99
130
  export declare function autonomyLaneRefusalFromError(err: unknown): AutonomyLaneRefusalDetail | null;
100
- export declare function autonomyLaneRefusalContent(): string;
131
+ export declare function autonomyLaneRefusalContent(lang?: UiLanguage): string;
101
132
  export interface UserAttachmentRefusalDetail {
102
133
  readonly code: typeof USER_ATTACHMENT_INVALID_ERROR_CODE;
103
134
  readonly retryable: false;
135
+ readonly index?: number;
136
+ readonly path?: string;
104
137
  }
105
138
  export declare function userAttachmentRefusalFromError(err: {} | null | undefined): UserAttachmentRefusalDetail | null;
106
- export declare function userAttachmentRefusalContent(): string;
139
+ export declare function userAttachmentRefusalContent(detail?: Pick<UserAttachmentRefusalDetail, 'index'>): string;
107
140
  export interface UserInvokedSkillRefusalDetail {
108
141
  readonly code: typeof USER_INVOKED_SKILL_UNKNOWN_ERROR_CODE;
109
142
  readonly retryable: false;
110
143
  }
111
144
  export declare function userInvokedSkillRefusalFromError(err: {} | null | undefined): UserInvokedSkillRefusalDetail | null;
112
145
  export declare function userInvokedSkillRefusalContent(): string;
146
+ export {};