@codexhost/cli-darwin-arm64 0.18.0-beta.1 → 0.18.0-beta.4

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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +109 -94
  4. package/app/console-web.js +110 -95
  5. package/app/desktop-controller.mjs +109 -110
  6. package/app/host-runtime.mjs +14225 -10527
  7. package/app/plugins/antigravity/plugin.mjs +109 -94
  8. package/app/plugins/claude-code/plugin.mjs +229 -148
  9. package/app/plugins/codebuddy/plugin.mjs +109 -94
  10. package/app/plugins/codex-usage/plugin.mjs +109 -94
  11. package/app/plugins/copilot/plugin.mjs +109 -94
  12. package/app/plugins/cursor-cli/plugin.mjs +109 -94
  13. package/app/plugins/deepseek-harness/plugin.mjs +109 -94
  14. package/app/plugins/devin/plugin.mjs +109 -94
  15. package/app/plugins/enabled.json +0 -1
  16. package/app/plugins/grok/plugin.mjs +109 -94
  17. package/app/plugins/hermes/plugin.mjs +109 -94
  18. package/app/plugins/kimi-code/plugin.mjs +109 -94
  19. package/app/plugins/kiro-cli/plugin.mjs +109 -94
  20. package/app/plugins/omp/plugin.mjs +109 -94
  21. package/app/plugins/opencode/plugin.mjs +109 -94
  22. package/app/plugins/pi/plugin.mjs +109 -94
  23. package/app/plugins/qoder/plugin.mjs +109 -94
  24. package/app/plugins/qoder-cn/plugin.mjs +109 -94
  25. package/app/plugins/qwen-code/plugin.mjs +109 -94
  26. package/app/plugins/workbuddy/plugin.mjs +109 -94
  27. package/app/plugins/zcode/plugin.mjs +109 -94
  28. package/app/renderer-extension.js +128 -150
  29. package/app/web/assets/index-C3lniEH1.css +1 -0
  30. package/app/web/assets/index-D1dOzBMI.js +199 -0
  31. package/app/web/codexhost-settings.js +110 -95
  32. package/app/web/index.html +2 -2
  33. package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +1 -1
  34. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +64 -64
  35. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
  36. package/app/web/plugins/deepseek-ai__dsh-client-connection/client.js +1 -1
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +2 -2
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +57 -56
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +87 -87
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-directory-picker-browse/client.js +10 -10
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +3 -3
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +2 -2
  44. package/app/web/plugins/deepseek-ai__dsh-client-ui-permission-presets/client.js +1 -1
  45. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings/client.js +1 -1
  46. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +2 -2
  47. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +2 -2
  48. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +55 -55
  49. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  50. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -12
  51. package/app/web/plugins.json +4 -0
  52. package/app/web/sw.js +55 -24
  53. package/app/web-modules/server.mjs +1415 -784
  54. package/bin/codexhost +0 -0
  55. package/libexec/codexhost-shim +0 -0
  56. package/libexec/codexhost-updater +0 -0
  57. package/package.json +1 -1
  58. package/app/plugins/codex-cli/manifest.json +0 -16
  59. package/app/plugins/codex-cli/plugin.mjs +0 -20374
  60. package/app/web/assets/index-CIeTchMu.css +0 -1
  61. package/app/web/assets/index-DeAPBQbV.js +0 -199
  62. /package/app/{plugins/codex-cli/assets/icon.png → web/codex.png} +0 -0
@@ -14622,7 +14622,7 @@ var HARNESS_PERMISSION_MODE_CATALOG_MAX_LENGTH = 32;
14622
14622
  var nonBlankTextSchema = external_exports.string().refine((value) => value.trim().length > 0, {
14623
14623
  message: "Value must not be empty or whitespace"
14624
14624
  });
