@overdeck/contracts 0.50.1 → 0.50.3

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 CHANGED
@@ -117,7 +117,9 @@ const KNOWN_HARNESSES = new Set([
117
117
  "ohmypi",
118
118
  "codex",
119
119
  "acp",
120
- "kimi-code"
120
+ "kimi-code",
121
+ "opencode",
122
+ "muse"
121
123
  ]);
122
124
  /**
123
125
  * Normalize a snapshot's runtime field to a known Harness value.
@@ -2148,6 +2150,19 @@ const IssuesSnapshotEvent = effect.Schema.Struct({
2148
2150
  timestamp: effect.Schema.String,
2149
2151
  payload: effect.Schema.Struct({ issues: effect.Schema.Array(effect.Schema.Unknown) })
2150
2152
  });
2153
+ /** Complete changed rows since the initial snapshot; preserves tracker ordering. */
2154
+ const IssuesDeltaEvent = effect.Schema.Struct({
2155
+ type: effect.Schema.Literal("issues.delta"),
2156
+ sequence: SequenceNumber,
2157
+ timestamp: effect.Schema.String,
2158
+ payload: effect.Schema.Struct({
2159
+ length: effect.Schema.Number,
2160
+ changes: effect.Schema.Array(effect.Schema.Struct({
2161
+ index: effect.Schema.Number,
2162
+ issue: effect.Schema.Unknown
2163
+ }))
2164
+ })
2165
+ });
2151
2166
  /** Replaces socket.io `issues:updated` */
