@volter-ai-dev/supercode-ui 0.1.66 → 0.1.68
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.
- package/activity.mjs +249 -4
- package/components.d.ts +3 -0
- package/components.mjs +382 -14
- package/composer.mjs +18 -3
- package/controller.mjs +5 -0
- package/conversation.mjs +42 -3
- package/core.d.ts +13 -0
- package/core.mjs +390 -1
- package/embed.mjs +377 -13
- package/index.d.ts +159 -0
- package/messenger.mjs +377 -13
- package/package.json +1 -1
- package/react/activity.mjs +249 -4
- package/react/components.mjs +382 -14
- package/react/composer.mjs +18 -3
- package/react/conversation.mjs +42 -3
- package/react/messenger.mjs +377 -13
- package/react/sessions.mjs +68 -4
- package/react/settings.mjs +10 -1
- package/react/subagents.mjs +42 -3
- package/sessions.mjs +68 -4
- package/settings.mjs +10 -1
- package/styles.css +11 -1
- package/subagents.mjs +42 -3
package/index.d.ts
CHANGED
|
@@ -10,6 +10,51 @@ export type ExecutionMode = 'headless' | 'terminal';
|
|
|
10
10
|
export type ContinuationMode = ExecutionMode;
|
|
11
11
|
export type SessionActivity = 'idle' | 'recent' | 'running' | 'working' | 'needs-input' | 'finished' | 'failed' | 'unseen';
|
|
12
12
|
|
|
13
|
+
export type ContributionJson = null | boolean | number | string | ContributionJson[] | { [key: string]: ContributionJson };
|
|
14
|
+
|
|
15
|
+
export interface AgentContributionModel {
|
|
16
|
+
schema: 'supercode/contribution-v1';
|
|
17
|
+
id: string;
|
|
18
|
+
kind: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
placement?: { surface?: string; region?: string };
|
|
21
|
+
data: ContributionJson;
|
|
22
|
+
/** Workspace-relative declaration path; never an absolute host path. */
|
|
23
|
+
source: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface AgentPackageModel {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
version: string;
|
|
30
|
+
description: string | null;
|
|
31
|
+
capabilities: { required: string[]; optional: string[] };
|
|
32
|
+
/** Workspace-relative durable data location. */
|
|
33
|
+
storage: { relativePath: string };
|
|
34
|
+
resources: Record<string, AgentPackageResourceStateModel>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AgentPackageResourceModel {
|
|
38
|
+
schema: 'supercode/package-resource-v1';
|
|
39
|
+
contributionId: string;
|
|
40
|
+
format: 'json' | 'text';
|
|
41
|
+
mediaType: string;
|
|
42
|
+
data: ContributionJson;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type AgentPackageResourceStateModel =
|
|
46
|
+
| { schema: 'supercode/package-resource-state-v1'; status: 'ready'; resource: AgentPackageResourceModel }
|
|
47
|
+
| { schema: 'supercode/package-resource-state-v1'; status: 'absent'; contributionId: string }
|
|
48
|
+
| { schema: 'supercode/package-resource-state-v1'; status: 'error'; contributionId: string; message: string };
|
|
49
|
+
|
|
50
|
+
export interface AgentPackageCapabilityStateModel {
|
|
51
|
+
ready: boolean;
|
|
52
|
+
availableRequired: string[];
|
|
53
|
+
missingRequired: string[];
|
|
54
|
+
enabledOptional: string[];
|
|
55
|
+
unavailableOptional: string[];
|
|
56
|
+
}
|
|
57
|
+
|
|
13
58
|
export interface AgentActivityModel {
|
|
14
59
|
harness: HarnessId | '';
|
|
15
60
|
sessionKey: string | null;
|
|
@@ -45,6 +90,66 @@ export interface HarnessOption {
|
|
|
45
90
|
preferredLaunchMode?: ExecutionMode | null;
|
|
46
91
|
}
|
|
47
92
|
|
|
93
|
+
/** UNI-8: whose conversation a session is. */
|
|
94
|
+
export interface ParticipantModel {
|
|
95
|
+
kind: 'local-user' | 'foreign' | 'unknown';
|
|
96
|
+
/** The human ("@jane"), when known. */
|
|
97
|
+
label: string | null;
|
|
98
|
+
/** The surface the participant reached the agent through ("slack", "acp", ...). */
|
|
99
|
+
origin: string | null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** UNI-9: a typed workspace. `none` is a first-class value, not an empty path. */
|
|
103
|
+
export interface WorkspaceRefModel {
|
|
104
|
+
kind: 'repo' | 'none' | 'channel';
|
|
105
|
+
/** Path for `repo`, channel label for `channel`, null for `none`. */
|
|
106
|
+
value: string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** UNI-10: a bounded/truncated mirror of a session canonical in another store. */
|
|
110
|
+
export interface MirrorModel {
|
|
111
|
+
canonicalHarness: HarnessId;
|
|
112
|
+
/** Session key to cross-link to, when the host can resolve it. */
|
|
113
|
+
canonicalKey: string | null;
|
|
114
|
+
bounded: boolean;
|
|
115
|
+
truncated: boolean;
|
|
116
|
+
origin: string | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** UNI-11: which surface holds this session now; take-over is the transition. */
|
|
120
|
+
export interface HolderModel {
|
|
121
|
+
/** 'supercode' = held here; any other string = that surface; null = unheld. */
|
|
122
|
+
surface: string | null;
|
|
123
|
+
/** Take-over offered (flows through confirmIntent with action 'take_over'). */
|
|
124
|
+
canTakeOver: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** UNI-12/ORCH-6: why a session exists — the server's own `Trigger` enum.
|
|
128
|
+
* `manual` is the pre-ORCH-6 spelling of `human`, accepted on input and
|
|
129
|
+
* normalized to `human`. */
|
|
130
|
+
export type TriggerKind = 'human' | 'channel' | 'cron' | 'heartbeat' | 'webhook' | 'parent' | 'api' | 'unknown';
|
|
131
|
+
export interface TriggerModel {
|
|
132
|
+
kind: TriggerKind;
|
|
133
|
+
label: string | null;
|
|
134
|
+
/** ORCH-6: the compact surface key this conversation is reached on
|
|
135
|
+
* (`telegram:dm:123456`), when it has one. */
|
|
136
|
+
surface?: string | null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** ORCH-6: a conversation that moved to another surface (Hermes `handoff_*`). */
|
|
140
|
+
export interface CrossSurfaceModel {
|
|
141
|
+
state: string;
|
|
142
|
+
platform: string | null;
|
|
143
|
+
error: string | null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** UNI-12: one row representing N runs of a recurring trigger. */
|
|
147
|
+
export interface RecurringModel {
|
|
148
|
+
groupKey: string;
|
|
149
|
+
runs: number;
|
|
150
|
+
lastStatus: 'ok' | 'failed' | 'mixed' | null;
|
|
151
|
+
}
|
|
152
|
+
|
|
48
153
|
export interface SessionRowModel {
|
|
49
154
|
key: string;
|
|
50
155
|
harness: HarnessId;
|
|
@@ -67,6 +172,18 @@ export interface SessionRowModel {
|
|
|
67
172
|
subagentCount?: number;
|
|
68
173
|
/** Explicit activity used for child rows in the on-demand inspector. */
|
|
69
174
|
activity?: SessionActivity;
|
|
175
|
+
/** UNI-8: whose conversation this is (absent = local user). */
|
|
176
|
+
participant?: ParticipantModel;
|
|
177
|
+
/** UNI-9: typed workspace (derived from `cwd` when a host omits it). */
|
|
178
|
+
workspaceRef?: WorkspaceRefModel;
|
|
179
|
+
/** UNI-10: canonical-elsewhere provenance. */
|
|
180
|
+
mirror?: MirrorModel;
|
|
181
|
+
/** UNI-12: trigger provenance. */
|
|
182
|
+
trigger?: TriggerModel;
|
|
183
|
+
/** UNI-12: recurring-run grouping. */
|
|
184
|
+
recurring?: RecurringModel;
|
|
185
|
+
/** ORCH-6: moved-to-another-surface state, when the harness publishes one. */
|
|
186
|
+
crossSurface?: CrossSurfaceModel;
|
|
70
187
|
}
|
|
71
188
|
|
|
72
189
|
export interface SubagentInspectorModel {
|
|
@@ -315,6 +432,14 @@ export interface SupercodeUiState {
|
|
|
315
432
|
canConfigureSettings: boolean;
|
|
316
433
|
messaging: 'live_peer' | null;
|
|
317
434
|
workspace: string;
|
|
435
|
+
/** UNI-9: typed workspace for the attached conversation (always present after normalization). */
|
|
436
|
+
workspaceRef?: WorkspaceRefModel;
|
|
437
|
+
/** UNI-8: whose conversation the attached session is (defaults to local-user). */
|
|
438
|
+
participant?: ParticipantModel;
|
|
439
|
+
/** UNI-10: set when the attached session is a mirror. */
|
|
440
|
+
mirror?: MirrorModel | null;
|
|
441
|
+
/** UNI-11: which surface holds the attached session now. */
|
|
442
|
+
holder?: HolderModel | null;
|
|
318
443
|
taskPlan: TaskPlanModel;
|
|
319
444
|
semantics: SessionSemanticsModel;
|
|
320
445
|
terminalHandoff: { program: string; arguments: string[]; cwd: string } | null;
|
|
@@ -347,6 +472,12 @@ export interface SupercodeUiState {
|
|
|
347
472
|
attached: AttachedSessionModel | null;
|
|
348
473
|
owned: AttachedSessionModel | null;
|
|
349
474
|
attachError: { key: string; message: string } | null;
|
|
475
|
+
/** Browser-safe package metadata; host filesystem paths are deliberately omitted. */
|
|
476
|
+
agentPackage: AgentPackageModel | null;
|
|
477
|
+
contributions: AgentContributionModel[];
|
|
478
|
+
agentPackageError: string | null;
|
|
479
|
+
agentPackageCapabilityState: AgentPackageCapabilityStateModel | null;
|
|
480
|
+
agentPackageCapabilityError: string | null;
|
|
350
481
|
}
|
|
351
482
|
|
|
352
483
|
export type SupercodeUiIntent =
|
|
@@ -561,8 +692,36 @@ export interface MessengerProps {
|
|
|
561
692
|
export const EMPTY_UI_STATE: Readonly<SupercodeUiState>;
|
|
562
693
|
export const DEFAULT_LABELS: Readonly<MessengerLabels>;
|
|
563
694
|
export function normalizeUiState(value: unknown): SupercodeUiState;
|
|
695
|
+
export function normalizeContributions(value: unknown): AgentContributionModel[];
|
|
696
|
+
export function selectContributions(
|
|
697
|
+
contributions: unknown,
|
|
698
|
+
query?: { kind?: string; surface?: string; region?: string },
|
|
699
|
+
): AgentContributionModel[];
|
|
564
700
|
export function harnessDisplayName(id: string): string;
|
|
565
701
|
export function sessionDisplayName(session: Pick<SessionRowModel, 'name' | 'title'>): string;
|
|
702
|
+
/** ORCH-6: one `harness.v1.sessions.discover` / `sessions.load` row, as the
|
|
703
|
+
* service publishes it. Structurally the SDK's `SessionDescriptor`; declared
|
|
704
|
+
* here so the UI package stays dependency-free. */
|
|
705
|
+
export interface HarnessSessionDescriptorModel {
|
|
706
|
+
locator: { harness: string; session_id: string; storage?: unknown };
|
|
707
|
+
cwd?: string | null;
|
|
708
|
+
title?: string | null;
|
|
709
|
+
updated_at_ms?: number | null;
|
|
710
|
+
message_count?: number | null;
|
|
711
|
+
model?: string | null;
|
|
712
|
+
child_session_count?: number;
|
|
713
|
+
trigger?: TriggerKind | 'manual';
|
|
714
|
+
surface?: { key?: string; platform?: string; kind?: string; chat_id?: string; thread_id?: string; participant_id?: string };
|
|
715
|
+
profile?: string;
|
|
716
|
+
recurrence?: { job_id: string; kind: string };
|
|
717
|
+
cross_surface?: { state: string; platform?: string; error?: string };
|
|
718
|
+
workspace?: WorkspaceRefModel | { kind: 'repo' | 'channel' | 'none'; value?: string };
|
|
719
|
+
}
|
|
720
|
+
/** ORCH-6: `telegram:dm:123456` — the compact surface key a person reads. */
|
|
721
|
+
export function surfaceLabel(surface: unknown): string;
|
|
722
|
+
/** ORCH-6: project service rows into list rows. The conversation nouns are
|
|
723
|
+
* read off the server's derivation, never re-derived on the client. */
|
|
724
|
+
export function sessionRowsFromDescriptors(descriptors: readonly HarnessSessionDescriptorModel[] | unknown): SessionRowModel[];
|
|
566
725
|
export function relativeAge(updatedAt: number | null | undefined, now?: number): string;
|
|
567
726
|
export function sessionActivity(state: SupercodeUiState, row: SessionRowModel): SessionActivity;
|
|
568
727
|
export function projectAgentActivity(state: SupercodeUiState | unknown): AgentActivityModel;
|