@xenosystem/agent-interface-ui 0.1.21 → 0.1.23

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 (63) hide show
  1. package/dist/adapters/agentHostPlatformBridge.d.ts.map +1 -1
  2. package/dist/adapters/agentHostPlatformBridge.js +131 -0
  3. package/dist/adapters/agentHostPlatformBridge.js.map +1 -1
  4. package/dist/adapters/hubAgentPlatformBridge.d.ts.map +1 -1
  5. package/dist/adapters/hubAgentPlatformBridge.js +9 -0
  6. package/dist/adapters/hubAgentPlatformBridge.js.map +1 -1
  7. package/dist/components/agent/AgentInterface.d.ts.map +1 -1
  8. package/dist/components/agent/AgentInterface.js +247 -32
  9. package/dist/components/agent/AgentInterface.js.map +1 -1
  10. package/dist/components/agent/AgentPtyTerminalPanel.d.ts.map +1 -1
  11. package/dist/components/agent/AgentPtyTerminalPanel.js +66 -21
  12. package/dist/components/agent/AgentPtyTerminalPanel.js.map +1 -1
  13. package/dist/components/agent/AgentView.d.ts +5 -0
  14. package/dist/components/agent/AgentView.d.ts.map +1 -1
  15. package/dist/components/agent/AgentView.js +243 -37
  16. package/dist/components/agent/AgentView.js.map +1 -1
  17. package/dist/components/agent/nativeTuiComposerInput.d.ts +42 -0
  18. package/dist/components/agent/nativeTuiComposerInput.d.ts.map +1 -0
  19. package/dist/components/agent/nativeTuiComposerInput.js +51 -0
  20. package/dist/components/agent/nativeTuiComposerInput.js.map +1 -0
  21. package/dist/components/agent/ptyOutputReconciliation.d.ts +41 -0
  22. package/dist/components/agent/ptyOutputReconciliation.d.ts.map +1 -0
  23. package/dist/components/agent/ptyOutputReconciliation.js +68 -0
  24. package/dist/components/agent/ptyOutputReconciliation.js.map +1 -0
  25. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.d.ts.map +1 -1
  26. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js +3 -2
  27. package/dist/components/agent/settings/sections/DefaultAgentConfigSection.js.map +1 -1
  28. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js +1 -1
  29. package/dist/components/agent/settings/sections/WorkspaceDirectoryAccessSection.js.map +1 -1
  30. package/dist/components/agent/terminalSurfaceAvailability.d.ts +22 -0
  31. package/dist/components/agent/terminalSurfaceAvailability.d.ts.map +1 -0
  32. package/dist/components/agent/terminalSurfaceAvailability.js +43 -0
  33. package/dist/components/agent/terminalSurfaceAvailability.js.map +1 -0
  34. package/dist/components/agent/webJobProgressView.d.ts +90 -0
  35. package/dist/components/agent/webJobProgressView.d.ts.map +1 -0
  36. package/dist/components/agent/webJobProgressView.js +104 -0
  37. package/dist/components/agent/webJobProgressView.js.map +1 -0
  38. package/dist/platformApiTypes.d.ts +32 -0
  39. package/dist/platformApiTypes.d.ts.map +1 -1
  40. package/dist/platformBridge.d.ts +9 -0
  41. package/dist/platformBridge.d.ts.map +1 -1
  42. package/dist/platformBridge.js +11 -0
  43. package/dist/platformBridge.js.map +1 -1
  44. package/dist/stores/agentChatStore.d.ts +11 -1
  45. package/dist/stores/agentChatStore.d.ts.map +1 -1
  46. package/dist/stores/agentChatStore.js +103 -6
  47. package/dist/stores/agentChatStore.js.map +1 -1
  48. package/dist/stores/xenoChatStore.d.ts.map +1 -1
  49. package/dist/stores/xenoChatStore.js +2 -1
  50. package/dist/stores/xenoChatStore.js.map +1 -1
  51. package/dist/utils/acpExecutionAuthority.d.ts +8 -0
  52. package/dist/utils/acpExecutionAuthority.d.ts.map +1 -1
  53. package/dist/utils/acpExecutionAuthority.js +24 -0
  54. package/dist/utils/acpExecutionAuthority.js.map +1 -1
  55. package/dist/utils/modelAvailability.d.ts +11 -0
  56. package/dist/utils/modelAvailability.d.ts.map +1 -0
  57. package/dist/utils/modelAvailability.js +10 -0
  58. package/dist/utils/modelAvailability.js.map +1 -0
  59. package/dist/utils/providerAvailability.d.ts +8 -0
  60. package/dist/utils/providerAvailability.d.ts.map +1 -0
  61. package/dist/utils/providerAvailability.js +13 -0
  62. package/dist/utils/providerAvailability.js.map +1 -0
  63. package/package.json +5 -5
