wicked-crew 0.7.28 → 0.7.30
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/README.md +12 -1
- package/dist/api/chat-scope.d.ts +210 -0
- package/dist/api/chat-scope.d.ts.map +1 -0
- package/dist/api/chat-scope.js +728 -0
- package/dist/api/chat-scope.js.map +1 -0
- package/dist/api/diagnostics.d.ts +30 -2
- package/dist/api/diagnostics.d.ts.map +1 -1
- package/dist/api/diagnostics.js +73 -5
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/api/governance-health.d.ts +171 -0
- package/dist/api/governance-health.d.ts.map +1 -0
- package/dist/api/governance-health.js +379 -0
- package/dist/api/governance-health.js.map +1 -0
- package/dist/api/open-path.d.ts.map +1 -1
- package/dist/api/open-path.js +2 -1
- package/dist/api/open-path.js.map +1 -1
- package/dist/api/post-hoc-deliver.d.ts +9 -5
- package/dist/api/post-hoc-deliver.d.ts.map +1 -1
- package/dist/api/post-hoc-deliver.js +21 -7
- package/dist/api/post-hoc-deliver.js.map +1 -1
- package/dist/api/routes.d.ts +70 -12
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +375 -60
- package/dist/api/routes.js.map +1 -1
- package/dist/api/seat-health.d.ts +38 -0
- package/dist/api/seat-health.d.ts.map +1 -1
- package/dist/api/seat-health.js +88 -5
- package/dist/api/seat-health.js.map +1 -1
- package/dist/api/seat-signin.d.ts.map +1 -1
- package/dist/api/seat-signin.js +49 -23
- package/dist/api/seat-signin.js.map +1 -1
- package/dist/api/seat-standing.d.ts +101 -0
- package/dist/api/seat-standing.d.ts.map +1 -0
- package/dist/api/seat-standing.js +138 -0
- package/dist/api/seat-standing.js.map +1 -0
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +37 -0
- package/dist/api/server.js.map +1 -1
- package/dist/campaigns/routes.d.ts +4 -4
- package/dist/cli/governance.d.ts +131 -0
- package/dist/cli/governance.d.ts.map +1 -0
- package/dist/cli/governance.js +354 -0
- package/dist/cli/governance.js.map +1 -0
- package/dist/cli/index.js +102 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/core/adapter.d.ts +99 -1
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +149 -8
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/bridge-path.d.ts +21 -0
- package/dist/core/bridge-path.d.ts.map +1 -1
- package/dist/core/bridge-path.js +37 -0
- package/dist/core/bridge-path.js.map +1 -1
- package/dist/core/bridge-reaper.d.ts.map +1 -1
- package/dist/core/bridge-reaper.js +11 -4
- package/dist/core/bridge-reaper.js.map +1 -1
- package/dist/core/deliver-text.d.ts +184 -0
- package/dist/core/deliver-text.d.ts.map +1 -0
- package/dist/core/deliver-text.js +434 -0
- package/dist/core/deliver-text.js.map +1 -0
- package/dist/core/deliver-triage.d.ts +90 -0
- package/dist/core/deliver-triage.d.ts.map +1 -0
- package/dist/core/deliver-triage.js +106 -0
- package/dist/core/deliver-triage.js.map +1 -0
- package/dist/core/deliver.d.ts +103 -9
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +244 -46
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/estate-mcp-client.d.ts.map +1 -1
- package/dist/core/estate-mcp-client.js +7 -2
- package/dist/core/estate-mcp-client.js.map +1 -1
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +11 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/governance-store.d.ts +219 -0
- package/dist/core/governance-store.d.ts.map +1 -0
- package/dist/core/governance-store.js +290 -0
- package/dist/core/governance-store.js.map +1 -0
- package/dist/core/repoPaths.d.ts +36 -5
- package/dist/core/repoPaths.d.ts.map +1 -1
- package/dist/core/repoPaths.js +46 -4
- package/dist/core/repoPaths.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +29 -24
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +74 -7
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +5 -2
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/council-outcome.d.ts +28 -0
- package/dist/interactive/council-outcome.d.ts.map +1 -0
- package/dist/interactive/council-outcome.js +57 -0
- package/dist/interactive/council-outcome.js.map +1 -0
- package/dist/interactive/demo-events.d.ts.map +1 -1
- package/dist/interactive/demo-events.js +5 -2
- package/dist/interactive/demo-events.js.map +1 -1
- package/dist/interactive/doc-delete-routes.d.ts.map +1 -1
- package/dist/interactive/doc-delete-routes.js +3 -2
- package/dist/interactive/doc-delete-routes.js.map +1 -1
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +5 -2
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/edit-events.d.ts.map +1 -1
- package/dist/interactive/edit-events.js +5 -2
- package/dist/interactive/edit-events.js.map +1 -1
- package/dist/projects/auto-refresh.d.ts +54 -0
- package/dist/projects/auto-refresh.d.ts.map +1 -0
- package/dist/projects/auto-refresh.js +76 -0
- package/dist/projects/auto-refresh.js.map +1 -0
- package/dist/projects/graph-paths.d.ts +4 -2
- package/dist/projects/graph-paths.d.ts.map +1 -1
- package/dist/projects/graph-paths.js +4 -2
- package/dist/projects/graph-paths.js.map +1 -1
- package/dist/projects/graph.d.ts +20 -6
- package/dist/projects/graph.d.ts.map +1 -1
- package/dist/projects/graph.js +40 -13
- package/dist/projects/graph.js.map +1 -1
- package/dist/projects/routes.d.ts.map +1 -1
- package/dist/projects/routes.js +30 -11
- package/dist/projects/routes.js.map +1 -1
- package/dist/projects/state-home.d.ts +6 -0
- package/dist/projects/state-home.d.ts.map +1 -1
- package/dist/projects/state-home.js +9 -1
- package/dist/projects/state-home.js.map +1 -1
- package/dist/skills/guards.d.ts +17 -6
- package/dist/skills/guards.d.ts.map +1 -1
- package/dist/skills/guards.js +42 -15
- package/dist/skills/guards.js.map +1 -1
- package/dist/skills/plugin-source.d.ts.map +1 -1
- package/dist/skills/plugin-source.js +3 -0
- package/dist/skills/plugin-source.js.map +1 -1
- package/dist/skills/refs.d.ts +181 -17
- package/dist/skills/refs.d.ts.map +1 -1
- package/dist/skills/refs.js +345 -26
- package/dist/skills/refs.js.map +1 -1
- package/dist/skills/store.d.ts +22 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/skills/store.js +161 -23
- package/dist/skills/store.js.map +1 -1
- package/dist/studio/assets/index-CWUS9Ump.js +542 -0
- package/dist/studio/assets/{index-CK1uJWs2.css → index-_ydd-jKd.css} +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +567 -6
- package/endpoint-manifest.json +67 -14
- package/package.json +4 -4
- package/dist/studio/assets/index-CdmCMh2f.js +0 -539
package/README.md
CHANGED
|
@@ -30,7 +30,18 @@ installs/updates the whole wicked-\* family, crew included.
|
|
|
30
30
|
serves the bundled **wicked-studio** browser console same-origin — open the URL and you have the
|
|
31
31
|
control room: launch and steer runs, answer human gates, browse projects and evidence, watch live
|
|
32
32
|
engine events. Durable state (runs, evidence, event log) lives in `~/.wicked-crew/` (`--db`
|
|
33
|
-
overrides).
|
|
33
|
+
overrides). Governance evidence — conformance claims, phase transitions, rule lifecycle — lands in
|
|
34
|
+
`<core db>.governance/governance.db` (`--governance-db` / `WICKED_CREW_GOVERNANCE_DB` override; an
|
|
35
|
+
inherited `WICKED_ESTATE_DB` is honoured — the emit seam is SQLite-only, so a URL-form value such as
|
|
36
|
+
`postgres://…` in your shell refuses boot until `--governance-db` names a SQLite file); events the
|
|
37
|
+
engine cannot store dead-letter to
|
|
38
|
+
`<core db>.governance/emit-outbox.ndjson` by default (under the state home, not HOME; an explicit
|
|
39
|
+
`WICKED_APPS_EMIT_DEADLETTER` is honoured), are counted on
|
|
40
|
+
`GET /api/v1/diagnostics` → `governance` (a `governance.deadletter` finding), and are drained back
|
|
41
|
+
with `wicked-crew governance replay <outbox>`. The interactive document bridge is spawned on demand
|
|
42
|
+
as `npx wicked-interactive@^0.9.1`; `WICKED_INTERACTIVE_SPEC` overrides the range (semver range
|
|
43
|
+
only, validated; invalid values are named on the boot line and ignored, a floor below crew's need
|
|
44
|
+
is warned about).
|
|
34
45
|
|
|
35
46
|
## Quickstart
|
|
36
47
|
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat scope (crew#502, acceptance finding F-067): WHAT a chat's seats can see, decided up front
|
|
3
|
+
* and stated — to the seats and to the caller.
|
|
4
|
+
*
|
|
5
|
+
* `POST /chats` used to set the seats' cwd only when `repoRef` was sent, and the engine fell back
|
|
6
|
+
* to `current_dir()` — the DAEMON's working directory. Studio's GroupChat never sent `repoRef`, so
|
|
7
|
+
* every chat explored wherever `wicked-crew serve` had been started from (a customer's `$HOME`),
|
|
8
|
+
* with no estate MCP, no repo list and no statement of the scope; "chat with all 9 repos" worked
|
|
9
|
+
* only because the acceptance rig started the daemon from the parent of `repos/`, and the seats
|
|
10
|
+
* browsed the rig's other clones and the INSTALLED package's `.d.ts` files as if they were sources.
|
|
11
|
+
*
|
|
12
|
+
* The scope is a first-class input now: a PROJECT (default: every registered `crew.repo` member)
|
|
13
|
+
* or an explicit repo list. From it this module derives the three things the engine is handed
|
|
14
|
+
* (`wicked-core-ts chatOpen(chatId, clis, cwd, scopeJson)`):
|
|
15
|
+
*
|
|
16
|
+
* - `cwd` — a PRIVATE SCRATCH ROOT of the chat's own, under THIS daemon's per-process
|
|
17
|
+
* namespace (`<os tmp>/wicked-crew-chats/<pid>-<random>/<chatId>`, see
|
|
18
|
+
* {@link chatScratchBase}), never a repo and never the daemon's cwd. Relative
|
|
19
|
+
* writes land there and the
|
|
20
|
+
* OS sandbox, where the seat's config arms it, contains writes to it — the
|
|
21
|
+
* repos are READ. Deliberately NOT under the state home: the engine's worker
|
|
22
|
+
* fence denies `Read/Edit/Write(<state home>/**)` to every seat (wicked-core
|
|
23
|
+
* `execute_wrapped::deny_rules`), so a seat whose cwd sat there could not read
|
|
24
|
+
* its own working directory — and a new state-home store needs core's registry
|
|
25
|
+
* (`tests/fixtures/state-home-subtrees.json`) released first.
|
|
26
|
+
* - `readRoots` — the scoped repos' REGISTERED root paths (the run worktree read-roots idea,
|
|
27
|
+
* applied to live repos): advertised to a claude seat as the SDK's
|
|
28
|
+
* `additionalDirectories`, recorded on every seat (`GET /chats`).
|
|
29
|
+
* - `codeGraphDb` — the graph the seats' READ-ONLY estate MCP is bound to: the project's
|
|
30
|
+
* co-located graph (`resolveProjectGraphBinding`, DES-GROUNDING-001 — the SAME
|
|
31
|
+
* seam governed runs get) when the chat is filed into a project; a single
|
|
32
|
+
* repo's own graph otherwise; none for several repos with no project.
|
|
33
|
+
*
|
|
34
|
+
* and STATES it: an `AGENTS.md` + `CLAUDE.md` in the scratch root (every seat CLI reads its cwd's
|
|
35
|
+
* instructions file — claude `CLAUDE.md`; codex, pi, opencode and copilot `AGENTS.md`) names the
|
|
36
|
+
* repos, their paths, the read-only rule and the grounding, so a seat that starts in an empty
|
|
37
|
+
* directory knows exactly what it was pointed at; the same {@link ChatScope} rides the
|
|
38
|
+
* `POST /chats` response and `GET /chats/:id` for the UI (studio's New Chat).
|
|
39
|
+
*/
|
|
40
|
+
import type { CoreAdapter } from '../core/adapter.js';
|
|
41
|
+
import type { ChatScope, RepoEntry } from '../core/types.js';
|
|
42
|
+
import { type ProjectGraphBindingDecision } from '../projects/graph.js';
|
|
43
|
+
/** The scope a `POST /chats` asked for, after body validation. `repoRefs` is `repoRef` merged in. */
|
|
44
|
+
export interface ChatScopeRequest {
|
|
45
|
+
chatId: string;
|
|
46
|
+
projectId?: string;
|
|
47
|
+
/** Registry ids or names; empty when the caller named none. */
|
|
48
|
+
repoRefs: string[];
|
|
49
|
+
}
|
|
50
|
+
/** What the engine is handed for the chat — the wire shape of `chatOpen`'s `scopeJson` plus `cwd`. */
|
|
51
|
+
export interface EngineChatScope {
|
|
52
|
+
cwd: string;
|
|
53
|
+
codeGraphDb: string | null;
|
|
54
|
+
readRoots: string[];
|
|
55
|
+
}
|
|
56
|
+
export type ChatScopeResolution = {
|
|
57
|
+
ok: true;
|
|
58
|
+
scope: ChatScope;
|
|
59
|
+
engine: EngineChatScope;
|
|
60
|
+
} | {
|
|
61
|
+
ok: false;
|
|
62
|
+
status: 400 | 404 | 409;
|
|
63
|
+
error: string;
|
|
64
|
+
missing?: string[];
|
|
65
|
+
};
|
|
66
|
+
/** The reads the resolver needs — injectable so the resolver is testable without an engine. */
|
|
67
|
+
export interface ChatScopeDeps {
|
|
68
|
+
listRepos(): Promise<RepoEntry[]>;
|
|
69
|
+
/** The `crew.repo` member refs of a project, in attach order. */
|
|
70
|
+
projectRepoRefs(projectId: string): Promise<string[]>;
|
|
71
|
+
/** The project-graph decision for a chat — repo-bound when exactly one repo is in scope. */
|
|
72
|
+
bindProjectGraph(projectId: string, repoRef: string | undefined): Promise<ProjectGraphBindingDecision>;
|
|
73
|
+
/** Where chat scratch roots live. Default {@link chatScratchBase}. */
|
|
74
|
+
scratchBase?: string;
|
|
75
|
+
/** Where a registered root the daemon cannot resolve — and that is NOT in this chat's scope nor
|
|
76
|
+
* lexically near the base — is noted instead of refusing the open (hardening, W7). */
|
|
77
|
+
log?: (msg: string) => void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* `<os tmp>/wicked-crew-chats/<pid>-<random>` — THIS daemon's own namespace, minted once per
|
|
81
|
+
* process (Copilot, #518): a shared `<os tmp>/wicked-crew-chats/<chatId>` could already exist from
|
|
82
|
+
* another daemon running as the same OS user, which would pass every ownership check, overwrite the
|
|
83
|
+
* live chat's statement and remove its root. Chats do not survive a daemon restart (the engine's pool
|
|
84
|
+
* is in memory), so a stale namespace left by a crashed daemon holds nothing live. See the module
|
|
85
|
+
* doc for why the base is not the state home.
|
|
86
|
+
*/
|
|
87
|
+
export declare function chatScratchBase(): string;
|
|
88
|
+
/** The production deps over a live adapter. */
|
|
89
|
+
export declare function chatScopeDeps(adapter: CoreAdapter): ChatScopeDeps;
|
|
90
|
+
/**
|
|
91
|
+
* Decide a chat's scope. Never throws on a caller error: an unknown repo is a 404 naming EVERY
|
|
92
|
+
* missing ref (not just the first), a chat id that cannot name a scratch directory is a 400. A
|
|
93
|
+
* graph that cannot be bound degrades to "no graph" WITH the reason — the same posture as a run
|
|
94
|
+
* launch (`resolveProjectGraphBinding` never indexes; a refresh is an explicit act).
|
|
95
|
+
*/
|
|
96
|
+
export declare function resolveChatScope(req: ChatScopeRequest, deps: ChatScopeDeps): Promise<ChatScopeResolution>;
|
|
97
|
+
/**
|
|
98
|
+
* The statement every seat reads on start — written as BOTH `AGENTS.md` (codex, pi, opencode,
|
|
99
|
+
* copilot) and `CLAUDE.md` (claude) into the scratch root. Plain prose, repo paths verbatim: the
|
|
100
|
+
* seat is in an empty directory and this is how it learns what it was pointed at.
|
|
101
|
+
*/
|
|
102
|
+
export declare function chatScopeStatement(chatId: string, scope: ChatScope): string;
|
|
103
|
+
/**
|
|
104
|
+
* Create the chat's scratch root (private) and write the scope statement into it. Throws on an
|
|
105
|
+
* unwritable temp — the route reports that rather than opening seats with no working directory.
|
|
106
|
+
*
|
|
107
|
+
* The root lives under the shared system temp dir, where another local user can pre-place an
|
|
108
|
+
* entry under a predictable name (Copilot, #518) — so nothing here follows a link or trusts an
|
|
109
|
+
* existing entry: the base and the root must be REAL directories (never symlinks), an existing
|
|
110
|
+
* root must be OWNED by this process's user (POSIX), the mode is ENFORCED with `chmod` (mkdir's
|
|
111
|
+
* `mode` applies only on creation), and each instruction file is unlinked before it is written
|
|
112
|
+
* exclusively (`wx`) so a planted link cannot redirect the write.
|
|
113
|
+
*/
|
|
114
|
+
export declare function prepareChatScratch(chatId: string, scope: ChatScope): void;
|
|
115
|
+
/**
|
|
116
|
+
* Reap the scratch namespaces of DEAD daemons (independent review, W6): every sibling
|
|
117
|
+
* `<pid>-<hex>` directory under the shared parent whose pid no longer exists is removed — judged
|
|
118
|
+
* with the same checks as {@link removeChatScratch} (a real directory, never a link, owned by this
|
|
119
|
+
* user). This daemon's own namespace, a live pid, a pid this user may not signal (another user's
|
|
120
|
+
* daemon), and anything not shaped like a namespace are left alone. Never throws; returns the
|
|
121
|
+
* removed namespaces. Called once at daemon boot.
|
|
122
|
+
*/
|
|
123
|
+
export declare function reapStaleChatNamespaces(parent?: string): string[];
|
|
124
|
+
/**
|
|
125
|
+
* Remove a chat's scratch root — fail closed (Copilot, #518): the base must be a REAL directory
|
|
126
|
+
* (a planted `<tmp>/wicked-crew-chats` link would make a lexical prefix test pass and the
|
|
127
|
+
* recursive removal follow it), the target must sit DIRECTLY under the base by realpath, must not
|
|
128
|
+
* itself be a link, and must be owned by this user. Anything else is left alone: a wrong guess
|
|
129
|
+
* here deletes someone else's files, so the policy is the same as `prepareChatScratch`'s.
|
|
130
|
+
*/
|
|
131
|
+
export declare function removeChatScratch(cwd: string, base?: string): void;
|
|
132
|
+
/** One chat id's lifecycle slot in the index — see {@link ChatScopeIndex}. */
|
|
133
|
+
type ChatSlot =
|
|
134
|
+
/** An open is in flight: reserved synchronously before the route's first `await`. */
|
|
135
|
+
{
|
|
136
|
+
state: 'reserved';
|
|
137
|
+
token: number;
|
|
138
|
+
}
|
|
139
|
+
/** The chat is open; its scratch root exists and its seats are reading the statement there. */
|
|
140
|
+
| {
|
|
141
|
+
state: 'live';
|
|
142
|
+
scope: ChatScope;
|
|
143
|
+
}
|
|
144
|
+
/** `DELETE` ran: the root is already gone, and the id stays taken until the engine's own
|
|
145
|
+
* `chatClosed` for it is observed (or the grace timer gives up) — so a delayed close can never
|
|
146
|
+
* land on a chat that reused the id, and a reuse cannot race the close. */
|
|
147
|
+
| {
|
|
148
|
+
state: 'closing';
|
|
149
|
+
timer: ReturnType<typeof setTimeout>;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* The daemon's live chat scopes, keyed by chat id — in memory, like the engine's own chat pool (a
|
|
153
|
+
* daemon restart loses both). A small state machine (Copilot, #518) rather than a map, because the
|
|
154
|
+
* open is asynchronous and the engine's close is an event:
|
|
155
|
+
*
|
|
156
|
+
* - `reserve` claims an id SYNCHRONOUSLY (before the route's first `await`) and hands back a
|
|
157
|
+
* token; `set` publishes the scope only if THAT reservation is still standing — an engine
|
|
158
|
+
* `chatClosed` or a `DELETE` that cancelled it in the meantime makes `set` return `false`, and
|
|
159
|
+
* the route tears the just-opened chat down instead of registering a scope for a closed one.
|
|
160
|
+
* - `beginClose` (DELETE) removes the root at once and parks the id as `closing`; `closed` (the
|
|
161
|
+
* engine's `chatClosed`) frees it. Until then a re-open of the same id is refused, so the
|
|
162
|
+
* engine's close — which may be delivered after `DELETE` returns — can never delete a newer
|
|
163
|
+
* chat's root, and a `chatClosed` for a merely reserved id cancels that open.
|
|
164
|
+
* - a `closing` slot whose event never arrives (an engine without the event, a lost relay) is
|
|
165
|
+
* freed after `closeGraceMs`; a late event after THAT is the documented residual (the engine's
|
|
166
|
+
* `chatClosed` carries no per-open token).
|
|
167
|
+
*/
|
|
168
|
+
export declare class ChatScopeIndex {
|
|
169
|
+
readonly base: string;
|
|
170
|
+
private readonly closeGraceMs;
|
|
171
|
+
private readonly slots;
|
|
172
|
+
private nextToken;
|
|
173
|
+
/** `base`: where this daemon's chat scratch roots live — the resolver is handed the SAME base. */
|
|
174
|
+
constructor(base?: string, closeGraceMs?: number);
|
|
175
|
+
/** Live, reserved or closing — every state in which the id is not free. */
|
|
176
|
+
has(chatId: string): boolean;
|
|
177
|
+
/** The state the id is in, for the route's refusal wording. */
|
|
178
|
+
stateOf(chatId: string): ChatSlot['state'] | 'free';
|
|
179
|
+
/** Reserve `chatId` for an open in flight; `null` when it is live, reserved or closing. */
|
|
180
|
+
reserve(chatId: string): number | null;
|
|
181
|
+
/** Give a reservation back (the open failed before `set`) — only the holder's own. */
|
|
182
|
+
release(chatId: string, token: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* Abort an open that already reached the ENGINE (the route closed the engine chat again): the
|
|
185
|
+
* engine's `chatClosed` for this id is still on its way, so the id is parked as `closing` — not
|
|
186
|
+
* released — until that event (or the grace) frees it; a reuse in between would otherwise have
|
|
187
|
+
* its root removed by the late event (Copilot, #518). Only the holder's own reservation.
|
|
188
|
+
*/
|
|
189
|
+
abortToClosing(chatId: string, token: number): void;
|
|
190
|
+
/** Publish the scope of a finished open. `false` when the reservation is gone (cancelled by a
|
|
191
|
+
* close in the meantime): the caller must tear the chat down, nothing was recorded. */
|
|
192
|
+
set(chatId: string, scope: ChatScope, token: number): boolean;
|
|
193
|
+
/** The scope of a LIVE chat; `undefined` while reserved, closing or unknown. */
|
|
194
|
+
get(chatId: string): ChatScope | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* `DELETE /chats/:id`: remove the root now and park the id until the engine's `chatClosed` (or
|
|
197
|
+
* the grace) frees it. A reserved id is cancelled instead (the in-flight open cleans up on its
|
|
198
|
+
* failed `set`). Returns the scope that was live, if any.
|
|
199
|
+
*/
|
|
200
|
+
beginClose(chatId: string): ChatScope | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* The engine's `chatClosed` for `chatId` (any reason): frees a closing id, removes and frees a
|
|
203
|
+
* live one (an engine-side reap), cancels a reservation (the open in flight tears down). Idempotent.
|
|
204
|
+
*/
|
|
205
|
+
closed(chatId: string): void;
|
|
206
|
+
/** Forget the chat and remove its scratch root at once — no closing window (tests, teardown). */
|
|
207
|
+
delete(chatId: string): ChatScope | undefined;
|
|
208
|
+
}
|
|
209
|
+
export {};
|
|
210
|
+
//# sourceMappingURL=chat-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-scope.d.ts","sourceRoot":"","sources":["../../src/api/chat-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAiB,SAAS,EAAE,MAAM,k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