14625
- var harnessPermissionModeIdSchema = nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~-]+$/u, "Permission Mode ID must use transport-safe characters").brand();
14625
+ var harnessPermissionModeIdSchema = nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~:-]+$/u, "Permission Mode ID must use transport-safe characters").brand();
14626
14626
  var harnessPermissionModeSchema = external_exports.object({
14627
14627
  id: harnessPermissionModeIdSchema,
14628
14628
  label: nonBlankTextSchema.max(HARNESS_PERMISSION_MODE_LABEL_MAX_LENGTH),
@@ -15006,7 +15006,12 @@ var threadInspectionParamsSchema = external_exports.object({
15006
15006
  }).strict();
15007
15007
  var codexThreadInspectionSchema = external_exports.object({
15008
15008
  owner: external_exports.literal("codex"),
15009
- locked: external_exports.literal(true),
15009
+ locked: external_exports.boolean(),
15010
+ effectiveModel: harnessModelRefSchema.optional(),
15011
+ resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
15012
+ effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
15013
+ effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
15014
+ history: harnessHistoryCapabilitiesSchema.optional(),
15010
15015
  supportsThreadReferences: external_exports.literal(true).optional()
15011
15016
  }).strict();
15012
15017
  var externalThreadInspectionSchema = external_exports.object({
@@ -15228,7 +15233,8 @@ var clientThreadSnapshotSchema = external_exports.object({
15228
15233
  thread: external_exports.object({
15229
15234
  id: external_exports.string().min(1),
15230
15235
  cwd: external_exports.string(),
15231
- modelProvider: external_exports.literal("codexhost"),
15236
+ /** External rows use codexhost; native Codex rows retain their official provider. */
15237
+ modelProvider: external_exports.string().min(1),
15232
15238
  createdAt: external_exports.number(),
15233
15239
  updatedAt: external_exports.number(),
15234
15240
  status: external_exports.object({ type: external_exports.string() }).passthrough(),
@@ -15242,6 +15248,11 @@ var clientThreadSnapshotSchema = external_exports.object({
15242
15248
  nextCursor: external_exports.string().nullable()
15243
15249
  }),
15244
15250
  configuration: external_exports.object({
15251
+ /** Native Codex model names are not external Harness transport refs. */
15252
+ native: external_exports.object({
15253
+ model: external_exports.string().min(1).max(1024).optional(),
15254
+ reasoningEffort: external_exports.string().min(1).max(128).optional()
15255
+ }).optional(),
15245
15256
  effectiveModel: harnessModelRefSchema.optional(),
15246
15257
  effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
15247
15258
  effectivePermissionModeId: harnessPermissionModeIdSchema.optional()
@@ -15268,6 +15279,21 @@ var clientChannelResponseSchema = external_exports.object({
15268
15279
  result: record2
15269
15280
  });
15270
15281
 
15282
+ // ../../shared-contracts/dist/thread-catalog.js
15283
+ var threadCatalogReadParamsSchema = external_exports.object({
15284
+ includeArchived: external_exports.boolean().optional(),
15285
+ /** Absent means first page; null means this branch is exhausted. Native cursors only. */
15286
+ officialCursor: external_exports.object({ live: external_exports.string().nullable(), archived: external_exports.string().nullable().optional() }).strict().optional()
15287
+ }).strict();
15288
+ var threadCatalogReadResultSchema = external_exports.object({
15289
+ threads: external_exports.array(jsonObjectSchema),
15290
+ ownership: external_exports.array(threadOwnershipSchema),
15291
+ /** Known archived IDs, including visible local external records even when their rows are
15292
+ * excluded. Native archived IDs describe only the returned page, never a complete set. */
15293
+ archivedThreadIds: external_exports.array(hostThreadIdSchema),
15294
+ officialCursor: external_exports.object({ live: external_exports.string().nullable(), archived: external_exports.string().nullable().optional() }).strict().optional()
15295
+ }).strict();
15296
+
15271
15297
  // ../../shared-contracts/dist/voice.js
15272
15298
  var VOICE_AUDIO_MAX_BYTES = 10 * 1024 * 1024;
15273
15299
  var voiceAudioMimeTypeSchema = external_exports.string().regex(/^audio\/[a-z0-9.+-]+(?:\s*;[^\r\n]*)?$/i);
@@ -15480,96 +15506,19 @@ var idleReleaseSettingsSchema = external_exports.strictObject({
15480
15506
  });
15481
15507
  var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
15482
15508
  enabled: false,
15483
- timeoutMinutes: 30
15484
- });
15485
-
15486
- // ../../shared-contracts/dist/harness-plugins.js
15487
- var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
15488
- var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
15489
- var HARNESS_PLUGIN_LIMIT = 128;
15490
- var HARNESS_PLUGIN_SURFACES = ["desktop", "web"];
15491
- var harnessPluginSurfaceSchema = external_exports.enum(HARNESS_PLUGIN_SURFACES);
15492
- var installedHarnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).pipe(harnessIdSchema);
15493
- var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id2) => id2 !== "codex", "The official Codex identity is reserved");
15494
- var relativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
15495
- var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
15496
- var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
15497
- var harnessInstallationGuideSchema = external_exports.object({
15498
- commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
15499
- before: localizedTextSchema.optional(),
15500
- after: localizedTextSchema.optional(),
15501
- downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
15502
- }).strict();
15503
- var pluginPresentationShape = {
15504
- id: installedHarnessPluginIdSchema,
15505
- name: external_exports.string().trim().min(1).max(128),
15506
- version: external_exports.string().min(1).max(128),
15507
- /** Capability-only plugin; omitted for existing session-capable plugins. */
15508
- kind: external_exports.literal("usage").optional(),
15509
- /** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
15510
- iconStyle: external_exports.object({
15511
- vector: external_exports.object({
15512
- viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
15513
- color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
15514
- paths: external_exports.array(external_exports.object({
15515
- d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
15516
- fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
15517
- fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
15518
- }).strict()).min(1).max(32)
15519
- }).strict().optional(),
15520
- background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
15521
- borderRadius: external_exports.number().min(0).max(50).optional(),
15522
- paddingRatio: external_exports.number().min(0).max(0.25).optional()
15523
- }).strict().optional(),
15524
- installation: harnessInstallationGuideSchema.optional(),
15525
- notice: localizedTextSchema.optional(),
15526
- /** The factory accepts a persisted local entrypoint through its construction context. */
15527
- launchCommand: external_exports.literal(true).optional(),
15528
- links: external_exports.object({
15529
- website: documentationUrlSchema.optional(),
15530
- documentation: documentationUrlSchema.optional(),
15531
- installation: documentationUrlSchema.optional()
15532
- }).strict().optional()
15533
- };
15534
- var harnessPluginSurfacesSchema = external_exports.array(harnessPluginSurfaceSchema).min(1).max(HARNESS_PLUGIN_SURFACES.length).refine((surfaces) => new Set(surfaces).size === surfaces.length, {
15535
- message: "Plugin surfaces must be unique"
15536
- });
15537
- var harnessPluginManifestSchema = external_exports.object({
15538
- manifestVersion: external_exports.literal(1),
15539
- ...pluginPresentationShape,
15540
- adapterApiVersion: external_exports.number().int().positive(),
15541
- entry: relativeResourceSchema,
15542
- icon: relativeResourceSchema.optional(),
15543
- /** Omitted means the plugin appears in every surface; never inferred from its identity. */
15544
- surfaces: harnessPluginSurfacesSchema.optional()
15545
- }).strict();
15546
- var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
15547
- var harnessPluginDescriptorSchema = external_exports.object({
15548
- ...pluginPresentationShape,
15549
- icon: harnessPluginIconSchema.optional()
15550
- }).strict();
15551
- var harnessPluginListParamsSchema = external_exports.object({}).strict();
15552
- var harnessPluginListResultSchema = external_exports.object({
15553
- plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
15554
- }).strict();
15555
- var harnessPluginConfigurationSchema = external_exports.object({
15556
- version: external_exports.literal(1),
15557
- enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
15558
- }).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
15559
- message: "Enabled plugin IDs must be unique",
15560
- path: ["enabled"]
15509
+ timeoutMinutes: 10
15561
15510
  });
15562
15511
 
15563
15512
  // ../../shared-contracts/dist/harness-preferences.js
15564
15513
  var harnessPreferenceScopeSchema = external_exports.string().regex(/^external$/u);
15565
- var preferenceHarnessKey = installedHarnessPluginIdSchema.transform((id2) => String(id2));
15514
+ var preferenceHarnessKey = harnessIdSchema.transform((id2) => String(id2));
15566
15515
  var harnessDefaultConfigurationSchema = external_exports.strictObject({
15567
15516
  model: harnessModelRefSchema.optional(),
15568
15517
  thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
15569
15518
  permissionModeId: harnessPermissionModeIdSchema.optional()
15570
15519
  }).refine((value) => Boolean(value.model || value.thinkingOptionId || value.permissionModeId), "A default configuration must contain a preference");
15571
15520
  var newThreadDefaultsSchema = external_exports.strictObject({
15572
- lastHarness: installedHarnessPluginIdSchema.optional(),
15521
+ lastHarness: harnessIdSchema.optional(),
15573
15522
  byHarness: external_exports.record(preferenceHarnessKey, harnessDefaultConfigurationSchema)
15574
15523
  });
15575
15524
  var modelId = external_exports.string().min(1).max(1024);
@@ -15590,19 +15539,19 @@ var harnessPreferenceOperationSchema = external_exports.discriminatedUnion("kind
15590
15539
  external_exports.strictObject({ kind: external_exports.literal("idleRelease"), value: idleReleaseSettingsSchema }),
15591
15540
  external_exports.strictObject({
15592
15541
  kind: external_exports.literal("favorite"),
15593
- harnessId: installedHarnessPluginIdSchema,
15542
+ harnessId: harnessIdSchema,
15594
15543
  modelId,
15595
15544
  enabled: external_exports.boolean()
15596
15545
  }),
15597
15546
  external_exports.strictObject({
15598
15547
  kind: external_exports.literal("favorites"),
15599
- harnessId: installedHarnessPluginIdSchema,
15548
+ harnessId: harnessIdSchema,
15600
15549
  modelIds: external_exports.array(modelId).max(2048)
15601
15550
  }),
15602
15551
  external_exports.strictObject({
15603
15552
  kind: external_exports.literal("newThread"),
15604
- lastHarness: installedHarnessPluginIdSchema.optional(),
15605
- harnessId: installedHarnessPluginIdSchema.optional(),
15553
+ lastHarness: harnessIdSchema.optional(),
15554
+ harnessId: harnessIdSchema.optional(),
15606
15555
  configuration: harnessDefaultConfigurationSchema.optional()
15607
15556
  })
15608
15557
  ]);
@@ -15618,12 +15567,6 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
15618
15567
  code: "custom",
15619
15568
  message: "A default Harness or complete configuration is required"
15620
15569
  });