@@ -0,0 +1,104 @@
1
+ const OPERATION_LABELS = {
2
+ scrape: 'Scrape',
3
+ 'batch-scrape': 'Batch scrape',
4
+ map: 'Map',
5
+ crawl: 'Crawl',
6
+ render: 'Render',
7
+ extract: 'Extract',
8
+ };
9
+ const STATE_LABELS = {
10
+ queued: 'Queued',
11
+ running: 'Running',
12
+ completed: 'Completed',
13
+ partial: 'Partial',
14
+ failed: 'Failed',
15
+ cancelled: 'Cancelled',
16
+ };
17
+ const STATE_TONES = {
18
+ queued: 'queued',
19
+ running: 'running',
20
+ completed: 'succeeded',
21
+ partial: 'partial',
22
+ failed: 'failed',
23
+ cancelled: 'cancelled',
24
+ };
25
+ export function deriveWebJobProgressView(progress, toolCallStatus = 'running') {
26
+ const { counters } = progress;
27
+ const stale = !progress.terminal && toolCallStatus === 'done';
28
+ // `knownPages` is the producer's own sum and the contract validator has already
29
+ // refused any payload where it disagrees with its operands, so no division here
30
+ // can exceed 1 and none can divide by a number the counters do not support.
31
+ const settled = counters.completedPages + counters.failedPages + counters.excludedPages;
32
+ const percent = counters.knownPages > 0
33
+ ? Math.max(0, Math.min(100, Math.round((settled / counters.knownPages) * 100)))
34
+ : null;
35
+ const countersText = counters.knownPages > 0
36
+ ? `${settled}/${counters.knownPages} pages`
37
+ : 'no pages yet';
38
+ // Spoken as adjectives ("10 completed"), so no pluralisation is involved and a
39
+ // count of one cannot read as broken English in a screen reader.
40
+ const detail = [
41
+ `${counters.completedPages} completed`,
42
+ `${counters.activePages} active`,
43
+ `${counters.queuedPages} queued`,
44
+ ];
45
+ if (counters.failedPages > 0)
46
+ detail.push(`${counters.failedPages} failed`);
47
+ if (counters.excludedPages > 0)
48
+ detail.push(`${counters.excludedPages} excluded`);
49
+ const operationLabel = OPERATION_LABELS[progress.operation];
50
+ const observedLabel = STATE_LABELS[progress.state];
51
+ const stateLabel = stale ? `Last seen ${observedLabel.toLowerCase()}` : observedLabel;
52
+ const valueText = `${stateLabel}. ${countersText}. ${detail.join(', ')}.`;
53
+ return {
54
+ jobId: progress.jobId,
55
+ // A stale row is never tinted as live. `queued` is the quietest tone and is
56
+ // the right one for "we are not watching this any more".
57
+ tone: stale ? 'queued' : STATE_TONES[progress.state],
58
+ stateLabel,
59
+ operationLabel,
60
+ stale,
61
+ percent,
62
+ countersText,
63
+ valueText,
64
+ ariaLabel: `Web ${operationLabel.toLowerCase()} job progress`,
65
+ terminal: progress.terminal,
66
+ ...(progress.terminalReason ? { terminalReason: progress.terminalReason } : {}),
67
+ };
68
+ }
69
+ /**
70
+ * Decide whether a Stop control may be offered, and refuse to offer one that
71
+ * would not do what its label says.
72
+ *
73
+ * 🔴 Four conditions, and dropping any of them produces a lie rather than a bug.
74
+ * A settled job cannot be stopped. A closed tool call has no turn to interrupt.
75
+ * A turn that is not the one in flight is not the turn cancellation would reach —
76
+ * pressing Stop on an older card would cancel somebody else's work. And a
77
+ * composition that exposes no cancellation at all must show no control, because
78
+ * a button that silently does nothing is worse than an absent one.
79
+ *
80
+ * ⚠️ What this authorises is a TURN cancellation, which is the only cancellation
81
+ * this surface is allowed to reach: cancelling the durable job itself is a
82
+ * provider call, and the renderer may not make one. The label and title must say
83
+ * so — see `WEB_JOB_STOP_TITLE`.
84
+ */
85
+ export function webJobStopAvailability(input) {
86
+ if (input.progress.terminal)
87
+ return { available: false, reason: 'job_terminal' };
88
+ if (input.toolCallStatus !== 'running')
89
+ return { available: false, reason: 'tool_call_finished' };
90
+ if (!input.requestId || input.requestId !== input.activeRequestId) {
91
+ return { available: false, reason: 'turn_not_active' };
92
+ }
93
+ if (!input.hostExposesCancellation)
94
+ return { available: false, reason: 'host_exposes_no_cancellation' };
95
+ return { available: true };
96
+ }
97
+ export const WEB_JOB_STOP_LABEL = 'Stop';
98
+ /**
99
+ * The exact wording matters. This stops the agent turn; it does not reach into
100
+ * the web service and cancel the job, and claiming otherwise would be the
101
+ * fabricated-success failure this repo forbids.
102
+ */
103
+ export const WEB_JOB_STOP_TITLE = 'Stop this agent turn. The web job may keep running on the server until it settles.';
104
+ //# sourceMappingURL=webJobProgressView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webJobProgressView.js","sourceRoot":"","sources":["../../../src/components/agent/webJobProgressView.ts"],"names":[],"mappings":"AAoDA,MAAM,gBAAgB,GAAkD;IACtE,MAAM,EAAE,QAAQ;IAChB,cAAc,EAAE,cAAc;IAC9B,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,YAAY,GAA8C;IAC9D,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAA;AAED,MAAM,WAAW,GAA0D;IACzE,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;CACvB,CAAA;AAGD,MAAM,UAAU,wBAAwB,CACtC,QAA0B,EAC1B,iBAAqC,SAAS;IAE9C,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAA;IAC7B,MAAM,KAAK,GAAG,CAAC,QAAQ,CAAC,QAAQ,IAAI,cAAc,KAAK,MAAM,CAAA;IAC7D,gFAAgF;IAChF,gFAAgF;IAChF,4EAA4E;IAC5E,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAA;IACvF,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,GAAG,CAAC;QACrC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KA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cAAc;QACd,KAAK;QACL,OAAO;QACP,YAAY;QACZ,SAAS;QACT,SAAS,EAAE,OAAO,cAAc,CAAC,WAAW,EAAE,eAAe;QAC7D,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,GAAG,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChF,CAAA;AACH,CAAC;AAyBD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;IAChF,IAAI,KAAK,CAAC,cAAc,KAAK,SAAS;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,CAAA;IACjG,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,eAAe,EAAE,CAAC;QAClE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAA;IACxD,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,uBAAuB;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B,EAAE,CAAA;IACvG,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,oFAAoF,CAAA"}
@@ -1413,10 +1413,42 @@ export interface XenoAPI {
1413
1413
  code?: import('@xenosystem/agent-interface-contract').AgentCockpitErrorCode;
1414
1414
  error: string | null;
1415
1415
  }>;
