@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,181 @@
|
|
|
1
|
+
import type { BlindSpots, CallBreak, CheckoutChange, CheckoutRun, GraphCoverage, ImpactLevel, InflightNotice, InterfaceImpact, MapArea, MapEdge, NameContext, NameRef, OutlineEntry, PeerCallers, PlanEdge, PlanLive, Rename, ScanFailure, SymbolPath, SymbolRef, WriteCheck } from "../records.ts";
|
|
2
|
+
export interface ScanObservedOutcome {
|
|
3
|
+
type: "scan_observed";
|
|
4
|
+
workspace_id: string;
|
|
5
|
+
failed: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** The hosts held as not installed after a host check. */
|
|
8
|
+
export interface HostsObservedOutcome {
|
|
9
|
+
type: "hosts_observed";
|
|
10
|
+
not_installed: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface CheckoutObservedOutcome {
|
|
13
|
+
type: "checkout_observed";
|
|
14
|
+
change: CheckoutChange;
|
|
15
|
+
}
|
|
16
|
+
export interface CheckoutRunObservedOutcome {
|
|
17
|
+
type: "checkout_run_observed";
|
|
18
|
+
run: CheckoutRun;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The Codex sessions named and the files kept; both empty when every change
|
|
22
|
+
* was explained or nothing new was recorded.
|
|
23
|
+
*/
|
|
24
|
+
export interface UncoordinatedObservedOutcome {
|
|
25
|
+
type: "uncoordinated_observed";
|
|
26
|
+
sessions: string[];
|
|
27
|
+
paths: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Every list is a name match bounded by the request's limit. `coverage` says
|
|
31
|
+
* how much of the workspace was indexed when it was answered.
|
|
32
|
+
*/
|
|
33
|
+
export interface GraphOutcome {
|
|
34
|
+
type: "graph";
|
|
35
|
+
symbols: SymbolRef[];
|
|
36
|
+
references: NameRef[];
|
|
37
|
+
resolution?: string;
|
|
38
|
+
coverage: GraphCoverage;
|
|
39
|
+
truncated: boolean;
|
|
40
|
+
levels?: ImpactLevel[];
|
|
41
|
+
renamed?: Rename[];
|
|
42
|
+
}
|
|
43
|
+
/** Only names with at least one definition, in the order asked. */
|
|
44
|
+
export interface GraphContextOutcome {
|
|
45
|
+
type: "graph_context";
|
|
46
|
+
matches: NameContext[];
|
|
47
|
+
coverage: GraphCoverage;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* What other worktrees have in flight that the workspace mentions, in
|
|
51
|
+
* worktree, path and name order. `coverage` is the asking workspace's; a
|
|
52
|
+
* worktree without a complete scan contributes nothing.
|
|
53
|
+
*/
|
|
54
|
+
export interface GraphInflightOutcome {
|
|
55
|
+
type: "graph_inflight";
|
|
56
|
+
inflight: InflightNotice[];
|
|
57
|
+
coverage: GraphCoverage;
|
|
58
|
+
truncated: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The shortest chains of calls between two names (roadmap D3), at most
|
|
62
|
+
* `MAX_PATHS`, in path and line order of their steps. Empty when none is
|
|
63
|
+
* within the hops asked for. `edges_visited` counts what the search read;
|
|
64
|
+
* `truncated` says a bound, the deadline or the chain limit cut it, so a
|
|
65
|
+
* missing or longer chain may still exist.
|
|
66
|
+
*/
|
|
67
|
+
export interface GraphPathOutcome {
|
|
68
|
+
type: "graph_path";
|
|
69
|
+
from: string;
|
|
70
|
+
to: string;
|
|
71
|
+
max_hops: number;
|
|
72
|
+
paths: SymbolPath[];
|
|
73
|
+
edges_visited: number;
|
|
74
|
+
coverage: GraphCoverage;
|
|
75
|
+
truncated: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The workspace's areas and the edges between them (roadmap D3), in area
|
|
79
|
+
* order and then by count. `truncated`: some areas or edges are not listed.
|
|
80
|
+
*/
|
|
81
|
+
export interface GraphMapOutcome {
|
|
82
|
+
type: "graph_map";
|
|
83
|
+
depth: number;
|
|
84
|
+
areas: MapArea[];
|
|
85
|
+
edges: MapEdge[];
|
|
86
|
+
coverage: GraphCoverage;
|
|
87
|
+
truncated: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Planned work split into groups that can run at once (roadmap B18).
|
|
91
|
+
* `by_files_only`: no complete index scan, so units are joined by shared
|
|
92
|
+
* files alone. `truncated`: a bound cut the mentions read.
|
|
93
|
+
*/
|
|
94
|
+
export interface PlanWorkOutcome {
|
|
95
|
+
type: "plan_work";
|
|
96
|
+
groups: string[][];
|
|
97
|
+
edges: PlanEdge[];
|
|
98
|
+
live: PlanLive[];
|
|
99
|
+
coverage: GraphCoverage;
|
|
100
|
+
by_files_only: boolean;
|
|
101
|
+
truncated: boolean;
|
|
102
|
+
}
|
|
103
|
+
/** The source index was written to a file (roadmap D5). */
|
|
104
|
+
export interface GraphExportedOutcome {
|
|
105
|
+
type: "graph_exported";
|
|
106
|
+
workspace_id: string;
|
|
107
|
+
files: number;
|
|
108
|
+
partial_files: number;
|
|
109
|
+
bytes: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* What an index import found, by file line (roadmap D5). Only `loaded` files
|
|
113
|
+
* were written, and only when `applied`.
|
|
114
|
+
*/
|
|
115
|
+
export interface GraphImportedOutcome {
|
|
116
|
+
type: "graph_imported";
|
|
117
|
+
workspace_id: string;
|
|
118
|
+
applied: boolean;
|
|
119
|
+
loaded: number;
|
|
120
|
+
different: number;
|
|
121
|
+
kept: number;
|
|
122
|
+
over_limits: number;
|
|
123
|
+
malformed: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* `ready` is false when the index has no complete scan of the workspace:
|
|
127
|
+
* nothing was checked.
|
|
128
|
+
*/
|
|
129
|
+
export interface CallBreaksOutcome {
|
|
130
|
+
type: "call_breaks";
|
|
131
|
+
breaks: CallBreak[];
|
|
132
|
+
coverage: GraphCoverage;
|
|
133
|
+
ready: boolean;
|
|
134
|
+
callers?: PeerCallers[];
|
|
135
|
+
}
|
|
136
|
+
/** The answer to `CheckWrite` (roadmap B26). Nothing was recorded. */
|
|
137
|
+
export interface WriteCheckOutcome {
|
|
138
|
+
type: "write_check";
|
|
139
|
+
check: WriteCheck;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Where the index cannot answer for the workspace's source (roadmap D8).
|
|
143
|
+
* Each list is in path order and holds at most the request's limit; `totals`
|
|
144
|
+
* has the full counts. Paths only, never content.
|
|
145
|
+
*/
|
|
146
|
+
export interface GraphBlindSpotsOutcome {
|
|
147
|
+
type: "graph_blind_spots";
|
|
148
|
+
blind_spots: BlindSpots;
|
|
149
|
+
coverage: GraphCoverage;
|
|
150
|
+
scan_failure?: ScanFailure;
|
|
151
|
+
truncated: boolean;
|
|
152
|
+
}
|
|
153
|
+
export interface InterfaceAcknowledgedOutcome {
|
|
154
|
+
type: "interface_acknowledged";
|
|
155
|
+
session_id: string;
|
|
156
|
+
notice_ids: string[];
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The answer to `OutlineRead` (roadmap A11). `outline` is present only when
|
|
160
|
+
* the read is to be refused once with it; `skipped` says why it is not.
|
|
161
|
+
* `definitions` is how many the index holds for the file: more than
|
|
162
|
+
* `outline` lists when the daemon kept only the largest.
|
|
163
|
+
*/
|
|
164
|
+
export interface ReadOutlineOutcome {
|
|
165
|
+
type: "read_outline";
|
|
166
|
+
outline?: OutlineEntry[];
|
|
167
|
+
definitions?: number;
|
|
168
|
+
skipped?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* What a session is told between its steps (issue #214). `open` is false
|
|
172
|
+
* once the turn the asking watcher started in is over, or the session ended;
|
|
173
|
+
* `stops` is the reference for its next ask.
|
|
174
|
+
*/
|
|
175
|
+
export interface BetweenStepsOutcome {
|
|
176
|
+
type: "between_steps";
|
|
177
|
+
session_id: string;
|
|
178
|
+
open: boolean;
|
|
179
|
+
stops: number;
|
|
180
|
+
interface_changes?: InterfaceImpact[];
|
|
181
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WorkspaceOutcome, WorkspacesOutcome, WorkspaceMovedOutcome, WorkspaceRemovalOutcome, SessionOutcome, SessionLivenessOutcome, SessionSeenOutcome, ContextRecordedOutcome, ToldForgottenOutcome, ToldConfirmedOutcome, SessionPromptedOutcome, PromptTargetsOutcome, PresenceObservedOutcome, PresenceOutcome, SessionEndedOutcome, AdoptedOutcome, SessionStoppedOutcome, ToolBatchObservedOutcome } from "./sessions.ts";
|
|
2
|
+
import type { IntentOutcome, IntentEndedOutcome, ReservedOutcome, AdmittedOutcome, ConflictOutcome, CompletedOutcome, ObservedOutcome, DiskObservedOutcome, BranchObservedOutcome, GitTroubleRecordedOutcome, BriefingOutcome, StaleBaseOutcome, UnreadLinesOutcome, SourceObservedOutcome, KeysReportedOutcome } from "./admission.ts";
|
|
3
|
+
import type { StatusOutcome, StatusRecordsOutcome, EventsOutcome, ChangesOutcome, WorkspaceGitOutcome, RemoteLinkOutcome, RemoteDisabledOutcome, RemoteOutboxOutcome, RemoteSentOutcome, CompactionOutcome, RemoteObservedOutcome, DashboardOutcome, VersionOutcome, ErrorOutcome } from "./log.ts";
|
|
4
|
+
import type { AutoCheckOutcome, AutoCheckDisabledOutcome, CheckRecordedOutcome, ChecksOutcome, FlakyTestsOutcome, FlakyTestForgottenOutcome, ExamplesOutcome, ExampleRetiredOutcome, ExampleShownOutcome, ReadinessOutcome, LandedOutcome, TurnOutcome, TurnBusyOutcome, TurnWaitingOutcome, TurnUnavailableOutcome, TurnQueueOutcome, TurnQueueLeftOutcome, TurnReleasedOutcome } from "./checks.ts";
|
|
5
|
+
import type { InterfaceObservedOutcome, InterfaceDependentsObservedOutcome, RememberedOutcome, NoteAnchorsObservedOutcome, DecidedOutcome, DecisionsOutcome, ForgottenOutcome, MessageSentOutcome, MessageAcknowledgedOutcome, MessageShownOutcome, MessageStatusOutcome, MessageRetractedOutcome, RecapOutcome, TrailsOutcome, RecallOutcome, HistoryOutcome, TodayOutcome, GitTroubleOutcome, CollisionsOutcome, ReportOutcome, CountOutcome, UsageOutcome, StatusLineOutcome, RefusalRecordedOutcome, PolicyOutcome, HoldersOutcome, WaitRecordedOutcome, UsageRecordedOutcome } from "./notes.ts";
|
|
6
|
+
import type { ScanObservedOutcome, HostsObservedOutcome, CheckoutObservedOutcome, CheckoutRunObservedOutcome, UncoordinatedObservedOutcome, GraphOutcome, GraphContextOutcome, GraphInflightOutcome, GraphPathOutcome, GraphMapOutcome, PlanWorkOutcome, GraphExportedOutcome, GraphImportedOutcome, CallBreaksOutcome, WriteCheckOutcome, GraphBlindSpotsOutcome, InterfaceAcknowledgedOutcome, ReadOutlineOutcome, BetweenStepsOutcome } from "./graph.ts";
|
|
7
|
+
export type * from "./sessions.ts";
|
|
8
|
+
export type * from "./admission.ts";
|
|
9
|
+
export type * from "./log.ts";
|
|
10
|
+
export type * from "./checks.ts";
|
|
11
|
+
export type * from "./notes.ts";
|
|
12
|
+
export type * from "./graph.ts";
|
|
13
|
+
/** Every outcome `type` of wire version 10, sorted. */
|
|
14
|
+
export declare const OUTCOME_TYPES: readonly ["admitted", "adopted", "auto_check", "auto_check_disabled", "between_steps", "branch_observed", "briefing", "call_breaks", "changes", "check_recorded", "checkout_observed", "checkout_run_observed", "checks", "collisions", "compaction", "completed", "conflict", "context_recorded", "count", "dashboard", "decided", "decisions", "disk_observed", "error", "events", "example_retired", "example_shown", "examples", "flaky_test_forgotten", "flaky_tests", "forgotten", "git_trouble", "git_trouble_recorded", "graph", "graph_blind_spots", "graph_context", "graph_exported", "graph_imported", "graph_inflight", "graph_map", "graph_path", "history", "holders", "hosts_observed", "intent", "intent_ended", "interface_acknowledged", "interface_dependents_observed", "interface_observed", "keys_reported", "landed", "message_acknowledged", "message_retracted", "message_sent", "message_shown", "message_status", "note_anchors_observed", "observed", "plan_work", "policy", "presence", "presence_observed", "prompt_targets", "read_outline", "readiness", "recall", "recap", "refusal_recorded", "remembered", "remote_disabled", "remote_link", "remote_observed", "remote_outbox", "remote_sent", "report", "reserved", "scan_observed", "session", "session_ended", "session_liveness", "session_prompted", "session_seen", "session_stopped", "source_observed", "stale_base", "status", "status_line", "status_records", "today", "told_confirmed", "told_forgotten", "tool_batch_observed", "trails", "turn", "turn_busy", "turn_queue", "turn_queue_left", "turn_released", "turn_unavailable", "turn_waiting", "uncoordinated_observed", "unread_lines", "usage", "usage_recorded", "version", "wait_recorded", "workspace", "workspace_git", "workspace_moved", "workspace_removal", "workspaces", "write_check"];
|
|
15
|
+
export type OutcomeType = (typeof OUTCOME_TYPES)[number];
|
|
16
|
+
/** An answer's outcome, told apart by `type`. */
|
|
17
|
+
export type Outcome = WorkspaceOutcome | WorkspacesOutcome | WorkspaceMovedOutcome | WorkspaceRemovalOutcome | SessionOutcome | SessionLivenessOutcome | SessionSeenOutcome | ContextRecordedOutcome | ToldForgottenOutcome | ToldConfirmedOutcome | SessionPromptedOutcome | PromptTargetsOutcome | PresenceObservedOutcome | PresenceOutcome | SessionEndedOutcome | AdoptedOutcome | SessionStoppedOutcome | ToolBatchObservedOutcome | IntentOutcome | IntentEndedOutcome | ReservedOutcome | AdmittedOutcome | ConflictOutcome | CompletedOutcome | ObservedOutcome | DiskObservedOutcome | BranchObservedOutcome | GitTroubleRecordedOutcome | BriefingOutcome | StaleBaseOutcome | UnreadLinesOutcome | SourceObservedOutcome | KeysReportedOutcome | StatusOutcome | StatusRecordsOutcome | EventsOutcome | ChangesOutcome | WorkspaceGitOutcome | RemoteLinkOutcome | RemoteDisabledOutcome | RemoteOutboxOutcome | RemoteSentOutcome | CompactionOutcome | RemoteObservedOutcome | DashboardOutcome | VersionOutcome | ErrorOutcome | AutoCheckOutcome | AutoCheckDisabledOutcome | CheckRecordedOutcome | ChecksOutcome | FlakyTestsOutcome | FlakyTestForgottenOutcome | ExamplesOutcome | ExampleRetiredOutcome | ExampleShownOutcome | ReadinessOutcome | LandedOutcome | TurnOutcome | TurnBusyOutcome | TurnWaitingOutcome | TurnUnavailableOutcome | TurnQueueOutcome | TurnQueueLeftOutcome | TurnReleasedOutcome | InterfaceObservedOutcome | InterfaceDependentsObservedOutcome | RememberedOutcome | NoteAnchorsObservedOutcome | DecidedOutcome | DecisionsOutcome | ForgottenOutcome | MessageSentOutcome | MessageAcknowledgedOutcome | MessageShownOutcome | MessageStatusOutcome | MessageRetractedOutcome | RecapOutcome | TrailsOutcome | RecallOutcome | HistoryOutcome | TodayOutcome | GitTroubleOutcome | CollisionsOutcome | ReportOutcome | CountOutcome | UsageOutcome | StatusLineOutcome | RefusalRecordedOutcome | PolicyOutcome | HoldersOutcome | WaitRecordedOutcome | UsageRecordedOutcome | ScanObservedOutcome | HostsObservedOutcome | CheckoutObservedOutcome | CheckoutRunObservedOutcome | UncoordinatedObservedOutcome | GraphOutcome | GraphContextOutcome | GraphInflightOutcome | GraphPathOutcome | GraphMapOutcome | PlanWorkOutcome | GraphExportedOutcome | GraphImportedOutcome | CallBreaksOutcome | WriteCheckOutcome | GraphBlindSpotsOutcome | InterfaceAcknowledgedOutcome | ReadOutlineOutcome | BetweenStepsOutcome;
|
|
18
|
+
/** Whether this client knows the outcome's `type`, and so its fields. */
|
|
19
|
+
export declare function isKnownOutcome(outcome: {
|
|
20
|
+
type: string;
|
|
21
|
+
}): outcome is Outcome;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// Every outcome a coordinator answers with, as `Outcome` in
|
|
2
|
+
// `crates/langspan-core/src/outcome.rs` encodes it. test/rust-source.test.ts
|
|
3
|
+
// checks each one, field by field, against that enum. A newer coordinator
|
|
4
|
+
// can answer with a `type` this list lacks; `isKnownOutcome` tells.
|
|
5
|
+
/** Every outcome `type` of wire version 10, sorted. */
|
|
6
|
+
export const OUTCOME_TYPES = [
|
|
7
|
+
"admitted",
|
|
8
|
+
"adopted",
|
|
9
|
+
"auto_check",
|
|
10
|
+
"auto_check_disabled",
|
|
11
|
+
"between_steps",
|
|
12
|
+
"branch_observed",
|
|
13
|
+
"briefing",
|
|
14
|
+
"call_breaks",
|
|
15
|
+
"changes",
|
|
16
|
+
"check_recorded",
|
|
17
|
+
"checkout_observed",
|
|
18
|
+
"checkout_run_observed",
|
|
19
|
+
"checks",
|
|
20
|
+
"collisions",
|
|
21
|
+
"compaction",
|
|
22
|
+
"completed",
|
|
23
|
+
"conflict",
|
|
24
|
+
"context_recorded",
|
|
25
|
+
"count",
|
|
26
|
+
"dashboard",
|
|
27
|
+
"decided",
|
|
28
|
+
"decisions",
|
|
29
|
+
"disk_observed",
|
|
30
|
+
"error",
|
|
31
|
+
"events",
|
|
32
|
+
"example_retired",
|
|
33
|
+
"example_shown",
|
|
34
|
+
"examples",
|
|
35
|
+
"flaky_test_forgotten",
|
|
36
|
+
"flaky_tests",
|
|
37
|
+
"forgotten",
|
|
38
|
+
"git_trouble",
|
|
39
|
+
"git_trouble_recorded",
|
|
40
|
+
"graph",
|
|
41
|
+
"graph_blind_spots",
|
|
42
|
+
"graph_context",
|
|
43
|
+
"graph_exported",
|
|
44
|
+
"graph_imported",
|
|
45
|
+
"graph_inflight",
|
|
46
|
+
"graph_map",
|
|
47
|
+
"graph_path",
|
|
48
|
+
"history",
|
|
49
|
+
"holders",
|
|
50
|
+
"hosts_observed",
|
|
51
|
+
"intent",
|
|
52
|
+
"intent_ended",
|
|
53
|
+
"interface_acknowledged",
|
|
54
|
+
"interface_dependents_observed",
|
|
55
|
+
"interface_observed",
|
|
56
|
+
"keys_reported",
|
|
57
|
+
"landed",
|
|
58
|
+
"message_acknowledged",
|
|
59
|
+
"message_retracted",
|
|
60
|
+
"message_sent",
|
|
61
|
+
"message_shown",
|
|
62
|
+
"message_status",
|
|
63
|
+
"note_anchors_observed",
|
|
64
|
+
"observed",
|
|
65
|
+
"plan_work",
|
|
66
|
+
"policy",
|
|
67
|
+
"presence",
|
|
68
|
+
"presence_observed",
|
|
69
|
+
"prompt_targets",
|
|
70
|
+
"read_outline",
|
|
71
|
+
"readiness",
|
|
72
|
+
"recall",
|
|
73
|
+
"recap",
|
|
74
|
+
"refusal_recorded",
|
|
75
|
+
"remembered",
|
|
76
|
+
"remote_disabled",
|
|
77
|
+
"remote_link",
|
|
78
|
+
"remote_observed",
|
|
79
|
+
"remote_outbox",
|
|
80
|
+
"remote_sent",
|
|
81
|
+
"report",
|
|
82
|
+
"reserved",
|
|
83
|
+
"scan_observed",
|
|
84
|
+
"session",
|
|
85
|
+
"session_ended",
|
|
86
|
+
"session_liveness",
|
|
87
|
+
"session_prompted",
|
|
88
|
+
"session_seen",
|
|
89
|
+
"session_stopped",
|
|
90
|
+
"source_observed",
|
|
91
|
+
"stale_base",
|
|
92
|
+
"status",
|
|
93
|
+
"status_line",
|
|
94
|
+
"status_records",
|
|
95
|
+
"today",
|
|
96
|
+
"told_confirmed",
|
|
97
|
+
"told_forgotten",
|
|
98
|
+
"tool_batch_observed",
|
|
99
|
+
"trails",
|
|
100
|
+
"turn",
|
|
101
|
+
"turn_busy",
|
|
102
|
+
"turn_queue",
|
|
103
|
+
"turn_queue_left",
|
|
104
|
+
"turn_released",
|
|
105
|
+
"turn_unavailable",
|
|
106
|
+
"turn_waiting",
|
|
107
|
+
"uncoordinated_observed",
|
|
108
|
+
"unread_lines",
|
|
109
|
+
"usage",
|
|
110
|
+
"usage_recorded",
|
|
111
|
+
"version",
|
|
112
|
+
"wait_recorded",
|
|
113
|
+
"workspace",
|
|
114
|
+
"workspace_git",
|
|
115
|
+
"workspace_moved",
|
|
116
|
+
"workspace_removal",
|
|
117
|
+
"workspaces",
|
|
118
|
+
"write_check",
|
|
119
|
+
];
|
|
120
|
+
const typesMatchOutcomes = true;
|
|
121
|
+
void typesMatchOutcomes;
|
|
122
|
+
const known = new Set(OUTCOME_TYPES);
|
|
123
|
+
/** Whether this client knows the outcome's `type`, and so its fields. */
|
|
124
|
+
export function isKnownOutcome(outcome) {
|
|
125
|
+
return known.has(outcome.type);
|
|
126
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { CompactionReport, Dashboard, RecordedEvent, RemoteLink, ScanSummary, SentPublication, State, StatusRecord, StatusSummary, WorkspaceGit } from "../records.ts";
|
|
2
|
+
import type { Publication } from "../values.ts";
|
|
3
|
+
/**
|
|
4
|
+
* `state` is the bounded view of what matters now; `summary` says what it
|
|
5
|
+
* counts instead of listing and what it left out to fit one frame. An answer
|
|
6
|
+
* from a build before the summary has none.
|
|
7
|
+
*/
|
|
8
|
+
export interface StatusOutcome {
|
|
9
|
+
type: "status";
|
|
10
|
+
state: State;
|
|
11
|
+
summary?: StatusSummary;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One page of state records in a fixed order. `next` resumes after the last
|
|
15
|
+
* of them; it is absent on the last page.
|
|
16
|
+
*/
|
|
17
|
+
export interface StatusRecordsOutcome {
|
|
18
|
+
type: "status_records";
|
|
19
|
+
records: StatusRecord[];
|
|
20
|
+
next: string | null;
|
|
21
|
+
}
|
|
22
|
+
export interface EventsOutcome {
|
|
23
|
+
type: "events";
|
|
24
|
+
events: RecordedEvent[];
|
|
25
|
+
}
|
|
26
|
+
export interface ChangesOutcome {
|
|
27
|
+
type: "changes";
|
|
28
|
+
events: RecordedEvent[];
|
|
29
|
+
scan: ScanSummary | null;
|
|
30
|
+
}
|
|
31
|
+
export interface WorkspaceGitOutcome {
|
|
32
|
+
type: "workspace_git";
|
|
33
|
+
git: WorkspaceGit;
|
|
34
|
+
}
|
|
35
|
+
export interface RemoteLinkOutcome {
|
|
36
|
+
type: "remote_link";
|
|
37
|
+
link: RemoteLink;
|
|
38
|
+
}
|
|
39
|
+
export interface RemoteDisabledOutcome {
|
|
40
|
+
type: "remote_disabled";
|
|
41
|
+
workspace_id: string;
|
|
42
|
+
}
|
|
43
|
+
export interface RemoteOutboxOutcome {
|
|
44
|
+
type: "remote_outbox";
|
|
45
|
+
publication: Publication;
|
|
46
|
+
signature: string;
|
|
47
|
+
changed: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Newest first. `more` is true when older records were left out to keep the
|
|
51
|
+
* answer within one frame.
|
|
52
|
+
*/
|
|
53
|
+
export interface RemoteSentOutcome {
|
|
54
|
+
type: "remote_sent";
|
|
55
|
+
sent: SentPublication[];
|
|
56
|
+
more: boolean;
|
|
57
|
+
since_ms?: number;
|
|
58
|
+
}
|
|
59
|
+
/** What a compaction removed, or with `applied` false would remove. */
|
|
60
|
+
export interface CompactionOutcome {
|
|
61
|
+
type: "compaction";
|
|
62
|
+
report: CompactionReport;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* `accepted` is false for a publication that is not newer than the one
|
|
66
|
+
* already held: a replay, or one that arrived out of order.
|
|
67
|
+
*/
|
|
68
|
+
export interface RemoteObservedOutcome {
|
|
69
|
+
type: "remote_observed";
|
|
70
|
+
participant: string;
|
|
71
|
+
accepted: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface DashboardOutcome {
|
|
74
|
+
type: "dashboard";
|
|
75
|
+
dashboard: Dashboard;
|
|
76
|
+
}
|
|
77
|
+
/** The answer to `Command::Version`. */
|
|
78
|
+
export interface VersionOutcome {
|
|
79
|
+
type: "version";
|
|
80
|
+
version: string;
|
|
81
|
+
pid: number;
|
|
82
|
+
}
|
|
83
|
+
export interface ErrorOutcome {
|
|
84
|
+
type: "error";
|
|
85
|
+
code: string;
|
|
86
|
+
message: string;
|
|
87
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { Conflict, History, InterfaceNotice, CollisionList, LiveTrouble, Message, MessageStatus, Note, PolicyRow, PushReason, Recall, Recap, RecordedDecision, RefusalCount, Report, ShownMessage, StatusLine, Today, TrailView, UsageTotals } from "../records.ts";
|
|
2
|
+
export interface InterfaceObservedOutcome {
|
|
3
|
+
type: "interface_observed";
|
|
4
|
+
notice: InterfaceNotice;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* How many files of another worktree were added to the notice's `elsewhere`;
|
|
8
|
+
* zero when every one was already listed or it is full.
|
|
9
|
+
*/
|
|
10
|
+
export interface InterfaceDependentsObservedOutcome {
|
|
11
|
+
type: "interface_dependents_observed";
|
|
12
|
+
notice_id: string;
|
|
13
|
+
added: number;
|
|
14
|
+
}
|
|
15
|
+
export interface RememberedOutcome {
|
|
16
|
+
type: "remembered";
|
|
17
|
+
note: Note;
|
|
18
|
+
}
|
|
19
|
+
/** How many anchored notes an index pass moved to a new state. */
|
|
20
|
+
export interface NoteAnchorsObservedOutcome {
|
|
21
|
+
type: "note_anchors_observed";
|
|
22
|
+
changed: number;
|
|
23
|
+
}
|
|
24
|
+
export interface DecidedOutcome {
|
|
25
|
+
type: "decided";
|
|
26
|
+
decision: RecordedDecision;
|
|
27
|
+
}
|
|
28
|
+
export interface DecisionsOutcome {
|
|
29
|
+
type: "decisions";
|
|
30
|
+
decisions: RecordedDecision[];
|
|
31
|
+
}
|
|
32
|
+
export interface ForgottenOutcome {
|
|
33
|
+
type: "forgotten";
|
|
34
|
+
note_id: string;
|
|
35
|
+
removed: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface MessageSentOutcome {
|
|
38
|
+
type: "message_sent";
|
|
39
|
+
message: Message;
|
|
40
|
+
/** For a message to files or a name: the sessions that would receive it now. */
|
|
41
|
+
now_concerned?: string[];
|
|
42
|
+
/** For a message sent with `now`: whether it was pushed, and if not why; capability `push_messages`. */
|
|
43
|
+
pushed?: boolean;
|
|
44
|
+
reason?: PushReason;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* `acknowledged` is false when the message was not owed to the session:
|
|
48
|
+
* already acknowledged, dropped, or never addressed to it.
|
|
49
|
+
*/
|
|
50
|
+
export interface MessageAcknowledgedOutcome {
|
|
51
|
+
type: "message_acknowledged";
|
|
52
|
+
message_id: string;
|
|
53
|
+
acknowledged: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface MessageShownOutcome {
|
|
56
|
+
type: "message_shown";
|
|
57
|
+
message: ShownMessage;
|
|
58
|
+
}
|
|
59
|
+
export interface MessageStatusOutcome {
|
|
60
|
+
type: "message_status";
|
|
61
|
+
status: MessageStatus;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Sessions that were still owed it and now are not, and sessions that had
|
|
65
|
+
* received it and will be told to disregard it.
|
|
66
|
+
*/
|
|
67
|
+
export interface MessageRetractedOutcome {
|
|
68
|
+
type: "message_retracted";
|
|
69
|
+
message_id: string;
|
|
70
|
+
withdrawn_unread: string[];
|
|
71
|
+
told_to_disregard: string[];
|
|
72
|
+
}
|
|
73
|
+
export interface RecapOutcome {
|
|
74
|
+
type: "recap";
|
|
75
|
+
recap: Recap;
|
|
76
|
+
}
|
|
77
|
+
export interface TrailsOutcome {
|
|
78
|
+
type: "trails";
|
|
79
|
+
workspace_id: string;
|
|
80
|
+
trails: TrailView[];
|
|
81
|
+
omitted?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface RecallOutcome {
|
|
84
|
+
type: "recall";
|
|
85
|
+
recall: Recall;
|
|
86
|
+
}
|
|
87
|
+
export interface HistoryOutcome {
|
|
88
|
+
type: "history";
|
|
89
|
+
history: History;
|
|
90
|
+
}
|
|
91
|
+
export interface TodayOutcome {
|
|
92
|
+
type: "today";
|
|
93
|
+
today: Today;
|
|
94
|
+
}
|
|
95
|
+
export interface CollisionsOutcome {
|
|
96
|
+
type: "collisions";
|
|
97
|
+
workspace_id: string;
|
|
98
|
+
list: CollisionList;
|
|
99
|
+
}
|
|
100
|
+
export interface GitTroubleOutcome {
|
|
101
|
+
type: "git_trouble";
|
|
102
|
+
live: LiveTrouble;
|
|
103
|
+
}
|
|
104
|
+
export interface ReportOutcome {
|
|
105
|
+
type: "report";
|
|
106
|
+
report: Report;
|
|
107
|
+
}
|
|
108
|
+
export interface CountOutcome {
|
|
109
|
+
type: "count";
|
|
110
|
+
count: RefusalCount;
|
|
111
|
+
}
|
|
112
|
+
export interface UsageOutcome {
|
|
113
|
+
type: "usage";
|
|
114
|
+
usage: UsageTotals;
|
|
115
|
+
}
|
|
116
|
+
export interface StatusLineOutcome {
|
|
117
|
+
type: "status_line";
|
|
118
|
+
line: StatusLine;
|
|
119
|
+
}
|
|
120
|
+
export interface RefusalRecordedOutcome {
|
|
121
|
+
type: "refusal_recorded";
|
|
122
|
+
session_id: string;
|
|
123
|
+
}
|
|
124
|
+
export interface PolicyOutcome {
|
|
125
|
+
type: "policy";
|
|
126
|
+
workspace_id: string;
|
|
127
|
+
rows: PolicyRow[];
|
|
128
|
+
}
|
|
129
|
+
export interface HoldersOutcome {
|
|
130
|
+
type: "holders";
|
|
131
|
+
holders: Conflict[];
|
|
132
|
+
}
|
|
133
|
+
export interface WaitRecordedOutcome {
|
|
134
|
+
type: "wait_recorded";
|
|
135
|
+
session_id: string;
|
|
136
|
+
}
|
|
137
|
+
export interface UsageRecordedOutcome {
|
|
138
|
+
type: "usage_recorded";
|
|
139
|
+
session_id: string;
|
|
140
|
+
}
|