15621
- const harnessId = "harnessId" in operation ? operation.harnessId : void 0;
15622
- if (harnessId === "codex")
15623
- ctx.addIssue({
15624
- code: "custom",
15625
- message: "Official Codex is not an external Harness"
15626
- });
15627
15570
  }
15628
15571
  });
15629
15572
  var harnessPreferencesDocumentSchema = external_exports.strictObject({
@@ -16000,6 +15943,76 @@ var harnessAccountListResultSchema = external_exports.object({
16000
15943
  accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
16001
15944
  }).strict();
16002
15945
 
15946
+ // ../../shared-contracts/dist/harness-plugins.js
15947
+ var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
15948
+ var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
15949
+ var HARNESS_PLUGIN_LIMIT = 128;
15950
+ var installedHarnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).pipe(harnessIdSchema);
15951
+ var harnessPluginIdSchema = installedHarnessPluginIdSchema.refine((id2) => id2 !== "codex", "The official Codex identity is reserved");
15952
+ var relativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
15953
+ var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
15954
+ var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
15955
+ var harnessInstallationGuideSchema = external_exports.object({
15956
+ commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
15957
+ before: localizedTextSchema.optional(),
15958
+ after: localizedTextSchema.optional(),
15959
+ downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
15960
+ }).strict();
15961
+ var pluginPresentationShape = {
15962
+ id: installedHarnessPluginIdSchema,
15963
+ name: external_exports.string().trim().min(1).max(128),
15964
+ version: external_exports.string().min(1).max(128),
15965
+ /** Capability-only plugin; omitted for existing session-capable plugins. */
15966
+ kind: external_exports.literal("usage").optional(),
15967
+ /** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
15968
+ iconStyle: external_exports.object({
15969
+ vector: external_exports.object({
15970
+ viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
15971
+ color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
15972
+ paths: external_exports.array(external_exports.object({
15973
+ d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
15974
+ fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
15975
+ fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
15976
+ }).strict()).min(1).max(32)
15977
+ }).strict().optional(),
15978
+ background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
15979
+ borderRadius: external_exports.number().min(0).max(50).optional(),
15980
+ paddingRatio: external_exports.number().min(0).max(0.25).optional()
15981
+ }).strict().optional(),
15982
+ installation: harnessInstallationGuideSchema.optional(),
15983
+ notice: localizedTextSchema.optional(),
15984
+ /** The factory accepts a persisted local entrypoint through its construction context. */
15985
+ launchCommand: external_exports.literal(true).optional(),
15986
+ links: external_exports.object({
15987
+ website: documentationUrlSchema.optional(),
15988
+ documentation: documentationUrlSchema.optional(),
15989
+ installation: documentationUrlSchema.optional()
15990
+ }).strict().optional()
15991
+ };
15992
+ var harnessPluginManifestSchema = external_exports.object({
15993
+ manifestVersion: external_exports.literal(1),
15994
+ ...pluginPresentationShape,
15995
+ adapterApiVersion: external_exports.number().int().positive(),
15996
+ entry: relativeResourceSchema,
15997
+ icon: relativeResourceSchema.optional()
15998
+ }).strict();
15999
+ var harnessPluginIconSchema = external_exports.string().max(Math.ceil(HARNESS_PLUGIN_ICON_MAX_BYTES / 3) * 4 + 64).regex(/^data:image\/(?:png|jpeg|webp|svg\+xml);base64,[A-Za-z0-9+/]+={0,2}$/u);
16000
+ var harnessPluginDescriptorSchema = external_exports.object({
16001
+ ...pluginPresentationShape,
16002
+ icon: harnessPluginIconSchema.optional()
16003
+ }).strict();
16004
+ var harnessPluginListParamsSchema = external_exports.object({}).strict();
16005
+ var harnessPluginListResultSchema = external_exports.object({
16006
+ plugins: external_exports.array(harnessPluginDescriptorSchema.extend({ id: harnessPluginIdSchema })).max(HARNESS_PLUGIN_LIMIT)
16007
+ }).strict();
16008
+ var harnessPluginConfigurationSchema = external_exports.object({
16009
+ version: external_exports.literal(1),
16010
+ enabled: external_exports.array(installedHarnessPluginIdSchema).max(HARNESS_PLUGIN_LIMIT)
16011
+ }).strict().refine((value) => new Set(value.enabled).size === value.enabled.length, {
16012
+ message: "Enabled plugin IDs must be unique",
16013
+ path: ["enabled"]
16014
+ });
16015
+
16003
16016
  // ../../shared-contracts/dist/harness-route.js
16004
16017
  var harnessPluginRouteSchema = external_exports.object({
16005
16018
  harnessId: harnessPluginIdSchema,
@@ -16193,6 +16206,8 @@ var harnessCommandDescriptorSchema = external_exports.object({
16193
16206
  }).strict();
16194
16207
  var harnessCommandCatalogSchema = external_exports.object({
16195
16208
  commands: external_exports.array(harnessCommandDescriptorSchema),
16209
+ /** Partial discovery failures; valid commands remain available. */
16210
+ warnings: external_exports.array(external_exports.string().min(1)).optional(),
16196
16211
  /**
16197
16212
  * `live` when the catalog includes what a native Session reports for its
16198
16213
  * workspace (custom commands, skills); `static` for Adapter built-ins only.
@@ -16228,7 +16243,7 @@ var threadCommandExecuteParamsSchema = external_exports.object({
16228
16243
  }).strict();
16229
16244
  var threadCommandExecuteResultSchema = external_exports.object({
16230
16245
  accepted: external_exports.literal(true),
16231
- turnId: hostTurnIdSchema
16246
+ turnId: hostTurnIdSchema.optional()
16232
16247
  }).strict();
16233
16248
 
16234
16249
  // ../../shared-contracts/dist/json-rpc.js
@@ -55951,9 +55966,24 @@ function claudeTranscriptItemId(nativeTurnKey, kind, ordinal) {
55951
55966
  return hostItemIdSchema.parse(`claude-item-v2-${nativeTurnKey}-${kind}-${ordinal}`);
55952
55967
  }
55953
55968
 
55969
+ // dist/claude-queued-command.js
55970
+ function isRecord8(value) {
55971
+ return typeof value === "object" && value !== null && !Array.isArray(value);
55972
+ }
55973
+ function readClaudeQueuedCommand(value, sessionId) {
55974
+ const attachment = value.attachment;
55975
+ if (value.type !== "attachment" || !isRecord8(attachment) || attachment.type !== "queued_command" || attachment.commandMode !== "prompt" || !isRecord8(attachment.origin) || attachment.origin.kind !== "human" || attachment.humanTurn === false || attachment.isMeta === true || attachment.isSynthetic === true || value.isMeta === true || value.isSynthetic === true || value.isSidechain === true || isRecord8(value.origin) && value.origin.kind !== "human" || typeof value.parent_tool_use_id === "string" && value.parent_tool_use_id.length > 0 || value.sessionId !== void 0 && value.sessionId !== sessionId || value.session_id !== sessionId) {
55976
+ return null;
55977
+ }
55978
+ if (typeof value.uuid !== "string" || value.uuid.length === 0 || typeof attachment.source_uuid !== "string" || attachment.source_uuid.length === 0 || typeof attachment.prompt !== "string" || attachment.prompt.length === 0) {
55979
+ throw new Error("Claude queued human input has an invalid identity or text prompt");
55980
+ }
55981
+ return { uuid: value.uuid, sourceUuid: attachment.source_uuid, prompt: attachment.prompt };
55982
+ }
55983
+
55954
55984
  // dist/claude-history.js
55955
55985
  var claudeCodeHarnessId = harnessIdSchema.parse("claude-code");
55956
- function isRecord8(value) {
55986
+ function isRecord9(value) {
55957
55987
  return typeof value === "object" && value !== null && !Array.isArray(value);
55958
55988
  }
55959
55989
  function textParts(value) {
@@ -55961,12 +55991,12 @@ function textParts(value) {
55961
55991
  return value.length > 0 ? [value] : [];
55962
55992
  if (!Array.isArray(value))
55963
55993
  return [];
55964
- return value.flatMap((part) => isRecord8(part) && part.type === "text" && typeof part.text === "string" ? [part.text] : []);
55994
+ return value.flatMap((part) => isRecord9(part) && part.type === "text" && typeof part.text === "string" ? [part.text] : []);
55965
55995
  }
55966
55996
  function thinkingParts(value) {
55967
55997
  if (!Array.isArray(value))
55968
55998
  return [];
55969
- return value.flatMap((part) => isRecord8(part) && part.type === "thinking" && typeof part.thinking === "string" ? [part.thinking] : []);
55999
+ return value.flatMap((part) => isRecord9(part) && part.type === "thinking" && typeof part.thinking === "string" ? [part.thinking] : []);
55970
56000
  }
55971
56001
  var localCommandRecordPattern = /^\s*<(local-command-(?:stdout|caveat))>[\s\S]*<\/\1>\s*$/u;
55972
56002
  var taskNotificationRecordPattern = /^\s*<task-notification>[\s\S]*<\/task-notification>\s*$/u;
@@ -56016,7 +56046,7 @@ function localCommandStdoutText(text2) {
56016
56046
  return match[1] ?? "";
56017
56047
  }
56018
56048
  function isTaskNotificationOrigin(value) {
56019
- return isRecord8(value.origin) && value.origin.kind === "task-notification";
56049
+ return isRecord9(value.origin) && value.origin.kind === "task-notification";
56020
56050
  }
56021
56051
  function visibleUserTextParts(message) {
56022
56052
  if (message.type !== "user" || message.syntheticUser)
@@ -56027,13 +56057,13 @@ function visibleUserTextParts(message) {
56027
56057
  return parts.filter((part) => !isLocalCommandRecord(part) && !isTaskNotificationRecord(part));
56028
56058
  }
56029
56059
  function isInterruptionRecord(value, promptId) {
56030
- if (value.type !== "user" || promptId === null || value.promptId !== promptId || value.promptSource !== void 0 || !isRecord8(value.message))
56060
+ if (value.type !== "user" || promptId === null || value.promptId !== promptId || value.promptSource !== void 0 || !isRecord9(value.message))
56031
56061
  return false;
56032
56062
  const content = value.message.content;
56033
56063
  if (!Array.isArray(content) || content.length !== 1)
56034
56064
  return false;
56035
56065
  const part = content[0];
56036
- return isRecord8(part) && part.type === "text" && (part.text === "[Request interrupted by user]" || part.text === "[Request interrupted by user for tool use]");
56066
+ return isRecord9(part) && part.type === "text" && (part.text === "[Request interrupted by user]" || part.text === "[Request interrupted by user for tool use]");
56037
56067
  }
56038
56068
  function conversationMessages(values, sessionId) {
56039
56069
  const messages = [];
@@ -56044,11 +56074,31 @@ function conversationMessages(values, sessionId) {
56044
56074
  const sends = /* @__PURE__ */ new Map();
56045
56075
  let pendingNotification = false;
56046
56076
  for (const value of values) {
56047
- if (!isRecord8(value))
56077
+ if (!isRecord9(value))
56048
56078
  throw new Error("Claude history contains a malformed message");
56049
56079
  if (value.type === "system")
56050
56080
  continue;
56051
- if (value.type !== "user" && value.type !== "assistant" || typeof value.uuid !== "string" || value.uuid.length === 0 || value.session_id !== sessionId || !isRecord8(value.message) || value.message.role !== value.type) {
56081
+ if (value.type === "attachment") {
56082
+ const queued = readClaudeQueuedCommand(value, sessionId);
56083
+ if (!queued)
56084
+ continue;
56085
+ if (ids.has(queued.uuid))
56086
+ throw new Error("Claude history contains duplicate message IDs");
56087
+ ids.add(queued.uuid);
56088
+ messages.push({
56089
+ type: "steering",
56090
+ uuid: queued.uuid,
56091
+ sourceUuid: queued.sourceUuid,
56092
+ message: { role: "user", content: queued.prompt },
56093
+ failed: false,
56094
+ nested: false,
56095
+ syntheticUser: false,
56096
+ interrupted: false,
56097
+ startsTurn: false
56098
+ });
56099
+ continue;
56100
+ }
56101
+ if (value.type !== "user" && value.type !== "assistant" || typeof value.uuid !== "string" || value.uuid.length === 0 || value.session_id !== sessionId || !isRecord9(value.message) || value.message.role !== value.type) {
56052
56102
  throw new Error("Claude history contains an invalid message identity");
56053
56103
  }
56054
56104
  if (ids.has(value.uuid))
@@ -56064,6 +56114,7 @@ function conversationMessages(values, sessionId) {
56064
56114
  nested: typeof value.parent_tool_use_id === "string" && value.parent_tool_use_id.length > 0,
56065
56115
  interrupted,
56066
56116
  startsTurn: false,
56117
+ ...isRecord9(value.forkedFrom) && typeof value.forkedFrom.messageUuid === "string" ? { forkSourceUuid: value.forkedFrom.messageUuid } : {},
56067
56118
  syntheticUser: value.type === "user" && (interrupted || value.isSynthetic === true || value.isMeta === true || isTaskNotificationOrigin(value) || value.toolUseResult !== void 0 && value.toolUseResult !== null)
56068
56119
  };
56069
56120
  const notification = message.type === "user" && !message.nested && (isTaskNotificationOrigin(value) || textParts(message.message.content).some(isTaskNotificationRecord));
@@ -56110,7 +56161,21 @@ function conversationMessages(values, sessionId) {
56110
56161
  promptId = typeof value.promptId === "string" && value.promptId.length > 0 ? value.promptId : null;
56111
56162
  }
56112
56163
  }
56113
- return messages;
56164
+ const userIds = new Set(messages.flatMap((message) => isHumanUser(message) ? [message.uuid, ...message.forkSourceUuid ? [message.forkSourceUuid] : []] : []));
56165
+ const delivered = /* @__PURE__ */ new Map();
56166
+ return messages.filter((message) => {
56167
+ if (message.type !== "steering")
56168
+ return true;
56169
+ const id2 = message.sourceUuid;
56170
+ if (userIds.has(id2))
56171
+ return false;
56172
+ const prompt = message.message.content;
56173
+ const previous = delivered.get(id2);
56174
+ if (previous !== void 0 && previous !== prompt)
56175
+ throw new Error("Claude queued input UUID refers to different prompts");
56176
+ delivered.set(id2, prompt);
56177
+ return previous === void 0;
56178
+ });
56114
56179
  }
56115
56180
  function isHumanUser(message) {
56116
56181
  return visibleUserTextParts(message).length > 0;
@@ -56162,6 +56227,8 @@ function mapClaudeSnapshot(values, sessionId) {
56162
56227
  for (let index = 0; index < messages.length; ) {
56163
56228
  const user = messages[index];
56164
56229
  if (!user || !user.startsTurn) {
56230
+ if (user?.type === "steering")
56231
+ throw new Error("Claude queued input has no native Turn anchor");
56165
56232
  index += 1;
56166
56233
  continue;
56167
56234
  }
@@ -56171,7 +56238,9 @@ function mapClaudeSnapshot(values, sessionId) {
56171
56238
  const turnMessages = messages.slice(index, end);
56172
56239
  const outcome = turnOutcome(turnMessages);
56173
56240
  const results = toolResultBlocks(turnMessages);
56174
- const checkpointMessage = turnMessages.findLast(({ type, interrupted, nested }) => !nested && (type === "assistant" || interrupted));
56241
+ const checkpointIndex = turnMessages.findLastIndex(({ type, interrupted, nested }) => !nested && (type === "assistant" || interrupted));
56242
+ const lastSteering = turnMessages.findLastIndex(({ type }) => type === "steering");
56243
+ const checkpointMessage = checkpointIndex > lastSteering ? turnMessages[checkpointIndex] : void 0;
56175
56244
  let agentMessageOrdinal = 0;
56176
56245
  let reasoningOrdinal = 0;
56177
56246
  let toolOrdinal = 0;
@@ -56195,6 +56264,18 @@ function mapClaudeSnapshot(values, sessionId) {
56195
56264
  text: displayedUserText(text2)
56196
56265
  })),
56197
56266
  items: turnMessages.flatMap((message) => {
56267
+ if (message.type === "steering") {
56268
+ return [
56269
+ {
56270
+ item: {
56271
+ type: "userMessage",
56272
+ itemId: hostItemIdSchema.parse(message.uuid),
56273
+ input: [{ type: "text", text: message.message.content }]
56274
+ },
56275
+ outcome: { status: "succeeded" }
56276
+ }
56277
+ ];
56278
+ }
56198
56279
  if (message.type === "user") {
56199
56280
  const recapOutput = visibleUserTextParts(user).some((text3) => isNamedCommandEnvelope(text3, recapCommandNamePattern)) ? textParts(message.message.content).map(localCommandStdoutText).find((text3) => text3 !== null && text3.length > 0) : void 0;
56200
56281
  if (!recapOutput)
@@ -56232,7 +56313,7 @@ function mapClaudeSnapshot(values, sessionId) {
56232
56313
  let projectedReasoning = false;
56233
56314
  let projectedText = false;
56234
56315
  for (const [blockIndex, block] of content.entries()) {
56235
- if (!isRecord8(block))
56316
+ if (!isRecord9(block))
56236
56317
  continue;
56237
56318
  if (block.type === "thinking" && !projectedReasoning && reasoning.length > 0) {
56238
56319
  items.push({
@@ -56276,7 +56357,7 @@ function mapClaudeSnapshot(values, sessionId) {
56276
56357
  }
56277
56358
  } : { status: "succeeded" };
56278
56359
  const itemId = toolItem !== null ? claudeTranscriptItemId(user.uuid, "tool", toolItem) : hostItemIdSchema.parse(`claude-item-v1-${message.uuid}-tool-${blockIndex}`);
56279
- if (block.name === "Bash" && isRecord8(block.input) && typeof block.input.command === "string") {
56360
+ if (block.name === "Bash" && isRecord9(block.input) && typeof block.input.command === "string") {
56280
56361
  items.push({
56281
56362
  item: {
56282
56363
  type: "commandExecution",
@@ -56314,7 +56395,7 @@ function toolResultBlocks(messages) {
56314
56395
  if (message.type !== "user" || !Array.isArray(message.message.content))
56315
56396
  continue;
56316
56397
  for (const block of message.message.content) {
56317
- if (isRecord8(block) && block.type === "tool_result" && typeof block.tool_use_id === "string") {
56398
+ if (isRecord9(block) && block.type === "tool_result" && typeof block.tool_use_id === "string") {
56318
56399
  results.set(block.tool_use_id, block);
56319
56400
  }
56320
56401
  }
@@ -56329,7 +56410,7 @@ function toolResultOutput(block) {
56329
56410
  }
56330
56411
  function resultSubagentId(value, block) {
56331
56412
  const nativeResult = value.tool_use_result;
56332
- if (isRecord8(nativeResult)) {
56413
+ if (isRecord9(nativeResult)) {
56333
56414
  const structured = nativeResult.agentId ?? nativeResult.agent_id ?? nativeResult.task_id;
56334
56415
  if (typeof structured === "string" && structured.length > 0)
56335
56416
  return structured;
@@ -56340,13 +56421,13 @@ function resultSubagentId(value, block) {
56340
56421
  function subagentPrompt2(values, nativeSubagentId2) {
56341
56422
  const toolUses = /* @__PURE__ */ new Map();
56342
56423
  for (const value of values) {
56343
- if (!isRecord8(value) || !isRecord8(value.message) || !Array.isArray(value.message.content)) {
56424
+ if (!isRecord9(value) || !isRecord9(value.message) || !Array.isArray(value.message.content)) {
56344
56425
  continue;
56345
56426
  }
56346
56427
  for (const block of value.message.content) {
56347
- if (!isRecord8(block))
56428
+ if (!isRecord9(block))
56348
56429
  continue;
56349
- if (block.type === "tool_use" && typeof block.id === "string" && (block.name === "Agent" || block.name === "Task") && isRecord8(block.input) && typeof block.input.prompt === "string" && block.input.prompt.length > 0) {
56430
+ if (block.type === "tool_use" && typeof block.id === "string" && (block.name === "Agent" || block.name === "Task") && isRecord9(block.input) && typeof block.input.prompt === "string" && block.input.prompt.length > 0) {
56350
56431
  toolUses.set(block.id, block.input.prompt);
56351
56432
  continue;
56352
56433
  }
@@ -56360,7 +56441,7 @@ function subagentPrompt2(values, nativeSubagentId2) {
56360
56441
  return void 0;
56361
56442
  }
56362
56443
  function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, parentValues = []) {
56363
- const messages = conversationMessages(values.map((value) => isRecord8(value) ? { ...value, session_id: parentSessionId } : value), parentSessionId);
56444
+ const messages = conversationMessages(values.map((value) => isRecord9(value) ? { ...value, session_id: parentSessionId } : value), parentSessionId);
56364
56445
  const turns = [];
56365
56446
  for (let index = 0; index < messages.length; ) {
56366
56447
  const first = messages[index];
@@ -56391,7 +56472,7 @@ function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, p
56391
56472
  const content = Array.isArray(message.message.content) ? message.message.content : [{ type: "text", text: message.message.content }];
56392
56473
  for (let blockIndex = 0; blockIndex < content.length; blockIndex += 1) {
56393
56474
  const block = content[blockIndex];
56394
- if (!isRecord8(block))
56475
+ if (!isRecord9(block))
56395
56476
  continue;
56396
56477
  const itemId = hostItemIdSchema.parse(`claude-subagent-item-v2-${nativeSubagentId2}-${message.uuid}-${blockIndex}`);
56397
56478
  if (block.type === "thinking" && typeof block.thinking === "string") {
@@ -56428,7 +56509,7 @@ function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, p
56428
56509
  retryable: false
56429
56510
  }
56430
56511
  } : { status: "succeeded" };
56431
- if (block.name === "Bash" && isRecord8(block.input) && typeof block.input.command === "string") {
56512
+ if (block.name === "Bash" && isRecord9(block.input) && typeof block.input.command === "string") {
56432
56513
  items.push({
56433
56514
  item: {
56434
56515
  type: "commandExecution",
@@ -56694,7 +56775,7 @@ async function findClaudeTranscript(input) {
56694
56775
  }
56695
56776
  return null;
56696
56777
  }
56697
- function isRecord9(value) {
56778
+ function isRecord10(value) {
56698
56779
  return typeof value === "object" && value !== null && !Array.isArray(value);
56699
56780
  }
56700
56781
  async function readClaudeTranscript(input) {
@@ -56712,7 +56793,7 @@ async function readClaudeTranscript(input) {
56712
56793
  } catch {
56713
56794
  continue;
56714
56795
  }
56715
- if (!isRecord9(entry) || entry.type !== "user" && entry.type !== "assistant" || typeof entry.uuid !== "string" || !isRecord9(entry.message)) {
56796
+ if (!isRecord10(entry) || entry.type !== "user" && entry.type !== "assistant" && entry.type !== "attachment" || typeof entry.uuid !== "string" || entry.type !== "attachment" && !isRecord10(entry.message)) {
56716
56797
  continue;
56717
56798
  }
56718
56799
  messages.set(entry.uuid, { ...entry, session_id: input.sessionId });
@@ -56721,7 +56802,7 @@ async function readClaudeTranscript(input) {
56721
56802
  }
56722
56803
 
56723
56804
  // dist/claude-fork-references.js
56724
- function isRecord10(value) {
56805
+ function isRecord11(value) {
56725
56806
  return typeof value === "object" && value !== null && !Array.isArray(value);
56726
56807
  }
56727
56808
  function parseEntry(line) {
@@ -56729,7 +56810,7 @@ function parseEntry(line) {
56729
56810
  return null;
56730
56811
  try {
56731
56812
  const entry = JSON.parse(line);
56732
- return isRecord10(entry) ? entry : null;
56813
+ return isRecord11(entry) ? entry : null;
56733
56814
  } catch {
56734
56815
  return null;
56735
56816
  }
@@ -56738,7 +56819,7 @@ function remapSameAs(value, copies) {
56738
56819
  if (Array.isArray(value)) {
56739
56820
  return value.reduce((count4, item) => count4 + remapSameAs(item, copies), 0);
56740
56821
  }
56741
- if (!isRecord10(value))
56822
+ if (!isRecord11(value))
56742
56823
  return 0;
56743
56824
  let count3 = 0;
56744
56825
  for (const [key, child] of Object.entries(value)) {
@@ -56764,7 +56845,7 @@ async function remapForkedSessionReferences(input) {
56764
56845
  const copies = /* @__PURE__ */ new Map();
56765
56846
  for (const entry of entries) {
56766
56847
  const source = entry?.forkedFrom;
56767
- if (typeof entry?.uuid === "string" && isRecord10(source) && typeof source.messageUuid === "string") {
56848
+ if (typeof entry?.uuid === "string" && isRecord11(source) && typeof source.messageUuid === "string") {
56768
56849
  copies.set(source.messageUuid, entry.uuid);
56769
56850
  }
56770
56851
  }
@@ -57399,17 +57480,17 @@ function rejectAfter(milliseconds, message) {
57399
57480
  function processExited(child) {
57400
57481
  return child.exitCode !== null || child.signalCode !== null;
57401
57482
  }
57402
- function isRecord11(value) {
57483
+ function isRecord12(value) {
57403
57484
  return typeof value === "object" && value !== null && !Array.isArray(value);
57404
57485
  }
57405
57486
  function permissionModeFromMessage(value) {
57406
- if (!isRecord11(value) || value.type !== "system" || value.subtype !== "init" && value.subtype !== "status" || !("permissionMode" in value) || value.permissionMode === void 0) {
57487
+ if (!isRecord12(value) || value.type !== "system" || value.subtype !== "init" && value.subtype !== "status" || !("permissionMode" in value) || value.permissionMode === void 0) {
57407
57488
  return void 0;
57408
57489
  }
57409
57490
  return isClaudePermissionMode(value.permissionMode) ? value.permissionMode : void 0;
57410
57491
  }
57411
57492
  function parseContextUsage(value) {
57412
- if (!isRecord11(value))
57493
+ if (!isRecord12(value))
57413
57494
  throw new Error("Claude SDK context Usage is invalid");
57414
57495
  const usedTokens = value.totalTokens;
57415
57496
  const maxTokens = value.maxTokens;
@@ -57426,7 +57507,7 @@ function parseQuestions(input) {
57426
57507
  const questions = [];
57427
57508
  const questionTexts = /* @__PURE__ */ new Set();
57428
57509
  for (const value of input.questions) {
57429
- if (!isRecord11(value))
57510
+ if (!isRecord12(value))
57430
57511
  return null;
57431
57512
  const question = value.question;
57432
57513
  const header = value.header;
@@ -57437,7 +57518,7 @@ function parseQuestions(input) {
57437
57518
  const labels = /* @__PURE__ */ new Set();
57438
57519
  const options = [];
57439
57520
  for (const option2 of value.options) {
57440
- if (!isRecord11(option2) || typeof option2.label !== "string" || option2.label.length === 0 || labels.has(option2.label) || typeof option2.description !== "string") {
57521
+ if (!isRecord12(option2) || typeof option2.label !== "string" || option2.label.length === 0 || labels.has(option2.label) || typeof option2.description !== "string") {
57441
57522
  return null;
57442
57523
  }
57443
57524
  labels.add(option2.label);
@@ -57479,7 +57560,7 @@ function permissionUpdateDestination(value) {
57479
57560
  return void 0;
57480
57561
  }
57481
57562
  function isPermissionUpdate(value) {
57482
- if (!isRecord11(value) || !permissionUpdateDestination(value.destination))
57563
+ if (!isRecord12(value) || !permissionUpdateDestination(value.destination))
57483
57564
  return false;
57484
57565
  if (value.type === "setMode") {
57485
57566
  return typeof value.mode === "string" && PERMISSION_MODES.has(value.mode);
@@ -57488,7 +57569,7 @@ function isPermissionUpdate(value) {
57488
57569
  return Array.isArray(value.directories) && value.directories.every((directory) => typeof directory === "string");
57489
57570
  }
57490
57571
  if (value.type === "addRules" || value.type === "replaceRules" || value.type === "removeRules") {
57491
- return typeof value.behavior === "string" && PERMISSION_BEHAVIORS.has(value.behavior) && Array.isArray(value.rules) && value.rules.every((rule) => isRecord11(rule) && typeof rule.toolName === "string" && (rule.ruleContent === void 0 || typeof rule.ruleContent === "string"));
57572
+ return typeof value.behavior === "string" && PERMISSION_BEHAVIORS.has(value.behavior) && Array.isArray(value.rules) && value.rules.every((rule) => isRecord12(rule) && typeof rule.toolName === "string" && (rule.ruleContent === void 0 || typeof rule.ruleContent === "string"));
57492
57573
  }
57493
57574
  return false;
57494
57575
  }
@@ -57742,15 +57823,15 @@ var ClaudeSdkTransport = class {
57742
57823
  return this.#idleLive && this.#idleHandler !== null;
57743
57824
  }
57744
57825
  #observeRootToolCalls(message) {
57745
- if (!isRecord11(message) || message.parent_tool_use_id != null)
57826
+ if (!isRecord12(message) || message.parent_tool_use_id != null)
57746
57827
  return;
57747
57828
  if (message.type !== "assistant" && message.type !== "user")
57748
57829
  return;
57749
57830
  const body = message.message;
57750
- if (!isRecord11(body) || !Array.isArray(body.content))
57831
+ if (!isRecord12(body) || !Array.isArray(body.content))
57751
57832
  return;
57752
57833
  for (const block of body.content) {
57753
- if (!isRecord11(block))
57834
+ if (!isRecord12(block))
57754
57835
  continue;
57755
57836
  if (message.type === "assistant" && block.type === "tool_use" && typeof block.id === "string") {
57756
57837
  this.#rootToolCalls.add(block.id);
@@ -57760,12 +57841,12 @@ var ClaudeSdkTransport = class {
57760
57841
  }
57761
57842
  }
57762
57843
  #observeNativeCapabilities(message) {
57763
- if (!isRecord11(message) || message.type !== "system" || message.subtype !== "init")
57844
+ if (!isRecord12(message) || message.type !== "system" || message.subtype !== "init")
57764
57845
  return;
57765
57846
  this.#nativeSteer = Array.isArray(message.capabilities) && message.capabilities.includes("msg_lifecycle_v1");
57766
57847
  }
57767
57848
  #observeSlashCommands(message) {
57768
- if (!isRecord11(message) || message.type !== "system")
57849
+ if (!isRecord12(message) || message.type !== "system")
57769
57850
  return;
57770
57851
  if (message.subtype === "init" && Array.isArray(message.skills)) {
57771
57852
  this.#skillNames = new Set(message.skills.filter((name) => typeof name === "string"));
@@ -58262,7 +58343,7 @@ var ClaudeSdkTransport = class {
58262
58343
  * without `started` means no native turn takes it over.
58263
58344
  */
58264
58345
  #observeSteer(message) {
58265
- if (this.#pendingSteers.size === 0 && this.#steerTakeovers.size === 0 || !isRecord11(message) || message.type !== "command_lifecycle") {
58346
+ if (this.#pendingSteers.size === 0 && this.#steerTakeovers.size === 0 || !isRecord12(message) || message.type !== "command_lifecycle") {
58266
58347
  return;
58267
58348
  }
58268
58349
  if (typeof message.command_uuid !== "string" || message.command_uuid.length === 0)
@@ -58276,10 +58357,10 @@ var ClaudeSdkTransport = class {
58276
58357
  }
58277
58358
  }
58278
58359
  #observeBackgroundTasks(message) {
58279
- if (!isRecord11(message) || message.type !== "system")
58360
+ if (!isRecord12(message) || message.type !== "system")
58280
58361
  return;
58281
58362
  if (message.subtype === "background_tasks_changed" && Array.isArray(message.tasks)) {
58282
- this.#backgroundTasks = new Set(message.tasks.flatMap((task) => isRecord11(task) && typeof task.task_id === "string" ? [task.task_id] : []));
58363
+ this.#backgroundTasks = new Set(message.tasks.flatMap((task) => isRecord12(task) && typeof task.task_id === "string" ? [task.task_id] : []));
58283
58364
  } else if (message.subtype === "task_started" && typeof message.task_id === "string") {
58284
58365
  this.#backgroundTasks.add(message.task_id);
58285
58366
  } else if (message.subtype === "task_notification" && typeof message.task_id === "string" && ["completed", "failed", "stopped"].includes(String(message.status))) {
@@ -58295,7 +58376,7 @@ var ClaudeSdkTransport = class {
58295
58376
  }
58296
58377
  /** Remembers Workflow agent labels so their approvals can name the agent asking. */
58297
58378
  #observeWorkflowAgents(message) {
58298
- if (!isRecord11(message) || message.type !== "system" || message.subtype !== "task_progress") {
58379
+ if (!isRecord12(message) || message.type !== "system" || message.subtype !== "task_progress") {
58299
58380
  return;
58300
58381
  }
58301
58382
  for (const agent of parseClaudeWorkflowAgents(message.workflow_progress) ?? []) {
@@ -58360,7 +58441,7 @@ var ClaudeSdkTransport = class {
58360
58441
  userMessageId: null,
58361
58442
  live: false
58362
58443
  });
58363
- if (autonomous.userMessageId === null && isRecord11(message) && message.type === "user" && (message.parent_tool_use_id === null || message.parent_tool_use_id === void 0) && typeof message.uuid === "string" && message.uuid.length > 0) {
58444
+ if (autonomous.userMessageId === null && isRecord12(message) && message.type === "user" && (message.parent_tool_use_id === null || message.parent_tool_use_id === void 0) && typeof message.uuid === "string" && message.uuid.length > 0) {
58364
58445
  autonomous.userMessageId = message.uuid;
58365
58446
  }
58366
58447
  const interpreted = autonomous.accumulator.consume(message);
@@ -58890,11 +58971,11 @@ var ClaudeWorkflowLifecycle = class {
58890
58971
  };
58891
58972
 
58892
58973
  // dist/task-tracker.js
58893
- function isRecord12(value) {
58974
+ function isRecord13(value) {
58894
58975
  return typeof value === "object" && value !== null && !Array.isArray(value);
58895
58976
  }
58896
58977
  function stringField(value, keys) {
58897
- if (!isRecord12(value))
58978
+ if (!isRecord13(value))
58898
58979
  return void 0;
58899
58980
  for (const key of keys) {
58900
58981
  const field2 = value[key];
@@ -58929,7 +59010,7 @@ var ClaudeTaskTracker = class {
58929
59010
  };
58930
59011
  }
58931
59012
  #create(args, result) {
58932
- if (!isRecord12(result) || !isRecord12(result.task))
59013
+ if (!isRecord13(result) || !isRecord13(result.task))
58933
59014
  return;
58934
59015
  const id2 = stringField(result.task, ["id"]);
58935
59016
  const subject = stringField(args, ["subject"]) ?? stringField(result.task, ["subject"]);
@@ -58947,7 +59028,7 @@ var ClaudeTaskTracker = class {
58947
59028
  const id2 = stringField(args, ["taskId", "id", "task_id"]);
58948
59029
  if (!id2)
58949
59030
  return;
58950
- const status = isRecord12(args) ? taskStatus2(args.status) : void 0;
59031
+ const status = isRecord13(args) ? taskStatus2(args.status) : void 0;
58951
59032
  if (status === "deleted") {
58952
59033
  this.#tasks.delete(id2);
58953
59034
  return;
@@ -58965,13 +59046,13 @@ var ClaudeTaskTracker = class {
58965
59046
  });
58966
59047
  }
58967
59048
  #replace(result) {
58968
- if (!isRecord12(result) || !Array.isArray(result.tasks))
59049
+ if (!isRecord13(result) || !Array.isArray(result.tasks))
58969
59050
  return;
58970
59051
  const next = /* @__PURE__ */ new Map();
58971
59052
  for (const value of result.tasks) {
58972
59053
  const id2 = stringField(value, ["id"]);
58973
59054
  const subject = stringField(value, ["subject"]);
58974
- const status = isRecord12(value) ? taskStatus2(value.status) : void 0;
59055
+ const status = isRecord13(value) ? taskStatus2(value.status) : void 0;
58975
59056
  if (!id2 || !subject || !status || status === "deleted")
58976
59057
  continue;
58977
59058
  const existing = this.#tasks.get(id2);
@@ -59138,11 +59219,11 @@ var ClaudeBackgroundCommandItems = class {
59138
59219
  };
59139
59220
 
59140
59221
  // dist/tool-lifecycle.js
59141
- function isRecord13(value) {
59222
+ function isRecord14(value) {
59142
59223
  return typeof value === "object" && value !== null && !Array.isArray(value);
59143
59224
  }
59144
59225
  function stringField2(value, key) {
59145
- return isRecord13(value) && typeof value[key] === "string" ? value[key] : void 0;
59226
+ return isRecord14(value) && typeof value[key] === "string" ? value[key] : void 0;
59146
59227
  }
59147
59228
  function toolFailure(toolName) {
59148
59229
  return {
@@ -59409,7 +59490,7 @@ var CONTEXT_USAGE_TTL_MS = 1e4;
59409
59490
  var CONTEXT_USAGE_FAILURE_COOLDOWN_MS = 5e3;
59410
59491
  var REQUEST_USAGE_RETRY_DELAYS_MS = [0, 100, 250, 500, 1e3];
59411
59492
  var DEFAULT_CONTINUATION_QUIESCENCE_MS = 2e3;
59412
- function isRecord14(value) {
59493
+ function isRecord15(value) {
59413
59494
  return typeof value === "object" && value !== null && !Array.isArray(value);
59414
59495
  }
59415
59496
  function safeNonNegativeInteger2(value) {
@@ -59418,7 +59499,7 @@ function safeNonNegativeInteger2(value) {
59418
59499
  function transcriptRequestUsage(messages, messageId) {
59419
59500
  for (let index = messages.length - 1; index >= 0; index -= 1) {
59420
59501
  const entry = messages[index];
59421
- if (!isRecord14(entry) || entry.type !== "assistant" || entry.parent_tool_use_id !== null && entry.parent_tool_use_id !== void 0 || !isRecord14(entry.message) || entry.message.id !== messageId || !isRecord14(entry.message.usage)) {
59502
+ if (!isRecord15(entry) || entry.type !== "assistant" || entry.parent_tool_use_id !== null && entry.parent_tool_use_id !== void 0 || !isRecord15(entry.message) || entry.message.id !== messageId || !isRecord15(entry.message.usage)) {
59422
59503
  continue;
59423
59504
  }
59424
59505
  const inputTokens = entry.message.usage.input_tokens;
@@ -59735,7 +59816,7 @@ var ClaudeHarnessSession = class {
59735
59816
  cwd: this.#cwd,
59736
59817
  sessionId: this.#sessionId
59737
59818
  }) ?? [];
59738
- const ids = new Set(messages.flatMap((message) => isRecord14(message) && typeof message.uuid === "string" ? [message.uuid] : []));
59819
+ const ids = new Set(messages.flatMap((message) => isRecord15(message) && typeof message.uuid === "string" ? [message.uuid] : []));
59739
59820
  if (this.#unpersistedMessageIds.every((id2) => ids.has(id2))) {
59740
59821
  this.#unpersistedMessageIds = [];
59741
59822
  break;