@overdeck/contracts 0.86.0 → 0.87.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/dist/index.cjs +468 -20
- package/dist/index.d.ts +602 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +458 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -513,6 +513,7 @@ const AgentRuntimeSnapshot = effect.Schema.Struct({
|
|
|
513
513
|
lastActivity: effect.Schema.String,
|
|
514
514
|
currentTool: effect.Schema.optional(effect.Schema.String),
|
|
515
515
|
currentToolDescription: effect.Schema.optional(effect.Schema.String),
|
|
516
|
+
toolStartedAt: effect.Schema.optional(effect.Schema.String),
|
|
516
517
|
thinking: effect.Schema.optional(ThinkingState),
|
|
517
518
|
waiting: effect.Schema.optional(WaitingState),
|
|
518
519
|
claudeSessionId: effect.Schema.optional(effect.Schema.String),
|
|
@@ -716,6 +717,54 @@ const ProjectDeploySnapshot = effect.Schema.Struct({
|
|
|
716
717
|
/** Last lines of `logPath`. */
|
|
717
718
|
logTail: effect.Schema.optional(effect.Schema.Array(effect.Schema.String))
|
|
718
719
|
});
|
|
720
|
+
/**
|
|
721
|
+
* PAN-5342 — the safe-shutdown drain, derived each tick by the dashboard's
|
|
722
|
+
* drain service and emitted in-memory only (`system.shutdown_changed`).
|
|
723
|
+
* The only stored shutdown state is `<OVERDECK_HOME>/shutdown.json`.
|
|
724
|
+
*/
|
|
725
|
+
const ShutdownPhase = effect.Schema.Literals([
|
|
726
|
+
"draining",
|
|
727
|
+
"waiting-for-writers",
|
|
728
|
+
"verifying",
|
|
729
|
+
"complete"
|
|
730
|
+
]);
|
|
731
|
+
const ShutdownPendingSession = effect.Schema.Struct({
|
|
732
|
+
id: effect.Schema.String,
|
|
733
|
+
kind: effect.Schema.Literals(["agent", "conversation"]),
|
|
734
|
+
label: effect.Schema.String,
|
|
735
|
+
issueId: effect.Schema.optional(effect.Schema.String),
|
|
736
|
+
conversationName: effect.Schema.optional(effect.Schema.String),
|
|
737
|
+
/** Runtime activity, or "unknown" when the session has no runtime snapshot. */
|
|
738
|
+
activity: effect.Schema.String,
|
|
739
|
+
tool: effect.Schema.optional(effect.Schema.String),
|
|
740
|
+
toolDescription: effect.Schema.optional(effect.Schema.String),
|
|
741
|
+
toolStartedAt: effect.Schema.optional(effect.Schema.String)
|
|
742
|
+
});
|
|
743
|
+
const ShutdownWriter = effect.Schema.Struct({
|
|
744
|
+
kind: effect.Schema.Literals([
|
|
745
|
+
"auto-merge",
|
|
746
|
+
"post-merge",
|
|
747
|
+
"verification"
|
|
748
|
+
]),
|
|
749
|
+
label: effect.Schema.String,
|
|
750
|
+
startedAt: effect.Schema.optional(effect.Schema.String)
|
|
751
|
+
});
|
|
752
|
+
const ShutdownSnapshot = effect.Schema.Struct({
|
|
753
|
+
phase: ShutdownPhase,
|
|
754
|
+
startedAt: effect.Schema.String,
|
|
755
|
+
deadlineAt: effect.Schema.String,
|
|
756
|
+
overdue: effect.Schema.Boolean,
|
|
757
|
+
reboot: effect.Schema.Boolean,
|
|
758
|
+
force: effect.Schema.Literals([
|
|
759
|
+
"never",
|
|
760
|
+
"at-deadline",
|
|
761
|
+
"now"
|
|
762
|
+
]),
|
|
763
|
+
pending: effect.Schema.Array(ShutdownPendingSession),
|
|
764
|
+
writers: effect.Schema.Array(ShutdownWriter),
|
|
765
|
+
stoppedCount: effect.Schema.Number,
|
|
766
|
+
warnings: effect.Schema.Array(effect.Schema.String)
|
|
767
|
+
});
|
|
719
768
|
/** What kind of process asked for the voluntary dashboard restart. */
|
|
720
769
|
const RestartGateKind = effect.Schema.Literals([
|
|
721
770
|
"deploy",
|
|
@@ -802,6 +851,7 @@ const DashboardSnapshot = effect.Schema.Struct({
|
|
|
802
851
|
githubQuota: effect.Schema.optional(GitHubQuotaSnapshot),
|
|
803
852
|
/** PAN-3751 — in-flight deploys keyed by project key. */
|
|
804
853
|
deployByProjectKey: effect.Schema.optional(effect.Schema.Record(effect.Schema.String, ProjectDeploySnapshot)),
|
|
854
|
+
shutdown: effect.Schema.optional(effect.Schema.NullOr(ShutdownSnapshot)),
|
|
805
855
|
timestamp: effect.Schema.String
|
|
806
856
|
});
|
|
807
857
|
const ResourceStats = effect.Schema.Struct({ containers: effect.Schema.Array(effect.Schema.Struct({
|
|
@@ -1241,7 +1291,8 @@ const RagDecisionSource = effect.Schema.Struct({
|
|
|
1241
1291
|
"summary",
|
|
1242
1292
|
"status",
|
|
1243
1293
|
"sibling",
|
|
1244
|
-
"knowledge"
|
|
1294
|
+
"knowledge",
|
|
1295
|
+
"fact"
|
|
1245
1296
|
]),
|
|
1246
1297
|
scope: effect.Schema.String,
|
|
1247
1298
|
score: effect.Schema.Number,
|
|
@@ -1267,7 +1318,8 @@ const RagDecision = effect.Schema.Struct({
|
|
|
1267
1318
|
observations: effect.Schema.Number,
|
|
1268
1319
|
summaries: effect.Schema.Number,
|
|
1269
1320
|
sibling: effect.Schema.Number,
|
|
1270
|
-
knowledgeIndex: effect.Schema.Number
|
|
1321
|
+
knowledgeIndex: effect.Schema.Number,
|
|
1322
|
+
facts: effect.Schema.optional(effect.Schema.Number)
|
|
1271
1323
|
}),
|
|
1272
1324
|
sources: effect.Schema.Array(RagDecisionSource),
|
|
1273
1325
|
reason: effect.Schema.NullOr(effect.Schema.String)
|
|
@@ -1702,6 +1754,17 @@ const ProjectDeployChangedEvent = effect.Schema.Struct({
|
|
|
1702
1754
|
timestamp: effect.Schema.String,
|
|
1703
1755
|
payload: effect.Schema.Struct({ deploys: effect.Schema.Record(effect.Schema.String, ProjectDeploySnapshot) })
|
|
1704
1756
|
});
|
|
1757
|
+
/**
|
|
1758
|
+
* PAN-5342 — the safe-shutdown drain snapshot; `null` when no drain runs.
|
|
1759
|
+
* The dashboard's drain service emits it in-memory only (`emitOnly`), like
|
|
1760
|
+
* `project.deploy_changed`: never persisted, never replayed at boot.
|
|
1761
|
+
*/
|
|
1762
|
+
const SystemShutdownChangedEvent = effect.Schema.Struct({
|
|
1763
|
+
type: effect.Schema.Literal("system.shutdown_changed"),
|
|
1764
|
+
sequence: SequenceNumber,
|
|
1765
|
+
timestamp: effect.Schema.String,
|
|
1766
|
+
payload: effect.Schema.Struct({ shutdown: effect.Schema.NullOr(ShutdownSnapshot) })
|
|
1767
|
+
});
|
|
1705
1768
|
/** Replaces socket.io `agents:changed` (event: 'started') */
|
|
1706
1769
|
const AgentStartedEvent = effect.Schema.Struct({
|
|
1707
1770
|
type: effect.Schema.Literal("agent.started"),
|
|
@@ -3021,6 +3084,7 @@ const DomainEvent = effect.Schema.Union([
|
|
|
3021
3084
|
RestartGateChangedEvent,
|
|
3022
3085
|
GitHubQuotaChangedEvent,
|
|
3023
3086
|
ProjectDeployChangedEvent,
|
|
3087
|
+
SystemShutdownChangedEvent,
|
|
3024
3088
|
AgentCreatedEvent,
|
|
3025
3089
|
AgentEnrichmentChangedEvent,
|
|
3026
3090
|
AgentStartedEvent,
|
|
@@ -3371,6 +3435,38 @@ function compareEffort(a, b) {
|
|
|
3371
3435
|
return EFFORT_LEVELS.indexOf(a) - EFFORT_LEVELS.indexOf(b);
|
|
3372
3436
|
}
|
|
3373
3437
|
//#endregion
|
|
3438
|
+
//#region src/ui-commands.ts
|
|
3439
|
+
/** The server's answer for a path: which deck, root and file or folder to show. */
|
|
3440
|
+
const UiOpenResolution = effect.Schema.Struct({
|
|
3441
|
+
/** The registered project key (`projects.yaml`), as root ids use it. */
|
|
3442
|
+
projectKey: effect.Schema.String,
|
|
3443
|
+
/** The deck the dashboard keys this project by: its name, or its key when it has none (PAN-5398). */
|
|
3444
|
+
deckKey: effect.Schema.String,
|
|
3445
|
+
rootId: effect.Schema.String,
|
|
3446
|
+
/** POSIX path relative to the root folder; `''` for the root itself. */
|
|
3447
|
+
relPath: effect.Schema.String,
|
|
3448
|
+
kind: effect.Schema.Literals(["file", "dir"]),
|
|
3449
|
+
line: effect.Schema.optional(effect.Schema.Number),
|
|
3450
|
+
column: effect.Schema.optional(effect.Schema.Number)
|
|
3451
|
+
});
|
|
3452
|
+
/** The deck key the project switcher selects for a registered project: its name, or its key (PAN-5398). */
|
|
3453
|
+
function projectDeckKey(project) {
|
|
3454
|
+
return project.name ?? project.key;
|
|
3455
|
+
}
|
|
3456
|
+
/** The sentence `pan open` prints and the dashboard toasts after an open (PAN-5398). */
|
|
3457
|
+
function uiOpenSummary(resolution) {
|
|
3458
|
+
const { deckKey, rootId, relPath } = resolution;
|
|
3459
|
+
if (relPath) return `Opened ${relPath} in ${deckKey}`;
|
|
3460
|
+
if (rootId.startsWith("issue:")) return `Opened the ${rootId.slice(6)} workspace in ${deckKey}`;
|
|
3461
|
+
return `Opened root folder in ${deckKey}`;
|
|
3462
|
+
}
|
|
3463
|
+
/** One UI command. `id` is a random UUID that tabs use to dedupe handling. */
|
|
3464
|
+
const UiCommand = effect.Schema.Struct({
|
|
3465
|
+
id: effect.Schema.String,
|
|
3466
|
+
type: effect.Schema.Literal("open-path"),
|
|
3467
|
+
resolution: UiOpenResolution
|
|
3468
|
+
});
|
|
3469
|
+
//#endregion
|
|
3374
3470
|
//#region src/explorer.ts
|
|
3375
3471
|
/** "project:<key>", "issue:<id>" or "workspace:<id>". */
|
|
3376
3472
|
const ExplorerRootId = effect.Schema.String;
|
|
@@ -3581,6 +3677,7 @@ const WS_METHODS = {
|
|
|
3581
3677
|
subscribeAgentOutput: "pan.subscribeAgentOutput",
|
|
3582
3678
|
subscribeConversationMessages: "pan.subscribeConversationMessages",
|
|
3583
3679
|
subscribeProjectSessionTree: "pan.subscribeProjectSessionTree",
|
|
3680
|
+
subscribeUiCommands: "pan.subscribeUiCommands",
|
|
3584
3681
|
getSnapshot: "pan.getSnapshot",
|
|
3585
3682
|
replayEvents: "pan.replayEvents",
|
|
3586
3683
|
readWorkspaceFile: "pan.readWorkspaceFile",
|
|
@@ -3814,6 +3911,12 @@ const SubscribeDomainEventsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.subscri
|
|
|
3814
3911
|
success: DomainEvent,
|
|
3815
3912
|
stream: true
|
|
3816
3913
|
});
|
|
3914
|
+
/** 1a. Subscribe to transient UI commands such as "open this path" (stream, PAN-5349) */
|
|
3915
|
+
const SubscribeUiCommandsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.subscribeUiCommands, {
|
|
3916
|
+
payload: effect.Schema.Struct({}),
|
|
3917
|
+
success: UiCommand,
|
|
3918
|
+
stream: true
|
|
3919
|
+
});
|
|
3817
3920
|
/** 1b. Subscribe to the live domain event stream for one issue (stream) */
|
|
3818
3921
|
const SubscribeIssueEventsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.subscribeIssueEvents, {
|
|
3819
3922
|
payload: effect.Schema.Struct({ issueId: IssueId }),
|
|
@@ -4302,7 +4405,7 @@ const GetConversationStatsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.getConve
|
|
|
4302
4405
|
error: PanRpcError
|
|
4303
4406
|
});
|
|
4304
4407
|
/** All Overdeck WebSocket RPC methods */
|
|
4305
|
-
const PanRpcGroup = effect_unstable_rpc_RpcGroup.make(SubscribeDomainEventsRpc, SubscribeIssueEventsRpc, SubscribeTerminalRpc, SubscribeAgentOutputRpc, GetSnapshotRpc, ReplayEventsRpc, ReadWorkspaceFileRpc, ReadFileAtPathRpc, WriteFileAtPathRpc, ResolveFilePathExistsRpc, ExplorerListDirRpc, ExplorerReadFileRpc, ExplorerWriteFileRpc, ExplorerCreateRpc, ExplorerRenameRpc, ExplorerCopyRpc, ExplorerDeleteRpc, ExplorerRestoreRpc, ExplorerGitStatusRpc, ExplorerGitStageRpc, ExplorerSearchFilesRpc, ExplorerSearchContentRpc, ExplorerWatchRpc, ExplorerBeginEditRpc, TerminalOpenRpc, TerminalWriteRpc, TerminalResizeRpc, TerminalCloseRpc, StartPlanningRpc, StartAgentRpc, DeepWipeRpc, SendTerminalInputRpc, ResizeTerminalRpc, SubscribeConversationMessagesRpc, SubscribeProjectSessionTreeRpc, ShellOpenInEditorRpc, GetAvailableEditorsRpc, ShellOpenInBrowserRpc, GetAvailableBrowsersRpc, ScanConversationsRpc, SearchConversationsRpc, ListDiscoveredSessionsRpc, ListSessionsFeedRpc, GetSessionsFeedFacetsRpc, GetDiscoveredSessionRpc, EnrichSessionsRpc, EmbedSessionsRpc, GetConversationCostRpc, GetConversationCostByWorkspaceRpc, GetConversationStatsRpc);
|
|
4408
|
+
const PanRpcGroup = effect_unstable_rpc_RpcGroup.make(SubscribeDomainEventsRpc, SubscribeUiCommandsRpc, SubscribeIssueEventsRpc, SubscribeTerminalRpc, SubscribeAgentOutputRpc, GetSnapshotRpc, ReplayEventsRpc, ReadWorkspaceFileRpc, ReadFileAtPathRpc, WriteFileAtPathRpc, ResolveFilePathExistsRpc, ExplorerListDirRpc, ExplorerReadFileRpc, ExplorerWriteFileRpc, ExplorerCreateRpc, ExplorerRenameRpc, ExplorerCopyRpc, ExplorerDeleteRpc, ExplorerRestoreRpc, ExplorerGitStatusRpc, ExplorerGitStageRpc, ExplorerSearchFilesRpc, ExplorerSearchContentRpc, ExplorerWatchRpc, ExplorerBeginEditRpc, TerminalOpenRpc, TerminalWriteRpc, TerminalResizeRpc, TerminalCloseRpc, StartPlanningRpc, StartAgentRpc, DeepWipeRpc, SendTerminalInputRpc, ResizeTerminalRpc, SubscribeConversationMessagesRpc, SubscribeProjectSessionTreeRpc, ShellOpenInEditorRpc, GetAvailableEditorsRpc, ShellOpenInBrowserRpc, GetAvailableBrowsersRpc, ScanConversationsRpc, SearchConversationsRpc, ListDiscoveredSessionsRpc, ListSessionsFeedRpc, GetSessionsFeedFacetsRpc, GetDiscoveredSessionRpc, EnrichSessionsRpc, EmbedSessionsRpc, GetConversationCostRpc, GetConversationCostByWorkspaceRpc, GetConversationStatsRpc);
|
|
4306
4409
|
//#endregion
|
|
4307
4410
|
//#region src/agent-runtime-merge.ts
|
|
4308
4411
|
function defaultRuntimeSnapshot(agentId, timestamp, sequence) {
|
|
@@ -4390,6 +4493,7 @@ const INITIAL_READ_MODEL_STATE = {
|
|
|
4390
4493
|
restartGate: null,
|
|
4391
4494
|
githubQuota: null,
|
|
4392
4495
|
deployByProjectKey: {},
|
|
4496
|
+
shutdown: null,
|
|
4393
4497
|
agentIdBySessionId: {},
|
|
4394
4498
|
dashboardLifecycle: {
|
|
4395
4499
|
active: false,
|
|
@@ -4498,6 +4602,7 @@ function syncSnapshot(state, snapshot) {
|
|
|
4498
4602
|
restartGate: snapshot.restartGate ?? state.restartGate,
|
|
4499
4603
|
githubQuota: snapshot.githubQuota ?? state.githubQuota,
|
|
4500
4604
|
deployByProjectKey: snapshot.deployByProjectKey ?? state.deployByProjectKey,
|
|
4605
|
+
shutdown: snapshot.shutdown ?? null,
|
|
4501
4606
|
agentIdBySessionId
|
|
4502
4607
|
};
|
|
4503
4608
|
}
|
|
@@ -4603,6 +4708,7 @@ function applyEvent(state, event) {
|
|
|
4603
4708
|
...prevRuntime,
|
|
4604
4709
|
activity: "stopped",
|
|
4605
4710
|
currentTool: void 0,
|
|
4711
|
+
toolStartedAt: void 0,
|
|
4606
4712
|
currentToolDescription: void 0,
|
|
4607
4713
|
thinking: void 0,
|
|
4608
4714
|
waiting: void 0,
|
|
@@ -4749,6 +4855,7 @@ function applyEvent(state, event) {
|
|
|
4749
4855
|
...prevRuntime,
|
|
4750
4856
|
activity: "stopped",
|
|
4751
4857
|
currentTool: void 0,
|
|
4858
|
+
toolStartedAt: void 0,
|
|
4752
4859
|
currentToolDescription: void 0,
|
|
4753
4860
|
thinking: void 0,
|
|
4754
4861
|
waiting: void 0,
|
|
@@ -4929,6 +5036,11 @@ function applyEvent(state, event) {
|
|
|
4929
5036
|
sequence: Math.max(state.sequence, event.sequence),
|
|
4930
5037
|
deployByProjectKey: event.payload.deploys
|
|
4931
5038
|
};
|
|
5039
|
+
case "system.shutdown_changed": return {
|
|
5040
|
+
...state,
|
|
5041
|
+
sequence: Math.max(state.sequence, event.sequence),
|
|
5042
|
+
shutdown: event.payload.shutdown
|
|
5043
|
+
};
|
|
4932
5044
|
case "resources.updated": return {
|
|
4933
5045
|
...state,
|
|
4934
5046
|
sequence: Math.max(state.sequence, event.sequence),
|
|
@@ -5177,13 +5289,14 @@ function applyEvent(state, event) {
|
|
|
5177
5289
|
sequence: Math.max(state.sequence, event.sequence)
|
|
5178
5290
|
};
|
|
5179
5291
|
case "agent.activity_changed": {
|
|
5180
|
-
const { agentId, activity, currentTool, toolDescription } = event.payload;
|
|
5292
|
+
const { agentId, activity, currentTool, toolDescription, hookName } = event.payload;
|
|
5181
5293
|
const prev = state.agentRuntimeById[agentId] ?? defaultRuntimeSnapshot(agentId, event.timestamp, event.sequence);
|
|
5182
5294
|
const next = {
|
|
5183
5295
|
...prev,
|
|
5184
5296
|
activity,
|
|
5185
5297
|
currentTool: activity === "working" ? currentTool : void 0,
|
|
5186
5298
|
currentToolDescription: activity === "working" ? toolDescription : void 0,
|
|
5299
|
+
toolStartedAt: activity !== "working" ? void 0 : hookName === "PreToolUse" ? event.timestamp : hookName === "PostToolUse" ? void 0 : prev.toolStartedAt,
|
|
5187
5300
|
thinking: activity === "thinking" ? prev.thinking : void 0,
|
|
5188
5301
|
waiting: activity === "waiting" ? prev.waiting : void 0,
|
|
5189
5302
|
channelReply: activity === "working" ? void 0 : prev.channelReply,
|
|
@@ -5205,6 +5318,7 @@ function applyEvent(state, event) {
|
|
|
5205
5318
|
...state.agentRuntimeById[agentId] ?? defaultRuntimeSnapshot(agentId, event.timestamp, event.sequence),
|
|
5206
5319
|
activity: "thinking",
|
|
5207
5320
|
currentTool: void 0,
|
|
5321
|
+
toolStartedAt: void 0,
|
|
5208
5322
|
currentToolDescription: void 0,
|
|
5209
5323
|
thinking: {
|
|
5210
5324
|
since: event.timestamp,
|
|
@@ -5252,6 +5366,7 @@ function applyEvent(state, event) {
|
|
|
5252
5366
|
...state.agentRuntimeById[agentId] ?? defaultRuntimeSnapshot(agentId, event.timestamp, event.sequence),
|
|
5253
5367
|
activity: "waiting",
|
|
5254
5368
|
currentTool: void 0,
|
|
5369
|
+
toolStartedAt: void 0,
|
|
5255
5370
|
currentToolDescription: void 0,
|
|
5256
5371
|
thinking: void 0,
|
|
5257
5372
|
waiting: {
|
|
@@ -6748,7 +6863,8 @@ const HARNESS_CAPABILITY_KEYS = [
|
|
|
6748
6863
|
"answersQuestionByMessage",
|
|
6749
6864
|
"askAnswerDelivery",
|
|
6750
6865
|
"runsOnFlyMachine",
|
|
6751
|
-
"overdeckMcp"
|
|
6866
|
+
"overdeckMcp",
|
|
6867
|
+
"skillSlashCommands"
|
|
6752
6868
|
];
|
|
6753
6869
|
const CLAUDE_CODE_CAPABILITIES = {
|
|
6754
6870
|
contextChannel: "append-system-prompt-file",
|
|
@@ -6772,7 +6888,8 @@ const CLAUDE_CODE_CAPABILITIES = {
|
|
|
6772
6888
|
answersQuestionByMessage: true,
|
|
6773
6889
|
askAnswerDelivery: "message",
|
|
6774
6890
|
runsOnFlyMachine: true,
|
|
6775
|
-
overdeckMcp: true
|
|
6891
|
+
overdeckMcp: true,
|
|
6892
|
+
skillSlashCommands: true
|
|
6776
6893
|
};
|
|
6777
6894
|
const OHMYPI_CAPABILITIES = {
|
|
6778
6895
|
contextChannel: "append-system-prompt",
|
|
@@ -6796,7 +6913,8 @@ const OHMYPI_CAPABILITIES = {
|
|
|
6796
6913
|
answersQuestionByMessage: false,
|
|
6797
6914
|
askAnswerDelivery: "pi-ask-modal",
|
|
6798
6915
|
runsOnFlyMachine: false,
|
|
6799
|
-
overdeckMcp: false
|
|
6916
|
+
overdeckMcp: false,
|
|
6917
|
+
skillSlashCommands: false
|
|
6800
6918
|
};
|
|
6801
6919
|
/**
|
|
6802
6920
|
* Pi Coding Agent (PAN-5212). Same launch channel and transcript handling as
|
|
@@ -6832,7 +6950,8 @@ const CODEX_CAPABILITIES = {
|
|
|
6832
6950
|
answersQuestionByMessage: false,
|
|
6833
6951
|
askAnswerDelivery: "codex-approval",
|
|
6834
6952
|
runsOnFlyMachine: true,
|
|
6835
|
-
overdeckMcp: true
|
|
6953
|
+
overdeckMcp: true,
|
|
6954
|
+
skillSlashCommands: false
|
|
6836
6955
|
};
|
|
6837
6956
|
const ACP_CAPABILITIES = {
|
|
6838
6957
|
contextChannel: "acp-initial-context",
|
|
@@ -6856,7 +6975,8 @@ const ACP_CAPABILITIES = {
|
|
|
6856
6975
|
answersQuestionByMessage: false,
|
|
6857
6976
|
askAnswerDelivery: "message",
|
|
6858
6977
|
runsOnFlyMachine: false,
|
|
6859
|
-
overdeckMcp: true
|
|
6978
|
+
overdeckMcp: true,
|
|
6979
|
+
skillSlashCommands: false
|
|
6860
6980
|
};
|
|
6861
6981
|
const KIMI_CODE_CAPABILITIES = {
|
|
6862
6982
|
contextChannel: "initial-message-envelope",
|
|
@@ -6880,7 +7000,8 @@ const KIMI_CODE_CAPABILITIES = {
|
|
|
6880
7000
|
answersQuestionByMessage: false,
|
|
6881
7001
|
askAnswerDelivery: "message",
|
|
6882
7002
|
runsOnFlyMachine: false,
|
|
6883
|
-
overdeckMcp: false
|
|
7003
|
+
overdeckMcp: false,
|
|
7004
|
+
skillSlashCommands: false
|
|
6884
7005
|
};
|
|
6885
7006
|
const OPENCODE_CAPABILITIES = {
|
|
6886
7007
|
contextChannel: "acp-initial-context",
|
|
@@ -6904,7 +7025,8 @@ const OPENCODE_CAPABILITIES = {
|
|
|
6904
7025
|
answersQuestionByMessage: false,
|
|
6905
7026
|
askAnswerDelivery: "message",
|
|
6906
7027
|
runsOnFlyMachine: false,
|
|
6907
|
-
overdeckMcp: true
|
|
7028
|
+
overdeckMcp: true,
|
|
7029
|
+
skillSlashCommands: false
|
|
6908
7030
|
};
|
|
6909
7031
|
const GROK_CAPABILITIES = {
|
|
6910
7032
|
...OPENCODE_CAPABILITIES,
|
|
@@ -6935,7 +7057,8 @@ const MUSE_CAPABILITIES = {
|
|
|
6935
7057
|
answersQuestionByMessage: false,
|
|
6936
7058
|
askAnswerDelivery: "message",
|
|
6937
7059
|
runsOnFlyMachine: false,
|
|
6938
|
-
overdeckMcp: false
|
|
7060
|
+
overdeckMcp: false,
|
|
7061
|
+
skillSlashCommands: false
|
|
6939
7062
|
};
|
|
6940
7063
|
const PRIME_AGENT_CAPABILITIES = {
|
|
6941
7064
|
contextChannel: "prime-agent-append-system-prompt",
|
|
@@ -6959,7 +7082,8 @@ const PRIME_AGENT_CAPABILITIES = {
|
|
|
6959
7082
|
answersQuestionByMessage: false,
|
|
6960
7083
|
askAnswerDelivery: "message",
|
|
6961
7084
|
runsOnFlyMachine: false,
|
|
6962
|
-
overdeckMcp: false
|
|
7085
|
+
overdeckMcp: false,
|
|
7086
|
+
skillSlashCommands: false
|
|
6963
7087
|
};
|
|
6964
7088
|
//#endregion
|
|
6965
7089
|
//#region src/harness-behavior.ts
|
|
@@ -7542,6 +7666,7 @@ const TELEMETRY_CLIENT_ROUTES = [
|
|
|
7542
7666
|
"/api/agents/:id/message",
|
|
7543
7667
|
"/api/agents/:id/permissions/:requestId/respond",
|
|
7544
7668
|
"/api/agents/:id/plan-action",
|
|
7669
|
+
"/api/agents/:id/send-now",
|
|
7545
7670
|
"/api/agents/:id/tell",
|
|
7546
7671
|
"/api/backend-restart-recovery",
|
|
7547
7672
|
"/api/backend-restart-recovery/dismiss",
|
|
@@ -7557,6 +7682,8 @@ const TELEMETRY_CLIENT_ROUTES = [
|
|
|
7557
7682
|
"/api/conversations/:name/about",
|
|
7558
7683
|
"/api/conversations/:name/attachments/:file",
|
|
7559
7684
|
"/api/conversations/:name/bookmarks",
|
|
7685
|
+
"/api/conversations/:name/changes",
|
|
7686
|
+
"/api/conversations/:name/changes/lines",
|
|
7560
7687
|
"/api/conversations/:name/compact",
|
|
7561
7688
|
"/api/conversations/:name/delete-image",
|
|
7562
7689
|
"/api/conversations/:name/diffs",
|
|
@@ -7579,6 +7706,7 @@ const TELEMETRY_CLIENT_ROUTES = [
|
|
|
7579
7706
|
"/api/conversations/:name/scheduled-messages/:id",
|
|
7580
7707
|
"/api/conversations/:name/schedules",
|
|
7581
7708
|
"/api/conversations/:name/schedules/:id",
|
|
7709
|
+
"/api/conversations/:name/send-now",
|
|
7582
7710
|
"/api/conversations/:name/stop",
|
|
7583
7711
|
"/api/conversations/:name/switch-model",
|
|
7584
7712
|
"/api/conversations/:name/thinking-level",
|
|
@@ -7590,6 +7718,7 @@ const TELEMETRY_CLIENT_ROUTES = [
|
|
|
7590
7718
|
"/api/disk-alert",
|
|
7591
7719
|
"/api/explorer/download",
|
|
7592
7720
|
"/api/explorer/edit-workspaces/:workspaceId",
|
|
7721
|
+
"/api/explorer/edit-workspaces/:workspaceId/changes",
|
|
7593
7722
|
"/api/explorer/edit-workspaces/:workspaceId/discard",
|
|
7594
7723
|
"/api/explorer/edit-workspaces/:workspaceId/merge",
|
|
7595
7724
|
"/api/explorer/edit-workspaces/:workspaceId/pr",
|
|
@@ -7664,7 +7793,13 @@ const TELEMETRY_CLIENT_ROUTES = [
|
|
|
7664
7793
|
"/api/self/workers/:id",
|
|
7665
7794
|
"/api/self/workers/:id/wait",
|
|
7666
7795
|
"/api/settings/resolved",
|
|
7796
|
+
"/api/shutdown",
|
|
7797
|
+
"/api/shutdown/cancel",
|
|
7798
|
+
"/api/shutdown/force-all",
|
|
7799
|
+
"/api/shutdown/force-stop",
|
|
7800
|
+
"/api/shutdown/preview",
|
|
7667
7801
|
"/api/telemetry/client-config",
|
|
7802
|
+
"/api/ui/open",
|
|
7668
7803
|
"/api/versions/self",
|
|
7669
7804
|
"/api/versions/self/update",
|
|
7670
7805
|
"/api/workers",
|
|
@@ -7776,6 +7911,7 @@ const TELEMETRY_CLIENT_ROUTE_AREAS = [
|
|
|
7776
7911
|
"share-probe",
|
|
7777
7912
|
"shares",
|
|
7778
7913
|
"show",
|
|
7914
|
+
"shutdown",
|
|
7779
7915
|
"skills",
|
|
7780
7916
|
"specialists",
|
|
7781
7917
|
"system",
|
|
@@ -7787,6 +7923,7 @@ const TELEMETRY_CLIENT_ROUTE_AREAS = [
|
|
|
7787
7923
|
"trackers",
|
|
7788
7924
|
"triggers",
|
|
7789
7925
|
"tts",
|
|
7926
|
+
"ui",
|
|
7790
7927
|
"update",
|
|
7791
7928
|
"vault",
|
|
7792
7929
|
"velocity",
|
|
@@ -10219,20 +10356,70 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
10219
10356
|
"id": "pan-open",
|
|
10220
10357
|
"path": ["open"],
|
|
10221
10358
|
"display": "/pan open",
|
|
10222
|
-
"description": "Open
|
|
10359
|
+
"description": "Open a file, folder or issue workspace in Overdeck",
|
|
10223
10360
|
"args": [{
|
|
10224
|
-
"name": "
|
|
10361
|
+
"name": "target",
|
|
10225
10362
|
"required": true,
|
|
10226
10363
|
"variadic": false
|
|
10227
10364
|
}],
|
|
10365
|
+
"options": [
|
|
10366
|
+
{
|
|
10367
|
+
"flags": "-e, --editor [editor]",
|
|
10368
|
+
"description": "Open in an external editor instead (cursor, vscode, zed, file-manager, …)",
|
|
10369
|
+
"required": false,
|
|
10370
|
+
"valueHint": "editor"
|
|
10371
|
+
},
|
|
10372
|
+
{
|
|
10373
|
+
"flags": "--line <n>",
|
|
10374
|
+
"description": "Open a file at this line",
|
|
10375
|
+
"required": true,
|
|
10376
|
+
"valueHint": "n"
|
|
10377
|
+
},
|
|
10378
|
+
{
|
|
10379
|
+
"flags": "--column <n>",
|
|
10380
|
+
"description": "Open a file at this column",
|
|
10381
|
+
"required": true,
|
|
10382
|
+
"valueHint": "n"
|
|
10383
|
+
},
|
|
10384
|
+
{
|
|
10385
|
+
"flags": "--new-tab",
|
|
10386
|
+
"description": "Open in a new browser tab instead of the focused dashboard tab",
|
|
10387
|
+
"required": false,
|
|
10388
|
+
"valueHint": null
|
|
10389
|
+
}
|
|
10390
|
+
],
|
|
10391
|
+
"aliases": [],
|
|
10392
|
+
"category": "Observation"
|
|
10393
|
+
},
|
|
10394
|
+
{
|
|
10395
|
+
"id": "pan-integrate",
|
|
10396
|
+
"path": ["integrate"],
|
|
10397
|
+
"display": "/pan integrate",
|
|
10398
|
+
"description": "Add Overdeck to other tools on this machine",
|
|
10399
|
+
"args": [],
|
|
10400
|
+
"options": [],
|
|
10401
|
+
"aliases": [],
|
|
10402
|
+
"category": "Core"
|
|
10403
|
+
},
|
|
10404
|
+
{
|
|
10405
|
+
"id": "pan-integrate-file-manager",
|
|
10406
|
+
"path": ["integrate", "file-manager"],
|
|
10407
|
+
"display": "/pan integrate file-manager",
|
|
10408
|
+
"description": "Add \"Open in Overdeck\" to the file manager's right-click menu",
|
|
10409
|
+
"args": [],
|
|
10228
10410
|
"options": [{
|
|
10229
|
-
"flags": "
|
|
10230
|
-
"description": "
|
|
10231
|
-
"required":
|
|
10232
|
-
"valueHint":
|
|
10411
|
+
"flags": "--remove",
|
|
10412
|
+
"description": "Remove the entries this command added",
|
|
10413
|
+
"required": false,
|
|
10414
|
+
"valueHint": null
|
|
10415
|
+
}, {
|
|
10416
|
+
"flags": "--dry-run",
|
|
10417
|
+
"description": "Print what would be written, deleted or run, and change nothing",
|
|
10418
|
+
"required": false,
|
|
10419
|
+
"valueHint": null
|
|
10233
10420
|
}],
|
|
10234
10421
|
"aliases": [],
|
|
10235
|
-
"category": "
|
|
10422
|
+
"category": "Core"
|
|
10236
10423
|
},
|
|
10237
10424
|
{
|
|
10238
10425
|
"id": "pan-review",
|
|
@@ -13806,6 +13993,12 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
13806
13993
|
"required": false,
|
|
13807
13994
|
"valueHint": null
|
|
13808
13995
|
},
|
|
13996
|
+
{
|
|
13997
|
+
"flags": "--all",
|
|
13998
|
+
"description": "List every fact, including superseded and retired ones",
|
|
13999
|
+
"required": false,
|
|
14000
|
+
"valueHint": null
|
|
14001
|
+
},
|
|
13809
14002
|
{
|
|
13810
14003
|
"flags": "--project <key>",
|
|
13811
14004
|
"description": "Project key (defaults to the project owning the cwd)",
|
|
@@ -13887,6 +14080,24 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
13887
14080
|
"required": true,
|
|
13888
14081
|
"valueHint": "a,b"
|
|
13889
14082
|
},
|
|
14083
|
+
{
|
|
14084
|
+
"flags": "--always",
|
|
14085
|
+
"description": "List this fact first in every launch index and leave it out of prompt-time retrieval",
|
|
14086
|
+
"required": false,
|
|
14087
|
+
"valueHint": null
|
|
14088
|
+
},
|
|
14089
|
+
{
|
|
14090
|
+
"flags": "--source <text>",
|
|
14091
|
+
"description": "Who or what made this rule, and when (for example \"twitch:alice 2026-11-10 14:20\")",
|
|
14092
|
+
"required": true,
|
|
14093
|
+
"valueHint": "text"
|
|
14094
|
+
},
|
|
14095
|
+
{
|
|
14096
|
+
"flags": "--supersedes <ids>",
|
|
14097
|
+
"description": "Comma-separated ids of facts this one replaces; marks them superseded (same store)",
|
|
14098
|
+
"required": true,
|
|
14099
|
+
"valueHint": "ids"
|
|
14100
|
+
},
|
|
13890
14101
|
{
|
|
13891
14102
|
"flags": "--project <key>",
|
|
13892
14103
|
"description": "Project key (defaults to the project owning the cwd)",
|
|
@@ -13962,12 +14173,36 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
13962
14173
|
"required": true,
|
|
13963
14174
|
"valueHint": "a,b"
|
|
13964
14175
|
},
|
|
14176
|
+
{
|
|
14177
|
+
"flags": "--source <text>",
|
|
14178
|
+
"description": "Replace who or what made this rule, and when",
|
|
14179
|
+
"required": true,
|
|
14180
|
+
"valueHint": "text"
|
|
14181
|
+
},
|
|
14182
|
+
{
|
|
14183
|
+
"flags": "--supersedes <ids>",
|
|
14184
|
+
"description": "Comma-separated ids of facts this one replaces; marks them superseded (same store)",
|
|
14185
|
+
"required": true,
|
|
14186
|
+
"valueHint": "ids"
|
|
14187
|
+
},
|
|
13965
14188
|
{
|
|
13966
14189
|
"flags": "--clear-review",
|
|
13967
14190
|
"description": "Remove the review marker, re-activating the fact",
|
|
13968
14191
|
"required": false,
|
|
13969
14192
|
"valueHint": null
|
|
13970
14193
|
},
|
|
14194
|
+
{
|
|
14195
|
+
"flags": "--always",
|
|
14196
|
+
"description": "List this fact first in every launch index and leave it out of prompt-time retrieval",
|
|
14197
|
+
"required": false,
|
|
14198
|
+
"valueHint": null
|
|
14199
|
+
},
|
|
14200
|
+
{
|
|
14201
|
+
"flags": "--no-always",
|
|
14202
|
+
"description": "Clear the always flag",
|
|
14203
|
+
"required": false,
|
|
14204
|
+
"valueHint": null
|
|
14205
|
+
},
|
|
13971
14206
|
{
|
|
13972
14207
|
"flags": "--project <key>",
|
|
13973
14208
|
"description": "Project key (defaults to the project owning the cwd)",
|
|
@@ -14035,6 +14270,59 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
14035
14270
|
"aliases": [],
|
|
14036
14271
|
"category": "Observation"
|
|
14037
14272
|
},
|
|
14273
|
+
{
|
|
14274
|
+
"id": "pan-memory-lint",
|
|
14275
|
+
"path": ["memory", "lint"],
|
|
14276
|
+
"display": "/pan memory lint",
|
|
14277
|
+
"description": "Report duplicate, contradicting and badly linked memory facts (advisory; never edits)",
|
|
14278
|
+
"args": [],
|
|
14279
|
+
"options": [
|
|
14280
|
+
{
|
|
14281
|
+
"flags": "--threshold <n>",
|
|
14282
|
+
"description": "Duplicate similarity threshold, 0-1 (default depends on the method)",
|
|
14283
|
+
"required": true,
|
|
14284
|
+
"valueHint": "n"
|
|
14285
|
+
},
|
|
14286
|
+
{
|
|
14287
|
+
"flags": "--no-llm",
|
|
14288
|
+
"description": "Skip the LLM contradiction pass",
|
|
14289
|
+
"required": false,
|
|
14290
|
+
"valueHint": null
|
|
14291
|
+
},
|
|
14292
|
+
{
|
|
14293
|
+
"flags": "--project <key>",
|
|
14294
|
+
"description": "Project key (defaults to the project owning the cwd)",
|
|
14295
|
+
"required": true,
|
|
14296
|
+
"valueHint": "key"
|
|
14297
|
+
},
|
|
14298
|
+
{
|
|
14299
|
+
"flags": "--user",
|
|
14300
|
+
"description": "Lint the operator store (travels with you; synced when set up)",
|
|
14301
|
+
"required": false,
|
|
14302
|
+
"valueHint": null
|
|
14303
|
+
},
|
|
14304
|
+
{
|
|
14305
|
+
"flags": "--machine",
|
|
14306
|
+
"description": "Lint the machine store (this machine only)",
|
|
14307
|
+
"required": false,
|
|
14308
|
+
"valueHint": null
|
|
14309
|
+
},
|
|
14310
|
+
{
|
|
14311
|
+
"flags": "--here",
|
|
14312
|
+
"description": "Lint the cwd checkout's store instead of the primary checkout",
|
|
14313
|
+
"required": false,
|
|
14314
|
+
"valueHint": null
|
|
14315
|
+
},
|
|
14316
|
+
{
|
|
14317
|
+
"flags": "--json",
|
|
14318
|
+
"description": "Output JSON",
|
|
14319
|
+
"required": false,
|
|
14320
|
+
"valueHint": null
|
|
14321
|
+
}
|
|
14322
|
+
],
|
|
14323
|
+
"aliases": [],
|
|
14324
|
+
"category": "Observation"
|
|
14325
|
+
},
|
|
14038
14326
|
{
|
|
14039
14327
|
"id": "pan-memory-sync",
|
|
14040
14328
|
"path": ["memory", "sync"],
|
|
@@ -14064,6 +14352,26 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
14064
14352
|
"aliases": [],
|
|
14065
14353
|
"category": "Observation"
|
|
14066
14354
|
},
|
|
14355
|
+
{
|
|
14356
|
+
"id": "pan-memory-reindex",
|
|
14357
|
+
"path": ["memory", "reindex"],
|
|
14358
|
+
"display": "/pan memory reindex",
|
|
14359
|
+
"description": "Refresh the fact vector cache for the project, operator and machine stores",
|
|
14360
|
+
"args": [],
|
|
14361
|
+
"options": [{
|
|
14362
|
+
"flags": "--project <key>",
|
|
14363
|
+
"description": "Project key (defaults to the project owning the cwd)",
|
|
14364
|
+
"required": true,
|
|
14365
|
+
"valueHint": "key"
|
|
14366
|
+
}, {
|
|
14367
|
+
"flags": "--json",
|
|
14368
|
+
"description": "Output JSON",
|
|
14369
|
+
"required": false,
|
|
14370
|
+
"valueHint": null
|
|
14371
|
+
}],
|
|
14372
|
+
"aliases": [],
|
|
14373
|
+
"category": "Observation"
|
|
14374
|
+
},
|
|
14067
14375
|
{
|
|
14068
14376
|
"id": "pan-briefing",
|
|
14069
14377
|
"path": ["briefing"],
|
|
@@ -16572,6 +16880,18 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
16572
16880
|
"description": "Skip Ollama local-model detection and optional gemma4:12b pull",
|
|
16573
16881
|
"required": false,
|
|
16574
16882
|
"valueHint": null
|
|
16883
|
+
},
|
|
16884
|
+
{
|
|
16885
|
+
"flags": "--file-manager-integration",
|
|
16886
|
+
"description": "Add \"Open in Overdeck\" to the file manager's right-click menu without asking",
|
|
16887
|
+
"required": false,
|
|
16888
|
+
"valueHint": null
|
|
16889
|
+
},
|
|
16890
|
+
{
|
|
16891
|
+
"flags": "--skip-file-manager-integration",
|
|
16892
|
+
"description": "Neither ask about nor add the file-manager integration",
|
|
16893
|
+
"required": false,
|
|
16894
|
+
"valueHint": null
|
|
16575
16895
|
}
|
|
16576
16896
|
],
|
|
16577
16897
|
"aliases": [],
|
|
@@ -18165,6 +18485,53 @@ const COMPOSER_COMMAND_MANIFEST = [
|
|
|
18165
18485
|
"aliases": [],
|
|
18166
18486
|
"category": "Core"
|
|
18167
18487
|
},
|
|
18488
|
+
{
|
|
18489
|
+
"id": "pan-shutdown",
|
|
18490
|
+
"path": ["shutdown"],
|
|
18491
|
+
"display": "/pan shutdown",
|
|
18492
|
+
"description": "Drain Overdeck safely: let each agent finish its current tool call, stop everything, then report safe to reboot",
|
|
18493
|
+
"args": [],
|
|
18494
|
+
"options": [
|
|
18495
|
+
{
|
|
18496
|
+
"flags": "--deadline <seconds>",
|
|
18497
|
+
"description": "Seconds before stragglers are listed (default 120, 10–3600)",
|
|
18498
|
+
"required": true,
|
|
18499
|
+
"valueHint": "seconds"
|
|
18500
|
+
},
|
|
18501
|
+
{
|
|
18502
|
+
"flags": "--reboot",
|
|
18503
|
+
"description": "Reboot the machine when the drain completes (Linux)",
|
|
18504
|
+
"required": false,
|
|
18505
|
+
"valueHint": null
|
|
18506
|
+
},
|
|
18507
|
+
{
|
|
18508
|
+
"flags": "--force",
|
|
18509
|
+
"description": "At the deadline, stop stragglers mid-tool (on a running drain: stop them now)",
|
|
18510
|
+
"required": false,
|
|
18511
|
+
"valueHint": null
|
|
18512
|
+
},
|
|
18513
|
+
{
|
|
18514
|
+
"flags": "--cancel",
|
|
18515
|
+
"description": "Cancel a running drain; stopped sessions are offered for resume",
|
|
18516
|
+
"required": false,
|
|
18517
|
+
"valueHint": null
|
|
18518
|
+
},
|
|
18519
|
+
{
|
|
18520
|
+
"flags": "--status",
|
|
18521
|
+
"description": "Print the current drain and exit",
|
|
18522
|
+
"required": false,
|
|
18523
|
+
"valueHint": null
|
|
18524
|
+
},
|
|
18525
|
+
{
|
|
18526
|
+
"flags": "--no-wait",
|
|
18527
|
+
"description": "Start the drain and exit without following it",
|
|
18528
|
+
"required": false,
|
|
18529
|
+
"valueHint": null
|
|
18530
|
+
}
|
|
18531
|
+
],
|
|
18532
|
+
"aliases": [],
|
|
18533
|
+
"category": "Core"
|
|
18534
|
+
},
|
|
18168
18535
|
{
|
|
18169
18536
|
"id": "pan-project",
|
|
18170
18537
|
"path": ["project"],
|
|
@@ -20820,6 +21187,76 @@ function presetToCron(preset) {
|
|
|
20820
21187
|
}
|
|
20821
21188
|
}
|
|
20822
21189
|
//#endregion
|
|
21190
|
+
//#region src/path-root.ts
|
|
21191
|
+
function trimSlash(path) {
|
|
21192
|
+
return path.length > 1 ? path.replace(/\/+$/, "") : path;
|
|
21193
|
+
}
|
|
21194
|
+
function isAtOrUnder(path, base) {
|
|
21195
|
+
return path === base || path.startsWith(`${base}/`);
|
|
21196
|
+
}
|
|
21197
|
+
/** The longest project path at or above `path`, or null. */
|
|
21198
|
+
function owningProject(path, projects) {
|
|
21199
|
+
let best = null;
|
|
21200
|
+
for (const project of projects) {
|
|
21201
|
+
const base = trimSlash(project.path);
|
|
21202
|
+
if (isAtOrUnder(path, base) && (!best || base.length > best.length)) best = {
|
|
21203
|
+
project,
|
|
21204
|
+
length: base.length
|
|
21205
|
+
};
|
|
21206
|
+
}
|
|
21207
|
+
return best?.project ?? null;
|
|
21208
|
+
}
|
|
21209
|
+
/**
|
|
21210
|
+
* Map an absolute path to its explorer root, first match wins:
|
|
21211
|
+
* 1. a scratch workspace path containing it (longest first) → `workspace:<id>`;
|
|
21212
|
+
* 2. `<projectPath>/workspaces/feature-<x>/…` → `issue:<X>`;
|
|
21213
|
+
* 3. any other folder under `<projectPath>/workspaces/` → `no-root`;
|
|
21214
|
+
* 4. the longest project path containing it → `project:<key>`;
|
|
21215
|
+
* 5. otherwise `outside`.
|
|
21216
|
+
*/
|
|
21217
|
+
function resolvePathRoot(absPath, projects, scratch) {
|
|
21218
|
+
const path = trimSlash(absPath);
|
|
21219
|
+
let bestScratch = null;
|
|
21220
|
+
for (const row of scratch) {
|
|
21221
|
+
const base = trimSlash(row.path);
|
|
21222
|
+
if (isAtOrUnder(path, base) && (!bestScratch || base.length > bestScratch.length)) bestScratch = {
|
|
21223
|
+
row,
|
|
21224
|
+
length: base.length
|
|
21225
|
+
};
|
|
21226
|
+
}
|
|
21227
|
+
if (bestScratch) return {
|
|
21228
|
+
kind: "root",
|
|
21229
|
+
projectKey: owningProject(path, projects)?.key ?? "",
|
|
21230
|
+
rootId: `workspace:${bestScratch.row.id}`
|
|
21231
|
+
};
|
|
21232
|
+
let bestWorkspaces = null;
|
|
21233
|
+
for (const project of projects) {
|
|
21234
|
+
const dir = `${trimSlash(project.path)}/workspaces`;
|
|
21235
|
+
if (path.startsWith(`${dir}/`) && (!bestWorkspaces || dir.length > bestWorkspaces.dir.length)) bestWorkspaces = {
|
|
21236
|
+
project,
|
|
21237
|
+
dir
|
|
21238
|
+
};
|
|
21239
|
+
}
|
|
21240
|
+
if (bestWorkspaces) {
|
|
21241
|
+
const first = path.slice(bestWorkspaces.dir.length + 1).split("/")[0] ?? "";
|
|
21242
|
+
const slug = first.startsWith("feature-") ? first.slice(8) : "";
|
|
21243
|
+
return slug ? {
|
|
21244
|
+
kind: "root",
|
|
21245
|
+
projectKey: bestWorkspaces.project.key,
|
|
21246
|
+
rootId: `issue:${slug.toUpperCase()}`
|
|
21247
|
+
} : {
|
|
21248
|
+
kind: "no-root",
|
|
21249
|
+
projectKey: bestWorkspaces.project.key
|
|
21250
|
+
};
|
|
21251
|
+
}
|
|
21252
|
+
const project = owningProject(path, projects);
|
|
21253
|
+
return project ? {
|
|
21254
|
+
kind: "root",
|
|
21255
|
+
projectKey: project.key,
|
|
21256
|
+
rootId: `project:${project.key}`
|
|
21257
|
+
} : { kind: "outside" };
|
|
21258
|
+
}
|
|
21259
|
+
//#endregion
|
|
20823
21260
|
exports.ACP_BEHAVIOR = ACP_BEHAVIOR;
|
|
20824
21261
|
exports.ACP_CAPABILITIES = ACP_CAPABILITIES;
|
|
20825
21262
|
exports.ACTIVITY_COUNT_MAX = ACTIVITY_COUNT_MAX;
|
|
@@ -21380,6 +21817,10 @@ exports.ShadowInferenceUpdateEvent = ShadowInferenceUpdateEvent;
|
|
|
21380
21817
|
exports.SharedChannelReader = SharedChannelReader;
|
|
21381
21818
|
exports.ShellOpenInBrowserRpc = ShellOpenInBrowserRpc;
|
|
21382
21819
|
exports.ShellOpenInEditorRpc = ShellOpenInEditorRpc;
|
|
21820
|
+
exports.ShutdownPendingSession = ShutdownPendingSession;
|
|
21821
|
+
exports.ShutdownPhase = ShutdownPhase;
|
|
21822
|
+
exports.ShutdownSnapshot = ShutdownSnapshot;
|
|
21823
|
+
exports.ShutdownWriter = ShutdownWriter;
|
|
21383
21824
|
exports.SpecialistCompletedEvent = SpecialistCompletedEvent;
|
|
21384
21825
|
exports.SpecialistFailedEvent = SpecialistFailedEvent;
|
|
21385
21826
|
exports.SpecialistLifecycle = SpecialistLifecycle;
|
|
@@ -21399,6 +21840,7 @@ exports.SubscribeDomainEventsRpc = SubscribeDomainEventsRpc;
|
|
|
21399
21840
|
exports.SubscribeIssueEventsRpc = SubscribeIssueEventsRpc;
|
|
21400
21841
|
exports.SubscribeProjectSessionTreeRpc = SubscribeProjectSessionTreeRpc;
|
|
21401
21842
|
exports.SubscribeTerminalRpc = SubscribeTerminalRpc;
|
|
21843
|
+
exports.SubscribeUiCommandsRpc = SubscribeUiCommandsRpc;
|
|
21402
21844
|
exports.SubstrateBugFiledEvent = SubstrateBugFiledEvent;
|
|
21403
21845
|
exports.SweepEscalatedEvent = SweepEscalatedEvent;
|
|
21404
21846
|
exports.SweepRecommendationEvent = SweepRecommendationEvent;
|
|
@@ -21407,6 +21849,7 @@ exports.SystemHealthConsumer = SystemHealthConsumer;
|
|
|
21407
21849
|
exports.SystemHealthSeverityChangedEvent = SystemHealthSeverityChangedEvent;
|
|
21408
21850
|
exports.SystemHealthSnapshot = SystemHealthSnapshot;
|
|
21409
21851
|
exports.SystemHeartbeatEvent = SystemHeartbeatEvent;
|
|
21852
|
+
exports.SystemShutdownChangedEvent = SystemShutdownChangedEvent;
|
|
21410
21853
|
exports.TELEMETRY_CLI_VERBS = TELEMETRY_CLI_VERBS;
|
|
21411
21854
|
exports.TELEMETRY_EVENT_CATALOG = TELEMETRY_EVENT_CATALOG;
|
|
21412
21855
|
exports.TELEMETRY_EVENT_NAMES = TELEMETRY_EVENT_NAMES;
|
|
@@ -21427,6 +21870,8 @@ exports.TickMarkerPhase = TickMarkerPhase;
|
|
|
21427
21870
|
exports.TurnDiffFileChange = TurnDiffFileChange;
|
|
21428
21871
|
exports.TurnDiffSummary = TurnDiffSummary;
|
|
21429
21872
|
exports.TurnEndAssessment = TurnEndAssessment;
|
|
21873
|
+
exports.UiCommand = UiCommand;
|
|
21874
|
+
exports.UiOpenResolution = UiOpenResolution;
|
|
21430
21875
|
exports.WINDOW_PINNED_OPEN_TOOLS_MAX = WINDOW_PINNED_OPEN_TOOLS_MAX;
|
|
21431
21876
|
exports.WIRED_HOOK_INVENTORY = WIRED_HOOK_INVENTORY;
|
|
21432
21877
|
exports.WIRED_HOOK_NAMES = WIRED_HOOK_NAMES;
|
|
@@ -21516,11 +21961,13 @@ exports.parseTrackerIssueUrl = parseTrackerIssueUrl;
|
|
|
21516
21961
|
exports.phoneIssueSheetPath = phoneIssueSheetPath;
|
|
21517
21962
|
exports.presenceForPaneState = presenceForPaneState;
|
|
21518
21963
|
exports.presetToCron = presetToCron;
|
|
21964
|
+
exports.projectDeckKey = projectDeckKey;
|
|
21519
21965
|
exports.projectLegacySystemHealthSummary = projectLegacySystemHealthSummary;
|
|
21520
21966
|
exports.readDraftPayload = readDraftPayload;
|
|
21521
21967
|
exports.readableForeground = readableForeground;
|
|
21522
21968
|
exports.repoFromRemoteUrl = repoFromRemoteUrl;
|
|
21523
21969
|
exports.resolveEffectivePullRequest = resolveEffectivePullRequest;
|
|
21970
|
+
exports.resolvePathRoot = resolvePathRoot;
|
|
21524
21971
|
exports.resolveTrackerIssueId = resolveTrackerIssueId;
|
|
21525
21972
|
exports.sharedPromptRefusal = sharedPromptRefusal;
|
|
21526
21973
|
exports.shippedCardCount = shippedCardCount;
|
|
@@ -21533,4 +21980,5 @@ exports.toOpaqueHex = toOpaqueHex;
|
|
|
21533
21980
|
exports.toSharedMessage = toSharedMessage;
|
|
21534
21981
|
exports.trimMemoryObservations = trimMemoryObservations;
|
|
21535
21982
|
exports.trimTurnDiffSummaries = trimTurnDiffSummaries;
|
|
21983
|
+
exports.uiOpenSummary = uiOpenSummary;
|
|
21536
21984
|
exports.withPaneLivenessAlias = withPaneLivenessAlias;
|