@langspan/client 0.0.0-stage → 0.18.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.
- package/LICENSE +202 -0
- package/NOTICE +25 -0
- package/README.md +39 -2
- package/dist/commands/admission.d.ts +124 -0
- package/dist/commands/admission.js +4 -0
- package/dist/commands/checks.d.ts +115 -0
- package/dist/commands/checks.js +3 -0
- package/dist/commands/graph.d.ts +119 -0
- package/dist/commands/graph.js +4 -0
- package/dist/commands/index.d.ts +25 -0
- package/dist/commands/index.js +125 -0
- package/dist/commands/notes.d.ts +103 -0
- package/dist/commands/notes.js +3 -0
- package/dist/commands/policy.d.ts +49 -0
- package/dist/commands/policy.js +3 -0
- package/dist/commands/reads.d.ts +105 -0
- package/dist/commands/reads.js +4 -0
- package/dist/commands/remote.d.ts +52 -0
- package/dist/commands/remote.js +3 -0
- package/dist/commands/scans.d.ts +39 -0
- package/dist/commands/scans.js +4 -0
- package/dist/commands/sessions.d.ts +63 -0
- package/dist/commands/sessions.js +3 -0
- package/dist/commands/turns.d.ts +67 -0
- package/dist/commands/turns.js +3 -0
- package/dist/errors.d.ts +35 -0
- package/dist/errors.js +195 -0
- package/dist/node.d.ts +16 -0
- package/dist/node.js +78 -0
- package/dist/outcomes/admission.d.ts +79 -0
- package/dist/outcomes/admission.js +4 -0
- package/dist/outcomes/checks.d.ts +123 -0
- package/dist/outcomes/checks.js +4 -0
- package/dist/outcomes/graph.d.ts +181 -0
- package/dist/outcomes/graph.js +5 -0
- package/dist/outcomes/index.d.ts +21 -0
- package/dist/outcomes/index.js +126 -0
- package/dist/outcomes/log.d.ts +87 -0
- package/dist/outcomes/log.js +4 -0
- package/dist/outcomes/notes.d.ts +140 -0
- package/dist/outcomes/notes.js +4 -0
- package/dist/outcomes/sessions.d.ts +120 -0
- package/dist/outcomes/sessions.js +3 -0
- package/dist/protocol.d.ts +100 -0
- package/dist/protocol.js +167 -0
- package/dist/records.d.ts +250 -0
- package/dist/records.js +6 -0
- package/dist/values.d.ts +330 -0
- package/dist/values.js +7 -0
- package/package.json +43 -4
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { WorkspaceRegisterCommand, WorkspaceListCommand, WorkspaceMoveCommand, WorkspaceRemoveCommand, SessionRegisterCommand, ObserveSessionLivenessCommand, SessionSeenCommand, RecordContextCommand, ForgetToldCommand, ConfirmToldCommand } from "./sessions.ts";
|
|
2
|
+
import type { IntentPlanCommand, IntentSetCommand, IntentEndCommand, ReserveCommand, AdmitCommand, AdmitExpectedCommand, AdmitToolCommand, ObserveSourceCommand, ReportKeysCommand, CompleteCommand, ObserveCommand, ObserveToolCommand, ObserveDiskCommand, ObserveBranchCommand, ObserveWorkspaceGitCommand, RecordGitTroubleCommand } from "./admission.ts";
|
|
3
|
+
import type { RemoteEnableCommand, RemoteDisableCommand, RemoteOutboxCommand, RemotePublishedCommand, RemoteSentCommand, ObserveRemoteCommand, ForgetRemoteCommand, RemoteWithdrawnCommand } from "./remote.ts";
|
|
4
|
+
import type { RecordCheckCommand, FlakyTestsCommand, ForgetFlakyTestCommand, ExamplesCommand, RetireExampleCommand, ShowExampleCommand, AutoCheckEnableCommand, AutoCheckDisableCommand, CheckStatusCommand, LandingReadinessCommand, RecordLandingCommand, TakeTurnCommand, ReleaseTurnCommand, LeaveTurnQueueCommand, TurnQueueCommand } from "./checks.ts";
|
|
5
|
+
import type { ObserveInterfaceCommand, ObserveInterfaceDependentsCommand, RememberCommand, ObserveNoteAnchorsCommand, ForgetCommand, DecideCommand, DecisionsCommand, SendMessageCommand, AckMessageCommand, ShowMessageCommand, MessageStatusCommand, HandoffCommand, RetractMessageCommand } from "./notes.ts";
|
|
6
|
+
import type { ObserveScanCommand, ObserveCheckoutCommand, ObserveCheckoutRunCommand, ObserveUncoordinatedCommand, ObserveHostsCommand } from "./scans.ts";
|
|
7
|
+
import type { RecapCommand, TrailsCommand, RecallCommand, HistoryCommand, TodayCommand, GitTroubleCommand, CollisionsCommand, ReportCommand, CountCommand, UsageCommand, StatusLineCommand, StatusCommand, StatusRecordsCommand, DashboardCommand, VersionCommand, EventsCommand, ChangesCommand, CompactCommand } from "./reads.ts";
|
|
8
|
+
import type { RecordRefusalCommand, PolicyCommand, SetPolicyCommand, HoldersCommand, RecordWaitCommand, RecordUsageCommand } from "./policy.ts";
|
|
9
|
+
import type { GraphSymbolCommand, GraphReferencesCommand, GraphImpactCommand, GraphBlindSpotsCommand, GraphPathCommand, GraphMapCommand, PlanWorkCommand, GraphContextCommand, GraphInflightCommand, GraphExportCommand, GraphImportCommand, CheckWriteCommand, CheckCallsCommand, AcknowledgeInterfaceCommand, BetweenStepsCommand, InterfaceShownCommand, OutlineReadCommand } from "./graph.ts";
|
|
10
|
+
import type { SessionPromptCommand, SetPromptTargetsCommand, ObservePresenceCommand, SetPresenceCommand, SessionEndCommand, SessionStopCommand, ObserveToolBatchCommand, BriefCommand, AdoptCommand } from "./turns.ts";
|
|
11
|
+
export type * from "./sessions.ts";
|
|
12
|
+
export type * from "./admission.ts";
|
|
13
|
+
export type * from "./remote.ts";
|
|
14
|
+
export type * from "./checks.ts";
|
|
15
|
+
export type * from "./notes.ts";
|
|
16
|
+
export type * from "./scans.ts";
|
|
17
|
+
export type * from "./reads.ts";
|
|
18
|
+
export type * from "./policy.ts";
|
|
19
|
+
export type * from "./graph.ts";
|
|
20
|
+
export type * from "./turns.ts";
|
|
21
|
+
/** Every `op` of wire version 10, sorted. */
|
|
22
|
+
export declare const OPS: readonly ["ack_message", "acknowledge_interface", "admit", "admit_expected", "admit_tool", "adopt", "auto_check_disable", "auto_check_enable", "between_steps", "brief", "changes", "check_calls", "check_status", "check_write", "collisions", "compact", "complete", "confirm_told", "count", "dashboard", "decide", "decisions", "events", "examples", "flaky_tests", "forget", "forget_flaky_test", "forget_remote", "forget_told", "git_trouble", "graph_blind_spots", "graph_context", "graph_export", "graph_impact", "graph_import", "graph_inflight", "graph_map", "graph_path", "graph_references", "graph_symbol", "handoff", "history", "holders", "intent_end", "intent_plan", "intent_set", "interface_shown", "landing_readiness", "leave_turn_queue", "message_status", "observe", "observe_branch", "observe_checkout", "observe_checkout_run", "observe_disk", "observe_hosts", "observe_interface", "observe_interface_dependents", "observe_note_anchors", "observe_presence", "observe_remote", "observe_scan", "observe_session_liveness", "observe_source", "observe_tool", "observe_tool_batch", "observe_uncoordinated", "observe_workspace_git", "outline_read", "plan_work", "policy", "recall", "recap", "record_check", "record_context", "record_git_trouble", "record_landing", "record_refusal", "record_usage", "record_wait", "release_turn", "remember", "remote_disable", "remote_enable", "remote_outbox", "remote_published", "remote_sent", "remote_withdrawn", "report", "report_keys", "reserve", "retire_example", "retract_message", "send_message", "session_end", "session_prompt", "session_register", "session_seen", "session_stop", "set_policy", "set_presence", "set_prompt_targets", "show_example", "show_message", "status", "status_line", "status_records", "take_turn", "today", "trails", "turn_queue", "usage", "version", "workspace_list", "workspace_move", "workspace_register", "workspace_remove"];
|
|
23
|
+
export type Op = (typeof OPS)[number];
|
|
24
|
+
/** A command of this coordinator, told apart by `op`. */
|
|
25
|
+
export type Command = WorkspaceRegisterCommand | WorkspaceListCommand | WorkspaceMoveCommand | WorkspaceRemoveCommand | SessionRegisterCommand | ObserveSessionLivenessCommand | SessionSeenCommand | RecordContextCommand | ForgetToldCommand | ConfirmToldCommand | IntentSetCommand | IntentPlanCommand | IntentEndCommand | ReserveCommand | AdmitCommand | AdmitExpectedCommand | AdmitToolCommand | ObserveSourceCommand | ReportKeysCommand | CompleteCommand | ObserveCommand | ObserveToolCommand | ObserveDiskCommand | ObserveBranchCommand | ObserveWorkspaceGitCommand | RecordGitTroubleCommand | RemoteEnableCommand | RemoteDisableCommand | RemoteOutboxCommand | RemotePublishedCommand | RemoteSentCommand | ObserveRemoteCommand | ForgetRemoteCommand | RemoteWithdrawnCommand | RecordCheckCommand | FlakyTestsCommand | ForgetFlakyTestCommand | ExamplesCommand | RetireExampleCommand | ShowExampleCommand | AutoCheckEnableCommand | AutoCheckDisableCommand | CheckStatusCommand | LandingReadinessCommand | RecordLandingCommand | TakeTurnCommand | ReleaseTurnCommand | LeaveTurnQueueCommand | TurnQueueCommand | ObserveInterfaceCommand | ObserveInterfaceDependentsCommand | RememberCommand | ObserveNoteAnchorsCommand | ForgetCommand | DecideCommand | DecisionsCommand | SendMessageCommand | AckMessageCommand | ShowMessageCommand | MessageStatusCommand | HandoffCommand | RetractMessageCommand | ObserveScanCommand | ObserveCheckoutCommand | ObserveCheckoutRunCommand | ObserveUncoordinatedCommand | ObserveHostsCommand | RecapCommand | TrailsCommand | RecallCommand | HistoryCommand | TodayCommand | GitTroubleCommand | CollisionsCommand | ReportCommand | CountCommand | UsageCommand | StatusLineCommand | StatusCommand | StatusRecordsCommand | DashboardCommand | VersionCommand | EventsCommand | ChangesCommand | CompactCommand | RecordRefusalCommand | PolicyCommand | SetPolicyCommand | HoldersCommand | RecordWaitCommand | RecordUsageCommand | GraphSymbolCommand | GraphReferencesCommand | GraphImpactCommand | GraphBlindSpotsCommand | GraphPathCommand | GraphMapCommand | PlanWorkCommand | GraphContextCommand | GraphInflightCommand | GraphExportCommand | GraphImportCommand | CheckWriteCommand | CheckCallsCommand | AcknowledgeInterfaceCommand | BetweenStepsCommand | InterfaceShownCommand | OutlineReadCommand | SessionPromptCommand | SetPromptTargetsCommand | ObservePresenceCommand | SetPresenceCommand | SessionEndCommand | SessionStopCommand | ObserveToolBatchCommand | BriefCommand | AdoptCommand;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Every command a coordinator answers with one answer, as `CommandWire` in
|
|
2
|
+
// `crates/langspan-core/src/command.rs` decodes it. test/rust-source.test.ts
|
|
3
|
+
// checks each one, field by field, against that enum.
|
|
4
|
+
/** Every `op` of wire version 10, sorted. */
|
|
5
|
+
export const OPS = [
|
|
6
|
+
"ack_message",
|
|
7
|
+
"acknowledge_interface",
|
|
8
|
+
"admit",
|
|
9
|
+
"admit_expected",
|
|
10
|
+
"admit_tool",
|
|
11
|
+
"adopt",
|
|
12
|
+
"auto_check_disable",
|
|
13
|
+
"auto_check_enable",
|
|
14
|
+
"between_steps",
|
|
15
|
+
"brief",
|
|
16
|
+
"changes",
|
|
17
|
+
"check_calls",
|
|
18
|
+
"check_status",
|
|
19
|
+
"check_write",
|
|
20
|
+
"collisions",
|
|
21
|
+
"compact",
|
|
22
|
+
"complete",
|
|
23
|
+
"confirm_told",
|
|
24
|
+
"count",
|
|
25
|
+
"dashboard",
|
|
26
|
+
"decide",
|
|
27
|
+
"decisions",
|
|
28
|
+
"events",
|
|
29
|
+
"examples",
|
|
30
|
+
"flaky_tests",
|
|
31
|
+
"forget",
|
|
32
|
+
"forget_flaky_test",
|
|
33
|
+
"forget_remote",
|
|
34
|
+
"forget_told",
|
|
35
|
+
"git_trouble",
|
|
36
|
+
"graph_blind_spots",
|
|
37
|
+
"graph_context",
|
|
38
|
+
"graph_export",
|
|
39
|
+
"graph_impact",
|
|
40
|
+
"graph_import",
|
|
41
|
+
"graph_inflight",
|
|
42
|
+
"graph_map",
|
|
43
|
+
"graph_path",
|
|
44
|
+
"graph_references",
|
|
45
|
+
"graph_symbol",
|
|
46
|
+
"handoff",
|
|
47
|
+
"history",
|
|
48
|
+
"holders",
|
|
49
|
+
"intent_end",
|
|
50
|
+
"intent_plan",
|
|
51
|
+
"intent_set",
|
|
52
|
+
"interface_shown",
|
|
53
|
+
"landing_readiness",
|
|
54
|
+
"leave_turn_queue",
|
|
55
|
+
"message_status",
|
|
56
|
+
"observe",
|
|
57
|
+
"observe_branch",
|
|
58
|
+
"observe_checkout",
|
|
59
|
+
"observe_checkout_run",
|
|
60
|
+
"observe_disk",
|
|
61
|
+
"observe_hosts",
|
|
62
|
+
"observe_interface",
|
|
63
|
+
"observe_interface_dependents",
|
|
64
|
+
"observe_note_anchors",
|
|
65
|
+
"observe_presence",
|
|
66
|
+
"observe_remote",
|
|
67
|
+
"observe_scan",
|
|
68
|
+
"observe_session_liveness",
|
|
69
|
+
"observe_source",
|
|
70
|
+
"observe_tool",
|
|
71
|
+
"observe_tool_batch",
|
|
72
|
+
"observe_uncoordinated",
|
|
73
|
+
"observe_workspace_git",
|
|
74
|
+
"outline_read",
|
|
75
|
+
"plan_work",
|
|
76
|
+
"policy",
|
|
77
|
+
"recall",
|
|
78
|
+
"recap",
|
|
79
|
+
"record_check",
|
|
80
|
+
"record_context",
|
|
81
|
+
"record_git_trouble",
|
|
82
|
+
"record_landing",
|
|
83
|
+
"record_refusal",
|
|
84
|
+
"record_usage",
|
|
85
|
+
"record_wait",
|
|
86
|
+
"release_turn",
|
|
87
|
+
"remember",
|
|
88
|
+
"remote_disable",
|
|
89
|
+
"remote_enable",
|
|
90
|
+
"remote_outbox",
|
|
91
|
+
"remote_published",
|
|
92
|
+
"remote_sent",
|
|
93
|
+
"remote_withdrawn",
|
|
94
|
+
"report",
|
|
95
|
+
"report_keys",
|
|
96
|
+
"reserve",
|
|
97
|
+
"retire_example",
|
|
98
|
+
"retract_message",
|
|
99
|
+
"send_message",
|
|
100
|
+
"session_end",
|
|
101
|
+
"session_prompt",
|
|
102
|
+
"session_register",
|
|
103
|
+
"session_seen",
|
|
104
|
+
"session_stop",
|
|
105
|
+
"set_policy",
|
|
106
|
+
"set_presence",
|
|
107
|
+
"set_prompt_targets",
|
|
108
|
+
"show_example",
|
|
109
|
+
"show_message",
|
|
110
|
+
"status",
|
|
111
|
+
"status_line",
|
|
112
|
+
"status_records",
|
|
113
|
+
"take_turn",
|
|
114
|
+
"today",
|
|
115
|
+
"trails",
|
|
116
|
+
"turn_queue",
|
|
117
|
+
"usage",
|
|
118
|
+
"version",
|
|
119
|
+
"workspace_list",
|
|
120
|
+
"workspace_move",
|
|
121
|
+
"workspace_register",
|
|
122
|
+
"workspace_remove",
|
|
123
|
+
];
|
|
124
|
+
const opsMatchCommands = true;
|
|
125
|
+
void opsMatchCommands;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { InterfaceChange, ToSymbol } from "../values.ts";
|
|
2
|
+
export interface ObserveInterfaceCommand {
|
|
3
|
+
op: "observe_interface";
|
|
4
|
+
workspace_id: string;
|
|
5
|
+
path: string;
|
|
6
|
+
changes: InterfaceChange[];
|
|
7
|
+
dependents: string[];
|
|
8
|
+
}
|
|
9
|
+
/** Internal to the daemon's scan. */
|
|
10
|
+
export interface ObserveInterfaceDependentsCommand {
|
|
11
|
+
op: "observe_interface_dependents";
|
|
12
|
+
notice_workspace_id: string;
|
|
13
|
+
notice_id: string;
|
|
14
|
+
workspace_id: string;
|
|
15
|
+
paths: string[];
|
|
16
|
+
}
|
|
17
|
+
/** Keep a note; `symbol` anchors it to one indexed definition. */
|
|
18
|
+
export interface RememberCommand {
|
|
19
|
+
op: "remember";
|
|
20
|
+
workspace_id: string;
|
|
21
|
+
author: string | null;
|
|
22
|
+
text: string;
|
|
23
|
+
paths: string[];
|
|
24
|
+
symbol?: string;
|
|
25
|
+
tags?: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface ObserveNoteAnchorsCommand {
|
|
28
|
+
op: "observe_note_anchors";
|
|
29
|
+
workspace_id: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ForgetCommand {
|
|
32
|
+
op: "forget";
|
|
33
|
+
workspace_id: string;
|
|
34
|
+
note_id: string;
|
|
35
|
+
}
|
|
36
|
+
/** A standing decision: lines of the named files that must stay or must not come back. */
|
|
37
|
+
export interface DecideCommand {
|
|
38
|
+
op: "decide";
|
|
39
|
+
workspace_id: string;
|
|
40
|
+
author: string | null;
|
|
41
|
+
text: string;
|
|
42
|
+
paths: string[];
|
|
43
|
+
keep?: string[];
|
|
44
|
+
avoid?: string[];
|
|
45
|
+
}
|
|
46
|
+
/** Read-only: the workspace's standing decisions, newest first. */
|
|
47
|
+
export interface DecisionsCommand {
|
|
48
|
+
op: "decisions";
|
|
49
|
+
workspace_id: string;
|
|
50
|
+
}
|
|
51
|
+
/** One line to a session (`to`), or to every other one; `from` null is the owner. */
|
|
52
|
+
export interface SendMessageCommand {
|
|
53
|
+
op: "send_message";
|
|
54
|
+
workspace_id: string;
|
|
55
|
+
from: string | null;
|
|
56
|
+
to: string | null;
|
|
57
|
+
text: string;
|
|
58
|
+
paths: string[];
|
|
59
|
+
/** Tell each session concerned with one of these files at its briefings; capability `message_paths`. */
|
|
60
|
+
to_paths?: string[];
|
|
61
|
+
/** Tell the sessions working on a name; the coordinator fills `files` from its index. Capability `message_paths`. */
|
|
62
|
+
to_symbol?: ToSymbol;
|
|
63
|
+
/** Publish it to the sessions on other machines too; capability `remote_messages`. */
|
|
64
|
+
remote?: boolean;
|
|
65
|
+
/** Where `from` came from: `shell_hook`, `given` or `mcp`; capability `sender_source`. */
|
|
66
|
+
sender_source?: string;
|
|
67
|
+
/** Push it into the recipient's running session at once; needs `to`. Capability `push_messages`. */
|
|
68
|
+
now?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface AckMessageCommand {
|
|
71
|
+
op: "ack_message";
|
|
72
|
+
session_id: string;
|
|
73
|
+
message_id: string;
|
|
74
|
+
/** The session's `langspan mcp` process pushed it; capability `push_messages`. */
|
|
75
|
+
pushed?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** Read-only: one message as it was sent. */
|
|
78
|
+
export interface ShowMessageCommand {
|
|
79
|
+
op: "show_message";
|
|
80
|
+
workspace_id: string;
|
|
81
|
+
message_id: string;
|
|
82
|
+
}
|
|
83
|
+
/** Read-only: who was given a sent message. */
|
|
84
|
+
export interface MessageStatusCommand {
|
|
85
|
+
op: "message_status";
|
|
86
|
+
workspace_id: string;
|
|
87
|
+
from?: string;
|
|
88
|
+
message_id?: string;
|
|
89
|
+
}
|
|
90
|
+
/** Leave one line for the next other session of this session's workspace. */
|
|
91
|
+
export interface HandoffCommand {
|
|
92
|
+
op: "handoff";
|
|
93
|
+
session_id: string;
|
|
94
|
+
text: string;
|
|
95
|
+
paths: string[];
|
|
96
|
+
}
|
|
97
|
+
/** Withdraw a message; `message_id` null is the newest one `from` sent. */
|
|
98
|
+
export interface RetractMessageCommand {
|
|
99
|
+
op: "retract_message";
|
|
100
|
+
workspace_id: string;
|
|
101
|
+
from: string | null;
|
|
102
|
+
message_id: string | null;
|
|
103
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ObservedFile, PathRegions, Policy, PolicyCase, RefusalKind, WaitResult } from "../values.ts";
|
|
2
|
+
import type { TokenCounts } from "../records.ts";
|
|
3
|
+
/** A refusal the hook decided itself, such as a held commit. */
|
|
4
|
+
export interface RecordRefusalCommand {
|
|
5
|
+
op: "record_refusal";
|
|
6
|
+
session_id: string;
|
|
7
|
+
kind: RefusalKind;
|
|
8
|
+
paths: string[];
|
|
9
|
+
peer_session_id?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Read-only: the policy table in effect for a workspace. */
|
|
12
|
+
export interface PolicyCommand {
|
|
13
|
+
op: "policy";
|
|
14
|
+
workspace_id: string;
|
|
15
|
+
}
|
|
16
|
+
/** The owner sets the policy for a case; fixed cases are refused. */
|
|
17
|
+
export interface SetPolicyCommand {
|
|
18
|
+
op: "set_policy";
|
|
19
|
+
workspace_id: string;
|
|
20
|
+
case: PolicyCase;
|
|
21
|
+
policy: Policy;
|
|
22
|
+
wait_ms?: number;
|
|
23
|
+
}
|
|
24
|
+
/** Read-only: the current holders an admission of `paths` would meet. */
|
|
25
|
+
export interface HoldersCommand {
|
|
26
|
+
op: "holders";
|
|
27
|
+
session_id: string;
|
|
28
|
+
paths: string[];
|
|
29
|
+
base?: ObservedFile[];
|
|
30
|
+
regions?: PathRegions[];
|
|
31
|
+
}
|
|
32
|
+
/** A hook's wait for a current holder and how it ended. */
|
|
33
|
+
export interface RecordWaitCommand {
|
|
34
|
+
op: "record_wait";
|
|
35
|
+
session_id: string;
|
|
36
|
+
paths: string[];
|
|
37
|
+
holder_session_id?: string;
|
|
38
|
+
waited_ms: number;
|
|
39
|
+
result: WaitResult;
|
|
40
|
+
changed?: ObservedFile[];
|
|
41
|
+
input_digest?: string;
|
|
42
|
+
}
|
|
43
|
+
/** One turn's token counts from the host's transcript; capability `usage`. */
|
|
44
|
+
export interface RecordUsageCommand {
|
|
45
|
+
op: "record_usage";
|
|
46
|
+
session_id: string;
|
|
47
|
+
model?: string | null;
|
|
48
|
+
tokens: TokenCounts;
|
|
49
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { SinceFrom } from "../values.ts";
|
|
2
|
+
/** Read-only: a bounded account of one workspace. */
|
|
3
|
+
export interface RecapCommand {
|
|
4
|
+
op: "recap";
|
|
5
|
+
workspace_id: string;
|
|
6
|
+
tag?: string;
|
|
7
|
+
since?: SinceFrom;
|
|
8
|
+
}
|
|
9
|
+
/** Read-only: the newest trails ended sessions left. */
|
|
10
|
+
export interface TrailsCommand {
|
|
11
|
+
op: "trails";
|
|
12
|
+
workspace_id: string;
|
|
13
|
+
limit?: number;
|
|
14
|
+
}
|
|
15
|
+
/** Read-only: the notes that hold every word of `query`. */
|
|
16
|
+
export interface RecallCommand {
|
|
17
|
+
op: "recall";
|
|
18
|
+
workspace_id: string;
|
|
19
|
+
query: string;
|
|
20
|
+
path?: string;
|
|
21
|
+
limit: number;
|
|
22
|
+
}
|
|
23
|
+
/** Read-only: the recorded interface changes of definitions named `name`. */
|
|
24
|
+
export interface HistoryCommand {
|
|
25
|
+
op: "history";
|
|
26
|
+
workspace_id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
path?: string;
|
|
29
|
+
limit: number;
|
|
30
|
+
before_seq?: number;
|
|
31
|
+
}
|
|
32
|
+
/** Read-only: what happened since `from_ms` (Unix milliseconds). */
|
|
33
|
+
export interface TodayCommand {
|
|
34
|
+
op: "today";
|
|
35
|
+
workspace_id?: string;
|
|
36
|
+
from_ms: number;
|
|
37
|
+
}
|
|
38
|
+
/** Read-only: the collisions of one workspace, refusals still to reconcile first; capability `collisions`. */
|
|
39
|
+
export interface CollisionsCommand {
|
|
40
|
+
op: "collisions";
|
|
41
|
+
workspace_id: string;
|
|
42
|
+
/** Leave resolved and expired items out. */
|
|
43
|
+
open_only?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** Read-only: the Git trouble seen in one workspace's agents' shells; capability `git_trouble`. */
|
|
46
|
+
export interface GitTroubleCommand {
|
|
47
|
+
op: "git_trouble";
|
|
48
|
+
workspace_id: string;
|
|
49
|
+
}
|
|
50
|
+
/** Read-only: the coordination report of one workspace since `from_ms`. */
|
|
51
|
+
export interface ReportCommand {
|
|
52
|
+
op: "report";
|
|
53
|
+
workspace_id: string;
|
|
54
|
+
from_ms: number;
|
|
55
|
+
}
|
|
56
|
+
/** Read-only: refusals in the local days starting at each of `days`. */
|
|
57
|
+
export interface CountCommand {
|
|
58
|
+
op: "count";
|
|
59
|
+
days: number[];
|
|
60
|
+
}
|
|
61
|
+
/** Read-only: the token counts recorded per session and model; capability `usage`. */
|
|
62
|
+
export interface UsageCommand {
|
|
63
|
+
op: "usage";
|
|
64
|
+
workspace_id?: string | null;
|
|
65
|
+
from_ms?: number | null;
|
|
66
|
+
}
|
|
67
|
+
/** Read-only: the person's status line for the directory `root`. */
|
|
68
|
+
export interface StatusLineCommand {
|
|
69
|
+
op: "status_line";
|
|
70
|
+
root: string;
|
|
71
|
+
from_ms: number;
|
|
72
|
+
}
|
|
73
|
+
export interface StatusCommand {
|
|
74
|
+
op: "status";
|
|
75
|
+
}
|
|
76
|
+
export interface StatusRecordsCommand {
|
|
77
|
+
op: "status_records";
|
|
78
|
+
after?: string | null;
|
|
79
|
+
page_bytes?: number | null;
|
|
80
|
+
}
|
|
81
|
+
export interface DashboardCommand {
|
|
82
|
+
op: "dashboard";
|
|
83
|
+
}
|
|
84
|
+
export interface VersionCommand {
|
|
85
|
+
op: "version";
|
|
86
|
+
}
|
|
87
|
+
/** One page of the event log after the sequence number `after`. */
|
|
88
|
+
export interface EventsCommand {
|
|
89
|
+
op: "events";
|
|
90
|
+
after: number;
|
|
91
|
+
limit: number;
|
|
92
|
+
}
|
|
93
|
+
/** One page of one workspace's events after `after`. */
|
|
94
|
+
export interface ChangesCommand {
|
|
95
|
+
op: "changes";
|
|
96
|
+
workspace_id: string;
|
|
97
|
+
after: number;
|
|
98
|
+
limit: number;
|
|
99
|
+
}
|
|
100
|
+
/** Remove events older than `keep_days`; without `apply`, a dry run. */
|
|
101
|
+
export interface CompactCommand {
|
|
102
|
+
op: "compact";
|
|
103
|
+
keep_days: number;
|
|
104
|
+
apply?: boolean;
|
|
105
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Publication } from "../values.ts";
|
|
2
|
+
export interface RemoteEnableCommand {
|
|
3
|
+
op: "remote_enable";
|
|
4
|
+
workspace_id: string;
|
|
5
|
+
remote: string;
|
|
6
|
+
participant: string;
|
|
7
|
+
name: string;
|
|
8
|
+
share_task: boolean;
|
|
9
|
+
publish_as_branch?: boolean;
|
|
10
|
+
/** Messages sent with `remote` leave the machine (ADR 0041). */
|
|
11
|
+
share_messages?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface RemoteDisableCommand {
|
|
14
|
+
op: "remote_disable";
|
|
15
|
+
workspace_id: string;
|
|
16
|
+
}
|
|
17
|
+
/** Read-only: what this workspace would publish next. */
|
|
18
|
+
export interface RemoteOutboxCommand {
|
|
19
|
+
op: "remote_outbox";
|
|
20
|
+
workspace_id: string;
|
|
21
|
+
}
|
|
22
|
+
/** The publication was pushed; `payload` is the exact `state.json` pushed. */
|
|
23
|
+
export interface RemotePublishedCommand {
|
|
24
|
+
op: "remote_published";
|
|
25
|
+
workspace_id: string;
|
|
26
|
+
sequence: number;
|
|
27
|
+
signature: string;
|
|
28
|
+
payload?: string;
|
|
29
|
+
published_at_ms?: number;
|
|
30
|
+
as_branch?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Read-only: the latest publications that left, newest first. */
|
|
33
|
+
export interface RemoteSentCommand {
|
|
34
|
+
op: "remote_sent";
|
|
35
|
+
workspace_id: string;
|
|
36
|
+
limit: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ObserveRemoteCommand {
|
|
39
|
+
op: "observe_remote";
|
|
40
|
+
workspace_id: string;
|
|
41
|
+
publication: Publication;
|
|
42
|
+
}
|
|
43
|
+
/** The teammate's ref is gone from the remote. */
|
|
44
|
+
export interface ForgetRemoteCommand {
|
|
45
|
+
op: "forget_remote";
|
|
46
|
+
workspace_id: string;
|
|
47
|
+
participant: string;
|
|
48
|
+
}
|
|
49
|
+
export interface RemoteWithdrawnCommand {
|
|
50
|
+
op: "remote_withdrawn";
|
|
51
|
+
workspace_id: string;
|
|
52
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ObservedFile, ScanCoverage } from "../values.ts";
|
|
2
|
+
/** The observer's latest attempt: `failure` null for a completed scan. */
|
|
3
|
+
export interface ObserveScanCommand {
|
|
4
|
+
op: "observe_scan";
|
|
5
|
+
workspace_id: string;
|
|
6
|
+
failure: string | null;
|
|
7
|
+
coverage?: ScanCoverage;
|
|
8
|
+
}
|
|
9
|
+
export interface ObserveCheckoutCommand {
|
|
10
|
+
op: "observe_checkout";
|
|
11
|
+
workspace_id: string;
|
|
12
|
+
from_branch: string | null;
|
|
13
|
+
to_branch: string | null;
|
|
14
|
+
from_head: string | null;
|
|
15
|
+
to_head: string | null;
|
|
16
|
+
files: number;
|
|
17
|
+
}
|
|
18
|
+
/** A session's shell command ran a Git operation that changed its checkout. */
|
|
19
|
+
export interface ObserveCheckoutRunCommand {
|
|
20
|
+
op: "observe_checkout_run";
|
|
21
|
+
session_id: string;
|
|
22
|
+
command?: string;
|
|
23
|
+
to_branch: string | null;
|
|
24
|
+
to_head: string | null;
|
|
25
|
+
ran_ms: number;
|
|
26
|
+
finished_ago_ms?: number;
|
|
27
|
+
files_unchanged?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface ObserveUncoordinatedCommand {
|
|
30
|
+
op: "observe_uncoordinated";
|
|
31
|
+
workspace_id: string;
|
|
32
|
+
files: ObservedFile[];
|
|
33
|
+
scanned_from_ms?: number;
|
|
34
|
+
}
|
|
35
|
+
/** Every host present now with no LangSpan install covering it. */
|
|
36
|
+
export interface ObserveHostsCommand {
|
|
37
|
+
op: "observe_hosts";
|
|
38
|
+
not_installed: string[];
|
|
39
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { LivenessStatus, ProcessIdentity, U64 } from "../values.ts";
|
|
2
|
+
export interface WorkspaceRegisterCommand {
|
|
3
|
+
op: "workspace_register";
|
|
4
|
+
workspace_id: string;
|
|
5
|
+
/** The checkout's absolute path. */
|
|
6
|
+
root: string;
|
|
7
|
+
}
|
|
8
|
+
/** Read-only: one page of the registered workspaces, after the ID `after`. */
|
|
9
|
+
export interface WorkspaceListCommand {
|
|
10
|
+
op: "workspace_list";
|
|
11
|
+
after?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/** Rebind the workspace to `root`. An owner command. */
|
|
14
|
+
export interface WorkspaceMoveCommand {
|
|
15
|
+
op: "workspace_move";
|
|
16
|
+
workspace_id: string;
|
|
17
|
+
root: string;
|
|
18
|
+
switch?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Take the workspace out of coordination; without `apply`, a dry run. */
|
|
21
|
+
export interface WorkspaceRemoveCommand {
|
|
22
|
+
op: "workspace_remove";
|
|
23
|
+
workspace_id: string;
|
|
24
|
+
apply?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface SessionRegisterCommand {
|
|
27
|
+
op: "session_register";
|
|
28
|
+
session_id: string;
|
|
29
|
+
workspace_id: string;
|
|
30
|
+
parent?: string;
|
|
31
|
+
headless?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Liveness never extends or releases a lease. */
|
|
34
|
+
export interface ObserveSessionLivenessCommand {
|
|
35
|
+
op: "observe_session_liveness";
|
|
36
|
+
session_id: string;
|
|
37
|
+
process: ProcessIdentity;
|
|
38
|
+
status: LivenessStatus;
|
|
39
|
+
}
|
|
40
|
+
/** A hook run of the session reached the coordinator. */
|
|
41
|
+
export interface SessionSeenCommand {
|
|
42
|
+
op: "session_seen";
|
|
43
|
+
session_id: string;
|
|
44
|
+
}
|
|
45
|
+
/** The hook placed `bytes` of text in the session's context. A measurement. */
|
|
46
|
+
export interface RecordContextCommand {
|
|
47
|
+
op: "record_context";
|
|
48
|
+
session_id: string;
|
|
49
|
+
bytes: number;
|
|
50
|
+
turn?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/** These briefing items could not be placed in context: no longer told. */
|
|
53
|
+
export interface ForgetToldCommand {
|
|
54
|
+
op: "forget_told";
|
|
55
|
+
session_id: string;
|
|
56
|
+
keys: U64[];
|
|
57
|
+
}
|
|
58
|
+
/** These briefing items were placed in context: told. */
|
|
59
|
+
export interface ConfirmToldCommand {
|
|
60
|
+
op: "confirm_told";
|
|
61
|
+
session_id: string;
|
|
62
|
+
keys: U64[];
|
|
63
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { PresenceKind, TrailFacts } from "../values.ts";
|
|
2
|
+
export interface SessionPromptCommand {
|
|
3
|
+
op: "session_prompt";
|
|
4
|
+
session_id: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
line_digests?: string[];
|
|
7
|
+
}
|
|
8
|
+
/** Where the definitions the session's prompt named are. Paths only. */
|
|
9
|
+
export interface SetPromptTargetsCommand {
|
|
10
|
+
op: "set_prompt_targets";
|
|
11
|
+
session_id: string;
|
|
12
|
+
paths: string[];
|
|
13
|
+
}
|
|
14
|
+
/** Paths a search or shell command looked at, never the pattern or command. */
|
|
15
|
+
export interface ObservePresenceCommand {
|
|
16
|
+
op: "observe_presence";
|
|
17
|
+
session_id: string;
|
|
18
|
+
kind: PresenceKind;
|
|
19
|
+
paths: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface SetPresenceCommand {
|
|
22
|
+
op: "set_presence";
|
|
23
|
+
session_id: string;
|
|
24
|
+
shown: boolean;
|
|
25
|
+
window_ms: number;
|
|
26
|
+
}
|
|
27
|
+
export interface SessionEndCommand {
|
|
28
|
+
op: "session_end";
|
|
29
|
+
session_id: string;
|
|
30
|
+
trail?: TrailFacts;
|
|
31
|
+
}
|
|
32
|
+
/** The session finished a reply: complete what its tool calls still hold. */
|
|
33
|
+
export interface SessionStopCommand {
|
|
34
|
+
op: "session_stop";
|
|
35
|
+
session_id: string;
|
|
36
|
+
failure?: string;
|
|
37
|
+
prompt_id?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ObserveToolBatchCommand {
|
|
40
|
+
op: "observe_tool_batch";
|
|
41
|
+
session_id: string;
|
|
42
|
+
operation_ids: string[];
|
|
43
|
+
calls: number;
|
|
44
|
+
}
|
|
45
|
+
/** The session's briefing; `deliver` when it is placed in the session's context. */
|
|
46
|
+
export interface BriefCommand {
|
|
47
|
+
op: "brief";
|
|
48
|
+
session_id: string;
|
|
49
|
+
max_peers: number;
|
|
50
|
+
deliver: boolean;
|
|
51
|
+
mid_turn?: boolean;
|
|
52
|
+
recent?: boolean;
|
|
53
|
+
recent_window_ms?: number;
|
|
54
|
+
mcp?: boolean;
|
|
55
|
+
left?: string[];
|
|
56
|
+
changes_only?: boolean;
|
|
57
|
+
confirm?: boolean;
|
|
58
|
+
/** The client shows teammates' messages from other machines; capability `remote_messages`. */
|
|
59
|
+
remote_messages?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface AdoptCommand {
|
|
62
|
+
op: "adopt";
|
|
63
|
+
session_id: string;
|
|
64
|
+
from: string;
|
|
65
|
+
/** Adopt only when both sessions have the same task line, else `different_task`. */
|
|
66
|
+
same_task?: boolean;
|
|
67
|
+
}
|