1416
+ xenoTuiAttach?: (params: {
1417
+ conversationId: string;
1418
+ workspaceMode: 'workspace' | 'chat-only';
1419
+ workingDirectory?: string;
1420
+ workspaceId?: string;
1421
+ providerKind: 'sdk-native' | 'xeno-cloud' | 'acp-provider';
1422
+ providerId?: string;
1423
+ acpAgentConfigId?: string;
1424
+ model?: string;
1425
+ cols?: number;
1426
+ rows?: number;
1427
+ }) => Promise<import('@xenosystem/agent-interface-contract').AgentXenoTuiAttachResult & {
1428
+ lanes?: import('@xenosystem/agent-interface-contract').ProviderLaneProjectionV1[];
1429
+ }>;
1430
+ providerLaneSelect?: (params: {
1431
+ conversationId: string;
1432
+ workspaceMode: 'workspace' | 'chat-only';
1433
+ workingDirectory?: string;
1434
+ workspaceId?: string;
1435
+ providerKind: 'sdk-native' | 'xeno-cloud' | 'acp-provider';
1436
+ providerId?: string;
1437
+ acpAgentConfigId?: string;
1438
+ model?: string;
1439
+ }) => Promise<{
1440
+ success: boolean;
1441
+ error?: string;
1442
+ hostBinding?: import('@xenosystem/agent-interface-contract').AgentSessionHostBindingV1;
1443
+ activeLane?: import('@xenosystem/agent-interface-contract').ProviderLaneProjectionV1;
1444
+ lanes?: import('@xenosystem/agent-interface-contract').ProviderLaneProjectionV1[];
1445
+ }>;
1416
1446
  providerNativeAttach?: (params: {
1417
1447
  conversationId: string;
1418
1448
  laneId: string;
1419
1449
  expectedLaneRevision: number;
1450
+ workspaceTrust?: 'standard' | 'trusted';
1451
+ executionPolicy?: import('@xenosystem/agent-interface-contract').AgentNativeExecutionPolicy;
1420
1452
  cols?: number;
1421
1453
  rows?: number;
1422
1454
  }) => Promise<import('@xenosystem/agent-interface-contract').AgentProviderNativeAttachResult>;