2152
2167
  const IssuesUpdatedEvent = effect.Schema.Struct({
2153
2168
  type: effect.Schema.Literal("issues.updated"),
@@ -2645,6 +2660,7 @@ const DomainEvent = effect.Schema.Union([
2645
2660
  ResourcesUpdatedEvent,
2646
2661
  SystemHealthSeverityChangedEvent,
2647
2662
  IssuesSnapshotEvent,
2663
+ IssuesDeltaEvent,
2648
2664
  IssuesUpdatedEvent,
2649
2665
  IssueStatusChangedEvent,
2650
2666
  ActivityUpdatedEvent,
@@ -2855,7 +2871,9 @@ const FlywheelHarness = effect.Schema.Literals([
2855
2871
  "ohmypi",
2856
2872
  "codex",
2857
2873
  "acp",
2858
- "kimi-code"
2874
+ "kimi-code",
2875
+ "opencode",
2876
+ "muse"
2859
2877
  ]);
2860
2878
  const FlywheelEffort = effect.Schema.Literals([
2861
2879
  "low",
@@ -3180,6 +3198,11 @@ const ConversationEvent = effect.Schema.Union([
3180
3198
  workLog: effect.Schema.Array(WorkLogEntry),
3181
3199
  streaming: effect.Schema.Boolean,
3182
3200
  snapshot: effect.Schema.optional(effect.Schema.Boolean),
3201
+ /** Confirmed transcript replacement/truncation; replace even a shorter cached history. */
3202
+ reset: effect.Schema.optional(effect.Schema.Boolean),
3203
+ /** Metadata represents the whole parsed state, including absent plans/boundaries. */
3204
+ metadataSnapshot: effect.Schema.optional(effect.Schema.Boolean),
3205
+ totalCost: effect.Schema.optional(effect.Schema.Number),
3183
3206
  proposedPlan: effect.Schema.optional(ProposedPlan),
3184
3207
  compactBoundaries: effect.Schema.optional(effect.Schema.Array(CompactBoundary)),
3185
3208
  contextUsage: effect.Schema.optional(effect.Schema.NullOr(ContextUsage))
@@ -3620,6 +3643,24 @@ const GetConversationStatsRpc = effect_unstable_rpc_Rpc.make(WS_METHODS.getConve
3620
3643
  /** All Overdeck WebSocket RPC methods */
3621
3644
  const PanRpcGroup = effect_unstable_rpc_RpcGroup.make(SubscribeDomainEventsRpc, SubscribeIssueEventsRpc, SubscribeTerminalRpc, SubscribeAgentOutputRpc, GetSnapshotRpc, ReplayEventsRpc, GetWorkspaceDetailRpc, ReadWorkspaceFileRpc, ReadFileAtPathRpc, WriteFileAtPathRpc, ResolveFilePathExistsRpc, TerminalOpenRpc, TerminalWriteRpc, TerminalResizeRpc, TerminalCloseRpc, StartPlanningRpc, StartAgentRpc, DeepWipeRpc, SendTerminalInputRpc, ResizeTerminalRpc, SubscribeConversationMessagesRpc, SubscribeProjectSessionTreeRpc, SubscribeFlywheelStatusRpc, ShellOpenInEditorRpc, GetAvailableEditorsRpc, ScanConversationsRpc, SearchConversationsRpc, ListDiscoveredSessionsRpc, ListSessionsFeedRpc, GetSessionsFeedFacetsRpc, GetDiscoveredSessionRpc, EnrichSessionsRpc, EmbedSessionsRpc, GetConversationCostRpc, GetConversationCostByWorkspaceRpc, GetConversationStatsRpc);
3622
3645
  //#endregion
3646
+ //#region src/issue-delta.ts
3647
+ function createIssueDelta(previous, next) {
3648
+ const changes = [];
3649
+ for (let index = 0; index < next.length; index++) if (index >= previous.length || JSON.stringify(previous[index]) !== JSON.stringify(next[index])) changes.push({
3650
+ index,
3651
+ issue: next[index]
3652
+ });
3653
+ return changes.length || previous.length !== next.length ? {
3654
+ length: next.length,
3655
+ changes
3656
+ } : null;
3657
+ }
3658
+ function applyIssueDelta(previous, delta) {
3659
+ const next = previous.slice(0, delta.length);
3660
+ for (const { index, issue } of delta.changes) next[index] = issue;
3661
+ return next;
3662
+ }
3663
+ //#endregion
3623
3664
  //#region src/event-reducers.ts
3624
3665
  const INITIAL_READ_MODEL_STATE = {
3625
3666
  sequence: 0,
@@ -4224,6 +4265,11 @@ function applyEvent(state, event) {
4224
4265
  ...state,
4225
4266
  sequence: Math.max(state.sequence, event.sequence)
4226
4267
  };
4268
+ case "issues.delta": return {
4269
+ ...state,
4270
+ sequence: Math.max(state.sequence, event.sequence),
4271
+ issuesRaw: applyIssueDelta(state.issuesRaw, event.payload)
4272
+ };
4227
4273
  case "issue.statusChanged": {
4228
4274
  const { issueId, status, canonicalStatus, labels } = event.payload;
4229
4275
  const updatedIssues = state.issuesRaw.map((issue) => {
@@ -5178,7 +5224,9 @@ const CONTEXT_PREVIEW_HARNESSES = [
5178
5224
  "ohmypi",
5179
5225
  "codex",
5180
5226
  "acp",
5181
- "kimi-code"
5227
+ "kimi-code",
5228
+ "opencode",
5229
+ "muse"
5182
5230
  ];
5183
5231
  const ContextLayerKind = effect.Schema.Literals(CONTEXT_LAYER_KINDS);
5184
5232
  const ContextPreviewHarness = effect.Schema.Literals(CONTEXT_PREVIEW_HARNESSES);
@@ -5248,11 +5296,7 @@ const ContextLayerDraft = effect.Schema.Struct({
5248
5296
  content: effect.Schema.String
5249
5297
  });
5250
5298
  /**
5251
- * A rendered output file `pan sync` writes a Overdeck-managed region into
5252
- * (e.g. ~/.claude/CLAUDE.md, a project's CLAUDE.md or AGENTS.md). Distinct from
5253
- * the editable *layer source* files — this describes the injection *target* so
5254
- * the dashboard can show the user exactly where context lands and reassure them
5255
- * their own content is preserved.
5299
+ * An Overdeck-owned rendered artifact delivered only to managed sessions.
5256
5300
  */
5257
5301
  const ContextSyncTarget = effect.Schema.Struct({
5258
5302
  harness: ContextPreviewHarness,
@@ -5263,17 +5307,20 @@ const ContextSyncTarget = effect.Schema.Struct({
5263
5307
  /** Resolved absolute path of the target file. */
5264
5308
  path: effect.Schema.String,
5265
5309
  exists: effect.Schema.Boolean,
5266
- /** True when the file already contains a Overdeck-managed region. */
5267
- hasManagedRegion: effect.Schema.Boolean,
5268
- /** True when the file has hand-authored content outside the managed region. */
5269
- hasUserContent: effect.Schema.Boolean
5310
+ deliveryChannel: effect.Schema.Literals([
5311
+ "claude-append-system-prompt",
5312
+ "pi-append-system-prompt",
5313
+ "codex-developer-instructions"
5314
+ ]),
5315
+ byteCount: effect.Schema.Number,
5316
+ sha256: effect.Schema.optional(effect.Schema.String)
5270
5317
  });
5271
5318
  const ContextLayersResponse = effect.Schema.Struct({
5272
5319
  operation: effect.Schema.Literal("load"),
5273
5320
  projects: effect.Schema.Array(ContextProjectSummary),
5274
5321
  workspaces: effect.Schema.Array(ContextWorkspaceSummary),
5275
5322
  layers: effect.Schema.Array(ContextEditableLayerRecord),
5276
- /** Injection targets `pan sync` writes managed regions into. */
5323
+ /** Overdeck-owned artifacts delivered at managed-session launch. */
5277
5324
  targets: effect.Schema.Array(ContextSyncTarget)
5278
5325
  });
5279
5326
  const ContextPreviewRequest = effect.Schema.Struct({
@@ -5287,6 +5334,8 @@ const ContextHarnessPreviews = effect.Schema.Struct({
5287
5334
  codex: effect.Schema.String,
5288
5335
  acp: effect.Schema.String,
5289
5336
  "kimi-code": effect.Schema.String,
5337
+ opencode: effect.Schema.optional(effect.Schema.String),
5338
+ muse: effect.Schema.String,
5290
5339
  fullPrompt: effect.Schema.String
5291
5340
  });
5292
5341
  const ContextPreviewDiagnostic = effect.Schema.Struct({
@@ -5343,6 +5392,8 @@ const ArtifactAgentHarness = effect.Schema.Literals([
5343
5392
  "codex",
5344
5393
  "acp",
5345
5394
  "kimi-code",
5395
+ "opencode",
5396
+ "muse",
5346
5397
  "user"
5347
5398
  ]);
5348
5399
  const ArtifactLifecycleState = effect.Schema.Literals([
@@ -5598,18 +5649,51 @@ const KIMI_CODE_BEHAVIOR = {
5598
5649
  workAgentMode: "kimi-code-tui",
5599
5650
  readyTimeoutSeconds: 60
5600
5651
  };
5652
+ const OPENCODE_BEHAVIOR = {
5653
+ ...ACP_BEHAVIOR,
5654
+ displayName: "OpenCode",
5655
+ contextLayerKind: "opencode",
5656
+ executableName: "opencode",
5657
+ processNames: ["acp-host", "opencode"]
5658
+ };
5659
+ const MUSE_BEHAVIOR = {
5660
+ displayName: "Muse Code",
5661
+ nativeCommands: [],
5662
+ executableName: "muse",
5663
+ processNames: ["muse", "muse-bin"],
5664
+ launchCommandKind: "muse-tui",
5665
+ deliveryKind: "pty-supervisor",
5666
+ readinessKind: "muse-tui-prompt",
5667
+ transcriptKind: "muse-jsonl",
5668
+ sessionIdSource: "muse-session-log",
5669
+ contextLayerKind: "muse",
5670
+ feedKind: "muse",
5671
+ supportsPtySupervisor: true,
5672
+ supportsChannelsBridge: false,
5673
+ supportsConversationStreaming: true,
5674
+ supportsPatchProjection: false,
5675
+ usesRpcFifo: false,
5676
+ usesCodexHome: false,
5677
+ injectsPromptTimeMemory: false,
5678
+ workAgentMode: "muse-tui",
5679
+ readyTimeoutSeconds: 60
5680
+ };
5601
5681
  const BEHAVIORS = {
5682
+ "opencode": OPENCODE_BEHAVIOR,
5602
5683
  "claude-code": CLAUDE_CODE_BEHAVIOR,
5603
5684
  ohmypi: OHMYPI_BEHAVIOR,
5604
5685
  codex: CODEX_BEHAVIOR,
5605
5686
  acp: ACP_BEHAVIOR,
5606
- "kimi-code": KIMI_CODE_BEHAVIOR
5687
+ "kimi-code": KIMI_CODE_BEHAVIOR,
5688
+ muse: MUSE_BEHAVIOR
5607
5689
  };
5608
5690
  function getHarnessBehavior(harness) {
5609
5691
  if (harness === "ohmypi" || harness === "pi") return OHMYPI_BEHAVIOR;
5610
5692
  if (harness === "codex") return CODEX_BEHAVIOR;
5693
+ if (harness === "opencode") return OPENCODE_BEHAVIOR;
5611
5694
  if (harness === "acp") return ACP_BEHAVIOR;
5612
5695
  if (harness === "kimi-code") return KIMI_CODE_BEHAVIOR;
5696
+ if (harness === "muse") return MUSE_BEHAVIOR;
5613
5697
  return CLAUDE_CODE_BEHAVIOR;
5614
5698
  }
5615
5699
  function getRuntimeBehavior(runtime) {
@@ -5845,7 +5929,9 @@ const TELEMETRY_PROPERTY_DOMAINS = {
5845
5929
  "ohmypi",
5846
5930
  "codex",
5847
5931
  "acp",
5848
- "kimi-code"
5932
+ "kimi-code",
5933
+ "opencode",
5934
+ "muse"
5849
5935
  ],
5850
5936
  merge_kind: ["pipeline"],
5851
5937
  model_family: [
@@ -5927,7 +6013,7 @@ const COMPOSER_COMMAND_MANIFEST = [
5927
6013
  "id": "pan-sync",
5928
6014
  "path": ["sync"],
5929
6015
  "display": "/pan sync",
5930
- "description": "Sync skills/agents to ~/.claude/ and render the context layers",
6016
+ "description": "Sync skills and render managed launch context",
5931
6017
  "args": [],
5932
6018
  "options": [
5933
6019
  {
@@ -6013,7 +6099,7 @@ const COMPOSER_COMMAND_MANIFEST = [
6013
6099
  "id": "pan-context-sync",
6014
6100
  "path": ["context", "sync"],
6015
6101
  "display": "/pan context sync",
6016
- "description": "Render the context layers into harness CLAUDE.md files",
6102
+ "description": "Refresh Overdeck-managed session context artifacts",
6017
6103
  "args": [],
6018
6104
  "options": [],
6019
6105
  "aliases": [],
@@ -6059,6 +6145,26 @@ const COMPOSER_COMMAND_MANIFEST = [
6059
6145
  "aliases": [],
6060
6146
  "category": "Data"
6061
6147
  },
6148
+ {
6149
+ "id": "pan-context-detach",
6150
+ "path": ["context", "detach"],
6151
+ "display": "/pan context detach",
6152
+ "description": "Explicitly remove historical Overdeck managed regions from native instruction files",
6153
+ "args": [],
6154
+ "options": [{
6155
+ "flags": "--dry-run",
6156
+ "description": "Preview exact files and managed blocks without changing anything",
6157
+ "required": false,
6158
+ "valueHint": null
6159
+ }, {
6160
+ "flags": "--apply",
6161
+ "description": "Back up each file and remove only an unambiguous managed block",
6162
+ "required": false,
6163
+ "valueHint": null
6164
+ }],
6165
+ "aliases": [],
6166
+ "category": "Data"
6167
+ },
6062
6168
  {
6063
6169
  "id": "pan-restore",
6064
6170
  "path": ["restore"],
@@ -6488,7 +6594,7 @@ const COMPOSER_COMMAND_MANIFEST = [
6488
6594
  },
6489
6595
  {
6490
6596
  "flags": "--harness <harness>",
6491
- "description": "Coding-agent harness: claude-code | pi | codex | acp | kimi-code (defaults to role/provider settings)",
6597
+ "description": "Coding-agent harness: claude-code | pi | codex | acp | kimi-code | opencode | muse (defaults to role/provider settings)",
6492
6598
  "required": true,
6493
6599
  "valueHint": "harness"
6494
6600
  },
@@ -7223,7 +7329,7 @@ const COMPOSER_COMMAND_MANIFEST = [
7223
7329
  },
7224
7330
  {
7225
7331
  "flags": "--harness <harness>",
7226
- "description": "Coding-agent harness: claude-code | pi | codex | acp | kimi-code (defaults to role/provider settings)",
7332
+ "description": "Coding-agent harness: claude-code | pi | codex | acp | kimi-code | opencode | muse (defaults to role/provider settings)",
7227
7333
  "required": true,
7228
7334
  "valueHint": "harness"
7229
7335
  },
@@ -7340,7 +7446,7 @@ const COMPOSER_COMMAND_MANIFEST = [
7340
7446
  },
7341
7447
  {
7342
7448
  "flags": "--harness <harness>",
7343
- "description": "Coding-agent harness: claude-code | pi | codex | acp | kimi-code (defaults to role/provider settings)",
7449
+ "description": "Coding-agent harness: claude-code | pi | codex | acp | kimi-code | opencode | muse (defaults to role/provider settings)",
7344
7450
  "required": true,
7345
7451
  "valueHint": "harness"
7346
7452
  },
@@ -12122,7 +12228,7 @@ const COMPOSER_COMMAND_MANIFEST = [
12122
12228
  },
12123
12229
  {
12124
12230
  "flags": "--agent-harness <harness>",
12125
- "description": "Agent harness: claude-code, pi, ohmypi, codex, acp, kimi-code, or user",
12231
+ "description": "Agent harness: claude-code, pi, ohmypi, codex, acp, kimi-code, opencode, muse, or user",
12126
12232
  "required": true,
12127
12233
  "valueHint": "harness"
12128
12234
  },
@@ -13568,6 +13674,7 @@ exports.INITIAL_READ_MODEL_STATE = INITIAL_READ_MODEL_STATE;
13568
13674
  exports.IssueId = IssueId;
13569
13675
  exports.IssueStatusChangedEvent = IssueStatusChangedEvent;
13570
13676
  exports.IssueTransitionedEvent = IssueTransitionedEvent;
13677
+ exports.IssuesDeltaEvent = IssuesDeltaEvent;
13571
13678
  exports.IssuesSnapshotEvent = IssuesSnapshotEvent;
13572
13679
  exports.IssuesUpdatedEvent = IssuesUpdatedEvent;
13573
13680
  exports.KIMI_CODE_BEHAVIOR = KIMI_CODE_BEHAVIOR;
@@ -13585,6 +13692,7 @@ exports.MAX_CHANNEL_REPLY_ARTIFACT_REFS = MAX_CHANNEL_REPLY_ARTIFACT_REFS;
13585
13692
  exports.MAX_CHANNEL_REPLY_ARTIFACT_URI_LENGTH = MAX_CHANNEL_REPLY_ARTIFACT_URI_LENGTH;
13586
13693
  exports.MAX_CHANNEL_REPLY_SUMMARY_LENGTH = MAX_CHANNEL_REPLY_SUMMARY_LENGTH;
13587
13694
  exports.MEMBERSHIP_UNAVAILABLE_REASONS = MEMBERSHIP_UNAVAILABLE_REASONS;
13695
+ exports.MUSE_BEHAVIOR = MUSE_BEHAVIOR;
13588
13696
  exports.MemoryAgentRole = MemoryAgentRole;
13589
13697
  exports.MemoryHealthChangedEvent = MemoryHealthChangedEvent;
13590
13698
  exports.MemoryIdentity = MemoryIdentity;
@@ -13601,6 +13709,7 @@ exports.MergeStatusValue = MergeStatusValue;
13601
13709
  exports.ModelOrigin = ModelOrigin;
13602
13710
  exports.ModelOriginEntry = ModelOriginEntry;
13603
13711
  exports.OHMYPI_BEHAVIOR = OHMYPI_BEHAVIOR;
13712
+ exports.OPENCODE_BEHAVIOR = OPENCODE_BEHAVIOR;
13604
13713
  exports.OVERDECK_AGENT_PROTOCOL_VERSION = OVERDECK_AGENT_PROTOCOL_VERSION;
13605
13714
  exports.OVERDECK_DASHBOARD_PROTOCOL_VERSION = OVERDECK_DASHBOARD_PROTOCOL_VERSION;
13606
13715
  exports.OpenInEditorInput = OpenInEditorInput;
@@ -13754,7 +13863,9 @@ exports.WriteFileAtPathResult = WriteFileAtPathResult;
13754
13863
  exports.WriteFileAtPathRpc = WriteFileAtPathRpc;
13755
13864
  exports.applyEvent = applyEvent;
13756
13865
  exports.applyEvents = applyEvents;
13866
+ exports.applyIssueDelta = applyIssueDelta;
13757
13867
  exports.compareIssueIds = compareIssueIds;
13868
+ exports.createIssueDelta = createIssueDelta;
13758
13869
  exports.decodeFlywheelStats = decodeFlywheelStats;
13759
13870
  exports.deriveProjectCi = deriveProjectCi;
13760
13871
  exports.encodeFlywheelStats = encodeFlywheelStats;