@lichao0223/lobehub-cli 0.0.96 → 0.0.98

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.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from "node:module";
3
3
  import crypto$1, { X509Certificate, createHash, randomBytes, randomUUID, sign } from "node:crypto";
4
4
  import * as fs$5 from "node:fs";
5
- import fs, { appendFileSync, closeSync, constants, createReadStream, createWriteStream, existsSync, fstatSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlink, writeFileSync } from "node:fs";
5
+ import fs, { appendFileSync, chmodSync, closeSync, constants, createReadStream, createWriteStream, existsSync, fstatSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, symlinkSync, unlink, writeFileSync } from "node:fs";
6
6
  import * as os$4 from "node:os";
7
7
  import os, { EOL, constants as constants$1, homedir, platform, tmpdir } from "node:os";
8
8
  import * as path$4 from "node:path";
@@ -21,7 +21,7 @@ import { finished, pipeline } from "node:stream/promises";
21
21
  import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWaterMark, pipeline as pipeline$1 } from "node:stream";
22
22
  import readline, { createInterface } from "node:readline";
23
23
  import { ReadableStream as ReadableStream$1 } from "node:stream/web";
24
- import { text } from "node:stream/consumers";
24
+ import { buffer, text } from "node:stream/consumers";
25
25
  import http, { Agent, ServerResponse, createServer as createServer$1, request } from "node:http";
26
26
  import { createServer as createServer$2, request as request$1 } from "node:https";
27
27
  import zlib, { zstdDecompress } from "node:zlib";
@@ -5656,7 +5656,7 @@ function nativeEnum(entries, params) {
5656
5656
  ...normalizeParams(params)
5657
5657
  });
5658
5658
  }
5659
- function literal(value, params) {
5659
+ function literal$1(value, params) {
5660
5660
  return new ZodLiteral$1({
5661
5661
  type: "literal",
5662
5662
  values: Array.isArray(value) ? value : [value],
@@ -7788,6 +7788,7 @@ var init_pluginConfig = __esmMin((() => {
7788
7788
  "disabled"
7789
7789
  ]);
7790
7790
  AgentPluginEntrySchema = union([string(), object$1({
7791
+ builtinOverride: literal$1(true).optional(),
7791
7792
  identifier: string(),
7792
7793
  mode: AgentPluginModeSchema.optional()
7793
7794
  })]);
@@ -8153,8 +8154,8 @@ var init_agentHook = __esmMin((() => {
8153
8154
  var toolCallHookDecisionSchema;
8154
8155
  var init_agentHookResponse = __esmMin((() => {
8155
8156
  init_zod$1();
8156
- toolCallHookDecisionSchema = discriminatedUnion("decision", [object$1({ decision: literal("allow") }), object$1({
8157
- decision: literal("deny"),
8157
+ toolCallHookDecisionSchema = discriminatedUnion("decision", [object$1({ decision: literal$1("allow") }), object$1({
8158
+ decision: literal$1("deny"),
8158
8159
  reason: string().optional()
8159
8160
  })]);
8160
8161
  }));
@@ -8238,9 +8239,9 @@ var init_base$1 = __esmMin((() => {
8238
8239
  ]).optional(),
8239
8240
  summary: array(object$1({
8240
8241
  text: string(),
8241
- type: literal("summary_text")
8242
+ type: literal$1("summary_text")
8242
8243
  })),
8243
- type: literal("reasoning")
8244
+ type: literal$1("reasoning")
8244
8245
  }).passthrough();
8245
8246
  ModelReasoningSchema = object$1({
8246
8247
  content: string().optional(),
@@ -8369,7 +8370,7 @@ var init_contextAccounting = __esmMin((() => {
8369
8370
  toolCalls: 0,
8370
8371
  toolDefinition: 0
8371
8372
  }),
8372
- estimator: literal("tokenx").catch("tokenx"),
8373
+ estimator: literal$1("tokenx").catch("tokenx"),
8373
8374
  messageCount: tokens,
8374
8375
  system: tokens,
8375
8376
  total: tokens
@@ -8406,7 +8407,7 @@ var init_contextSelection = __esmMin((() => {
8406
8407
  startOffset: number$1()
8407
8408
  }).optional(),
8408
8409
  pageId: string(),
8409
- source: literal("page"),
8410
+ source: literal$1("page"),
8410
8411
  xml: string().optional()
8411
8412
  });
8412
8413
  CodeContextSelectionSchema = ContextSelectionBaseSchema.extend({
@@ -8417,10 +8418,10 @@ var init_contextSelection = __esmMin((() => {
8417
8418
  "context",
8418
8419
  "deletions"
8419
8420
  ]).optional(),
8420
- source: literal("code"),
8421
+ source: literal$1("code"),
8421
8422
  workingDirectory: string().optional()
8422
8423
  });
8423
- TextContextSelectionSchema = ContextSelectionBaseSchema.extend({ source: literal("text") });
8424
+ TextContextSelectionSchema = ContextSelectionBaseSchema.extend({ source: literal$1("text") });
8424
8425
  ElementContextSelectionSchema = ContextSelectionBaseSchema.extend({
8425
8426
  element: object$1({
8426
8427
  pageTitle: string().optional(),
@@ -8430,11 +8431,11 @@ var init_contextSelection = __esmMin((() => {
8430
8431
  thumbnailUrl: string().optional(),
8431
8432
  url: string().optional()
8432
8433
  }),
8433
- source: literal("element")
8434
+ source: literal$1("element")
8434
8435
  });
8435
8436
  McpAppContextSelectionSchema = ContextSelectionBaseSchema.extend({
8436
8437
  identifier: string(),
8437
- source: literal("mcpApp")
8438
+ source: literal$1("mcpApp")
8438
8439
  });
8439
8440
  ContextSelectionSchema = discriminatedUnion("source", [
8440
8441
  PageContextSelectionSchema,
@@ -8486,17 +8487,17 @@ var init_metadata = __esmMin((() => {
8486
8487
  taskId: string().optional(),
8487
8488
  taskIdentifier: string().optional()
8488
8489
  })),
8489
- type: literal("task")
8490
+ type: literal$1("task")
8490
8491
  }),
8491
8492
  object$1({
8492
8493
  args: record(string(), unknown()).optional(),
8493
8494
  data: unknown(),
8494
8495
  provider: string(),
8495
8496
  toolName: string(),
8496
- type: literal("skill")
8497
+ type: literal$1("skill")
8497
8498
  }),
8498
8499
  object$1({
8499
- action: literal("register"),
8500
+ action: literal$1("register"),
8500
8501
  document: object$1({
8501
8502
  agentDocumentId: string().nullish(),
8502
8503
  agentId: string().nullish(),
@@ -8505,19 +8506,19 @@ var init_metadata = __esmMin((() => {
8505
8506
  changeType: _enum(["created", "updated"]),
8506
8507
  toolName: string()
8507
8508
  }),
8508
- type: literal("document")
8509
+ type: literal$1("document")
8509
8510
  }),
8510
8511
  object$1({
8511
- action: literal("delete"),
8512
+ action: literal$1("delete"),
8512
8513
  document: object$1({
8513
8514
  agentDocumentId: string().nullish(),
8514
8515
  agentId: string().nullish(),
8515
8516
  documentId: string()
8516
8517
  }),
8517
- type: literal("document")
8518
+ type: literal$1("document")
8518
8519
  }),
8519
8520
  object$1({
8520
- action: literal("register"),
8521
+ action: literal$1("register"),
8521
8522
  canvas: object$1({
8522
8523
  canvasId: string(),
8523
8524
  description: string().nullish(),
@@ -8531,7 +8532,7 @@ var init_metadata = __esmMin((() => {
8531
8532
  totalSize: number$1()
8532
8533
  })
8533
8534
  }),
8534
- type: literal("canvas")
8535
+ type: literal$1("canvas")
8535
8536
  })
8536
8537
  ]);
8537
8538
  LocalSystemToolSnapshotSchema = object$1({
@@ -8545,7 +8546,7 @@ var init_metadata = __esmMin((() => {
8545
8546
  capturedAt: string(),
8546
8547
  content: string().nullable(),
8547
8548
  error: unknown().optional(),
8548
- identifier: literal("lobe-local-system"),
8549
+ identifier: literal$1("lobe-local-system"),
8549
8550
  result: unknown().optional(),
8550
8551
  snapshotId: string(),
8551
8552
  state: unknown().optional(),
@@ -8624,7 +8625,7 @@ var init_metadata = __esmMin((() => {
8624
8625
  });
8625
8626
  AgentDispatchMetadataSchema = object$1({
8626
8627
  kind: _enum(["callAgent"]),
8627
- visibility: literal("internal")
8628
+ visibility: literal$1("internal")
8628
8629
  });
8629
8630
  AgentSenderMetadataSchema = object$1({
8630
8631
  agentId: string(),
@@ -8886,6 +8887,22 @@ var init_params$1 = __esmMin((() => {
8886
8887
  });
8887
8888
  }));
8888
8889
 
8890
+ //#endregion
8891
+ //#region ../../packages/types/src/tool/builtinWork.ts
8892
+ var PluginApiWorkConfigSchema;
8893
+ var init_builtinWork = __esmMin((() => {
8894
+ init_zod$1();
8895
+ PluginApiWorkConfigSchema = object$1({
8896
+ action: _enum([
8897
+ "create",
8898
+ "update",
8899
+ "delete"
8900
+ ]),
8901
+ agentEditable: boolean().optional(),
8902
+ resourceType: _enum(["document", "task"])
8903
+ });
8904
+ }));
8905
+
8889
8906
  //#endregion
8890
8907
  //#region ../../packages/types/src/tool/intervention.ts
8891
8908
  var HumanInterventionPolicySchema, ArgumentMatcherSchema, HumanInterventionRuleSchema, HumanInterventionConfigSchema, HumanInterventionResponseSchema, UserInterventionConfigSchema, SecurityBlacklistRuleSchema, SecurityBlacklistConfigSchema, ShouldInterveneParamsSchema;
@@ -8951,11 +8968,13 @@ var init_builtinIntervention = __esmMin((() => {}));
8951
8968
 
8952
8969
  //#endregion
8953
8970
  //#region ../../packages/types/src/tool/builtin.ts
8954
- var MetaSchema, RenderDisplayControlSchema, DynamicInterventionConfigSchema, ExtendedHumanInterventionConfigSchema, PluginApiWorkConfigSchema, LobeChatPluginApiSchema, BuiltinToolManifestSchema, LobeBuiltinToolSchema;
8971
+ var MetaSchema, RenderDisplayControlSchema, DynamicInterventionConfigSchema, ExtendedHumanInterventionConfigSchema, LobeChatPluginApiSchema, BuiltinToolManifestSchema, LobeBuiltinToolSchema;
8955
8972
  var init_builtin = __esmMin((() => {
8956
8973
  init_zod$1();
8974
+ init_builtinWork();
8957
8975
  init_intervention();
8958
8976
  init_builtinIntervention();
8977
+ init_builtinWork();
8959
8978
  MetaSchema = object$1({
8960
8979
  avatar: string().optional(),
8961
8980
  description: string().optional(),
@@ -8974,14 +8993,6 @@ var init_builtin = __esmMin((() => {
8974
8993
  type: string()
8975
8994
  });
8976
8995
  ExtendedHumanInterventionConfigSchema = union([HumanInterventionConfigSchema, object$1({ dynamic: DynamicInterventionConfigSchema })]);
8977
- PluginApiWorkConfigSchema = object$1({
8978
- action: _enum([
8979
- "create",
8980
- "update",
8981
- "delete"
8982
- ]),
8983
- resourceType: _enum(["document", "task"])
8984
- });
8985
8996
  LobeChatPluginApiSchema = object$1({
8986
8997
  defaultTimeoutMs: number$1().int().positive().optional(),
8987
8998
  description: string(),
@@ -9002,14 +9013,14 @@ var init_builtin = __esmMin((() => {
9002
9013
  identifier: string(),
9003
9014
  meta: MetaSchema,
9004
9015
  systemRole: string(),
9005
- type: literal("builtin").optional()
9016
+ type: literal$1("builtin").optional()
9006
9017
  });
9007
9018
  LobeBuiltinToolSchema = object$1({
9008
9019
  discoverable: boolean().optional(),
9009
9020
  hidden: boolean().optional(),
9010
9021
  identifier: string(),
9011
9022
  manifest: BuiltinToolManifestSchema,
9012
- type: literal("builtin")
9023
+ type: literal$1("builtin")
9013
9024
  });
9014
9025
  }));
9015
9026
 
@@ -9030,7 +9041,7 @@ var init_manifest = __esmMin((() => {
9030
9041
  ToolManifestSettingsSchema = object$1({
9031
9042
  properties: record(string(), any()),
9032
9043
  required: array(string()).optional(),
9033
- type: literal("object")
9044
+ type: literal$1("object")
9034
9045
  });
9035
9046
  ToolManifestSchema = object$1({
9036
9047
  $schema: string().optional(),
@@ -9096,7 +9107,7 @@ var init_tool$2 = __esmMin((() => {
9096
9107
  additionalProperties: boolean().optional(),
9097
9108
  properties: record(string(), any()),
9098
9109
  required: array(string()).optional(),
9099
- type: literal("object")
9110
+ type: literal$1("object")
9100
9111
  })
9101
9112
  });
9102
9113
  }));
@@ -9129,7 +9140,7 @@ var init_understanding = __esmMin((() => {
9129
9140
  MAX_UNDERSTANDING_FEEDBACK_LENGTH = 2e3;
9130
9141
  MAX_UNDERSTANDING_FEEDBACK_TURNS = 16;
9131
9142
  MAX_PERSONA_CONTENT_LENGTH = 12e3;
9132
- OnboardingUnderstandingThreadMarkerSchema = object$1({ kind: literal("writing") }).strict();
9143
+ OnboardingUnderstandingThreadMarkerSchema = object$1({ kind: literal$1("writing") }).strict();
9133
9144
  CollectionErrorSchema = object$1({
9134
9145
  code: string().max(64),
9135
9146
  message: string(),
@@ -9191,7 +9202,7 @@ var init_understanding = __esmMin((() => {
9191
9202
  diagnostics: CollectionDiagnosticsSchema,
9192
9203
  feedbackRevision: number$1().int().nonnegative().max(MAX_COLLECTION_COUNT).default(0),
9193
9204
  generationRevision: number$1().int().nonnegative().max(MAX_COLLECTION_COUNT).default(0),
9194
- kind: literal("proposal"),
9205
+ kind: literal$1("proposal"),
9195
9206
  providers: array(string().max(64)),
9196
9207
  resultId: string(),
9197
9208
  sourceFingerprint: string()
@@ -9221,16 +9232,16 @@ var init_understanding = __esmMin((() => {
9221
9232
  understandingWritingStateBaseShape = {
9222
9233
  detailed: discriminatedUnion("status", [
9223
9234
  object$1({
9224
- status: literal("running"),
9235
+ status: literal$1("running"),
9225
9236
  updatedAt: string()
9226
9237
  }).strict(),
9227
9238
  object$1({
9228
- status: literal("completed"),
9239
+ status: literal$1("completed"),
9229
9240
  updatedAt: string()
9230
9241
  }).strict(),
9231
9242
  object$1({
9232
9243
  error: CollectionErrorSchema,
9233
- status: literal("failed"),
9244
+ status: literal$1("failed"),
9234
9245
  updatedAt: string()
9235
9246
  }).strict()
9236
9247
  ]).optional(),
@@ -9243,18 +9254,18 @@ var init_understanding = __esmMin((() => {
9243
9254
  object$1({
9244
9255
  ...understandingWritingStateBaseShape,
9245
9256
  resultMessageId: string().optional(),
9246
- status: literal("running")
9257
+ status: literal$1("running")
9247
9258
  }).strict(),
9248
9259
  object$1({
9249
9260
  ...understandingWritingStateBaseShape,
9250
9261
  resultMessageId: string(),
9251
- status: literal("completed")
9262
+ status: literal$1("completed")
9252
9263
  }).strict(),
9253
9264
  object$1({
9254
9265
  ...understandingWritingStateBaseShape,
9255
9266
  error: CollectionErrorSchema,
9256
9267
  resultMessageId: string().optional(),
9257
- status: literal("failed")
9268
+ status: literal$1("failed")
9258
9269
  }).strict()
9259
9270
  ]);
9260
9271
  OnboardingUnderstandingSessionSchema = object$1({
@@ -9403,7 +9414,7 @@ var init_aiChat = __esmMin((() => {
9403
9414
  additionalProperties: boolean().optional(),
9404
9415
  properties: record(string(), any()),
9405
9416
  required: array(string()).optional(),
9406
- type: literal("object")
9417
+ type: literal$1("object")
9407
9418
  }),
9408
9419
  strict: boolean().optional()
9409
9420
  });
@@ -9419,7 +9430,7 @@ var init_aiChat = __esmMin((() => {
9419
9430
  schema: StructureSchema.optional(),
9420
9431
  tools: array(object$1({
9421
9432
  function: LobeUniformToolSchema,
9422
- type: literal("function")
9433
+ type: literal$1("function")
9423
9434
  })).optional(),
9424
9435
  /**
9425
9436
  * Structured tracing config (scenario / promptVersion / schemaName /
@@ -9446,17 +9457,17 @@ var init_aiChat = __esmMin((() => {
9446
9457
  true: DecisionContentSchema
9447
9458
  }).optional(),
9448
9459
  instructions: DecisionContentSchema,
9449
- type: literal("boolean")
9460
+ type: literal$1("boolean")
9450
9461
  }),
9451
9462
  object$1({
9452
9463
  criteria: record(string(), DecisionContentSchema.nullable()),
9453
9464
  instructions: DecisionContentSchema,
9454
- type: literal("choice")
9465
+ type: literal$1("choice")
9455
9466
  }),
9456
9467
  object$1({
9457
9468
  criteria: array(DecisionContentSchema).min(1),
9458
9469
  instructions: DecisionContentSchema,
9459
- type: literal("score")
9470
+ type: literal$1("score")
9460
9471
  })
9461
9472
  ]);
9462
9473
  DecisionOutputSchema = object$1({
@@ -10109,9 +10120,9 @@ var init_followUpAction = __esmMin((() => {
10109
10120
  init_zod$1();
10110
10121
  init_agentOnboarding();
10111
10122
  FollowUpHintSchema = union([object$1({
10112
- kind: literal("onboarding"),
10123
+ kind: literal$1("onboarding"),
10113
10124
  phase: OnboardingPhaseSchema
10114
- }), object$1({ kind: literal("chat") })]);
10125
+ }), object$1({ kind: literal$1("chat") })]);
10115
10126
  FollowUpModelConfigSchema = object$1({
10116
10127
  model: string().min(1),
10117
10128
  provider: string().min(1)
@@ -10239,7 +10250,7 @@ var init_heteroSessionImport = __esmMin((() => {
10239
10250
  arguments: string(),
10240
10251
  id: string(),
10241
10252
  identifier: string(),
10242
- type: literal("default")
10253
+ type: literal$1("default")
10243
10254
  });
10244
10255
  heteroSessionImportMessageSchema = object$1({
10245
10256
  clientId: string(),
@@ -11067,7 +11078,7 @@ var init_topic$1 = __esmMin((() => {
11067
11078
  resumeAfterRateLimitRunSchema = topicScheduledRunBaseSchema.extend({
11068
11079
  /** The failed assistant turn that hit the rate limit (regenerated in place). */
11069
11080
  failedAssistantMessageId: string(),
11070
- kind: literal("resume_after_rate_limit"),
11081
+ kind: literal$1("resume_after_rate_limit"),
11071
11082
  /** Diagnostics only — `runAt` is derived from `resetsAt` at write time. */
11072
11083
  rateLimit: object$1({
11073
11084
  rateLimitType: string().optional(),
@@ -11078,12 +11089,12 @@ var init_topic$1 = __esmMin((() => {
11078
11089
  sessionId: string().optional(),
11079
11090
  workingDirectory: string().optional()
11080
11091
  }).optional(),
11081
- source: literal("heterogeneous_agent"),
11092
+ source: literal$1("heterogeneous_agent"),
11082
11093
  /** The user message whose turn is being continued. */
11083
11094
  userMessageId: string()
11084
11095
  });
11085
11096
  delayedStartRunSchema = topicScheduledRunBaseSchema.extend({
11086
- kind: literal("delayed_start"),
11097
+ kind: literal$1("delayed_start"),
11087
11098
  /** Model override captured at schedule time (the agent default is used if absent). */
11088
11099
  model: string().optional(),
11089
11100
  /** Provider override captured at schedule time. */
@@ -11108,7 +11119,7 @@ var init_topic$1 = __esmMin((() => {
11108
11119
  });
11109
11120
  worktreeStartRunSchema = topicScheduledRunBaseSchema.extend({
11110
11121
  error: string().optional(),
11111
- kind: literal("worktree_start"),
11122
+ kind: literal$1("worktree_start"),
11112
11123
  operationId: string(),
11113
11124
  retryable: boolean().optional(),
11114
11125
  userMessageId: string(),
@@ -11128,12 +11139,12 @@ var init_topic$1 = __esmMin((() => {
11128
11139
  rateLimitType: string().optional(),
11129
11140
  resetsAt: number$1().optional()
11130
11141
  }).optional(),
11131
- reason: literal("rate_limit"),
11142
+ reason: literal$1("rate_limit"),
11132
11143
  resume: object$1({
11133
11144
  sessionId: string().optional(),
11134
11145
  workingDirectory: string().optional()
11135
11146
  }).optional(),
11136
- source: literal("heterogeneous_agent"),
11147
+ source: literal$1("heterogeneous_agent"),
11137
11148
  updatedAt: string(),
11138
11149
  userMessageId: string()
11139
11150
  });
@@ -11814,23 +11825,23 @@ var init_tools = __esmMin((() => {
11814
11825
  ]);
11815
11826
  searchMemoryDayIntentSchema = object$1({
11816
11827
  date: date$1(),
11817
- selector: literal("day")
11828
+ selector: literal$1("day")
11818
11829
  });
11819
11830
  searchMemoryMonthIntentSchema = object$1({
11820
11831
  month: number$1().int().min(1).max(12),
11821
- selector: literal("month"),
11832
+ selector: literal$1("month"),
11822
11833
  year: number$1().int().min(1970).max(9999)
11823
11834
  });
11824
11835
  searchMemoryRangeIntentSchema = object$1({
11825
11836
  end: date$1().optional(),
11826
- selector: literal("range"),
11837
+ selector: literal$1("range"),
11827
11838
  start: date$1().optional()
11828
11839
  }).refine((value) => Boolean(value.start || value.end), {
11829
11840
  message: "range selector requires start or end",
11830
11841
  path: ["start"]
11831
11842
  });
11832
11843
  searchMemoryYearIntentSchema = object$1({
11833
- selector: literal("year"),
11844
+ selector: literal$1("year"),
11834
11845
  year: number$1().int().min(1970).max(9999)
11835
11846
  });
11836
11847
  searchMemoryLegacyRelativeDayAnchorSchema = _enum(["today", "yesterday"]);
@@ -11841,7 +11852,7 @@ var init_tools = __esmMin((() => {
11841
11852
  object$1({
11842
11853
  anchor: union([searchMemoryLegacyRelativeDayAnchorSchema, searchMemoryTimeIntentSchema]),
11843
11854
  offsetDays: number$1().int(),
11844
- selector: literal("relativeDay")
11855
+ selector: literal$1("relativeDay")
11845
11856
  }),
11846
11857
  searchMemoryRangeIntentSchema,
11847
11858
  searchMemoryYearIntentSchema
@@ -12063,7 +12074,7 @@ var init_acceptanceReview = __esmMin((() => {
12063
12074
  })).max(8),
12064
12075
  title: string().max(300).optional(),
12065
12076
  url: string().url().max(2e3),
12066
- v: literal(1),
12077
+ v: literal$1(1),
12067
12078
  viewport: object$1({
12068
12079
  dpr: number$1().positive(),
12069
12080
  height: number$1().finite(),
@@ -12177,7 +12188,251 @@ var init_acceptanceReviewRound = __esmMin((() => {
12177
12188
 
12178
12189
  //#endregion
12179
12190
  //#region ../../packages/types/src/artboard.ts
12180
- var init_artboard = __esmMin((() => {}));
12191
+ var ARTBOARD_GROUP_KINDS, ARTBOARD_BOARD_TYPES, text$1, coordinate, size$1, artboardBoardSourceSchema, artboardBoardSourceInputSchema, ref, id, boardFields, groupFields, artboardOpSchema, formatArtboardResultLine;
12192
+ var init_artboard = __esmMin((() => {
12193
+ init_zod$1();
12194
+ ARTBOARD_GROUP_KINDS = [
12195
+ "journey",
12196
+ "options",
12197
+ "references",
12198
+ "other"
12199
+ ];
12200
+ ARTBOARD_BOARD_TYPES = [
12201
+ "html",
12202
+ "image",
12203
+ "video",
12204
+ "decision"
12205
+ ];
12206
+ text$1 = string();
12207
+ coordinate = number$1().finite();
12208
+ size$1 = number$1().finite().positive();
12209
+ artboardBoardSourceSchema = object$1({
12210
+ /** Version tag of the file (its object ETag); null while the file does not exist. */
12211
+ hash: string().min(1).nullable(),
12212
+ kind: literal$1("file"),
12213
+ path: string().min(1)
12214
+ });
12215
+ artboardBoardSourceInputSchema = object$1({
12216
+ kind: literal$1("file"),
12217
+ path: string().min(1)
12218
+ });
12219
+ ref = string().min(1).optional();
12220
+ id = string().min(1);
12221
+ boardFields = {
12222
+ expected: text$1.optional(),
12223
+ groupId: id.optional(),
12224
+ h: size$1.optional(),
12225
+ pageId: id.optional(),
12226
+ recommended: boolean().optional(),
12227
+ roundId: id.optional(),
12228
+ source: artboardBoardSourceInputSchema.optional(),
12229
+ title: text$1,
12230
+ type: _enum(ARTBOARD_BOARD_TYPES).optional(),
12231
+ w: size$1.optional(),
12232
+ x: coordinate,
12233
+ y: coordinate
12234
+ };
12235
+ groupFields = {
12236
+ desc: text$1.optional(),
12237
+ kind: _enum(ARTBOARD_GROUP_KINDS),
12238
+ pageId: id.optional(),
12239
+ title: text$1
12240
+ };
12241
+ artboardOpSchema = discriminatedUnion("type", [
12242
+ object$1({
12243
+ page: object$1({ name: text$1.min(1) }),
12244
+ ref,
12245
+ type: literal$1("addPage")
12246
+ }),
12247
+ object$1({
12248
+ id,
12249
+ patch: object$1({ name: text$1.min(1) }),
12250
+ type: literal$1("updatePage")
12251
+ }),
12252
+ object$1({
12253
+ id,
12254
+ type: literal$1("removePage")
12255
+ }),
12256
+ object$1({
12257
+ ref,
12258
+ round: object$1({
12259
+ batchId: id.optional(),
12260
+ pageId: id.optional(),
12261
+ title: text$1.min(1)
12262
+ }),
12263
+ type: literal$1("addRound")
12264
+ }),
12265
+ object$1({
12266
+ id,
12267
+ patch: object$1({ title: text$1.min(1) }),
12268
+ type: literal$1("updateRound")
12269
+ }),
12270
+ object$1({
12271
+ group: object$1(groupFields),
12272
+ ref,
12273
+ type: literal$1("addGroup")
12274
+ }),
12275
+ object$1({
12276
+ id,
12277
+ patch: object$1({
12278
+ desc: text$1,
12279
+ kind: _enum(ARTBOARD_GROUP_KINDS),
12280
+ title: text$1
12281
+ }).partial(),
12282
+ type: literal$1("updateGroup")
12283
+ }),
12284
+ object$1({
12285
+ id,
12286
+ type: literal$1("removeGroup")
12287
+ }),
12288
+ object$1({
12289
+ board: object$1(boardFields),
12290
+ ref,
12291
+ type: literal$1("addBoard")
12292
+ }),
12293
+ object$1({
12294
+ id,
12295
+ patch: object$1({
12296
+ ...boardFields,
12297
+ groupId: id.nullable(),
12298
+ roundId: id.nullable()
12299
+ }).omit({
12300
+ pageId: true,
12301
+ type: true
12302
+ }).partial(),
12303
+ type: literal$1("updateBoard")
12304
+ }),
12305
+ object$1({
12306
+ id,
12307
+ type: literal$1("removeBoard")
12308
+ }),
12309
+ object$1({
12310
+ edge: object$1({
12311
+ condition: text$1.optional(),
12312
+ from: id,
12313
+ isDefault: boolean().optional(),
12314
+ label: text$1.optional(),
12315
+ to: id
12316
+ }),
12317
+ ref,
12318
+ type: literal$1("addEdge")
12319
+ }),
12320
+ object$1({
12321
+ id,
12322
+ type: literal$1("removeEdge")
12323
+ }),
12324
+ object$1({
12325
+ boardId: id,
12326
+ expected: text$1,
12327
+ type: literal$1("setCheck")
12328
+ })
12329
+ ]);
12330
+ formatArtboardResultLine = ({ boardCount, groupCount, id: artboardId, revision }) => `artboard ${artboardId} · revision ${revision} · ${groupCount} groups · ${boardCount} boards`;
12331
+ }));
12332
+
12333
+ //#endregion
12334
+ //#region ../../packages/types/src/artboardFiles.ts
12335
+ var ARTBOARD_FILE_LIMITS, CONTENT_TYPES, TEXT_EXTENSIONS, SEGMENT, extensionOf, artboardFileContentType, isArtboardTextPath, normalizeArtboardFilePath, filePathSchema, artboardFileWriteSchema, artboardFileUploadsSchema, artboardFileEditSchema, artboardFileChangesSchema;
12336
+ var init_artboardFiles = __esmMin((() => {
12337
+ init_zod$1();
12338
+ ARTBOARD_FILE_LIMITS = {
12339
+ maxFiles: 500,
12340
+ maxImageBytes: 10 * 1024 * 1024,
12341
+ maxPathLength: 200,
12342
+ maxTextFileBytes: 512 * 1024,
12343
+ maxTotalBytes: 50 * 1024 * 1024
12344
+ };
12345
+ CONTENT_TYPES = {
12346
+ css: "text/css; charset=utf-8",
12347
+ gif: "image/gif",
12348
+ htm: "text/html; charset=utf-8",
12349
+ html: "text/html; charset=utf-8",
12350
+ jpeg: "image/jpeg",
12351
+ jpg: "image/jpeg",
12352
+ js: "text/javascript; charset=utf-8",
12353
+ json: "application/json; charset=utf-8",
12354
+ mjs: "text/javascript; charset=utf-8",
12355
+ png: "image/png",
12356
+ svg: "image/svg+xml",
12357
+ txt: "text/plain; charset=utf-8",
12358
+ webp: "image/webp",
12359
+ woff: "font/woff",
12360
+ woff2: "font/woff2"
12361
+ };
12362
+ TEXT_EXTENSIONS = new Set([
12363
+ "css",
12364
+ "htm",
12365
+ "html",
12366
+ "js",
12367
+ "json",
12368
+ "mjs",
12369
+ "svg",
12370
+ "txt"
12371
+ ]);
12372
+ SEGMENT = /^[\w.@-]+$/;
12373
+ extensionOf = (path) => {
12374
+ const name = path.slice(path.lastIndexOf("/") + 1);
12375
+ const dot = name.lastIndexOf(".");
12376
+ return dot > 0 ? name.slice(dot + 1).toLowerCase() : "";
12377
+ };
12378
+ artboardFileContentType = (path) => CONTENT_TYPES[extensionOf(path)];
12379
+ isArtboardTextPath = (path) => TEXT_EXTENSIONS.has(extensionOf(path));
12380
+ normalizeArtboardFilePath = (path) => {
12381
+ const trimmed = path.trim().replace(/^\.\//, "");
12382
+ if (!trimmed || trimmed.length > ARTBOARD_FILE_LIMITS.maxPathLength) return;
12383
+ if (trimmed.split("/").some((segment) => !SEGMENT.test(segment) || segment === "." || segment === "..")) return;
12384
+ if (!artboardFileContentType(trimmed)) return;
12385
+ return trimmed;
12386
+ };
12387
+ filePathSchema = string().min(1).max(ARTBOARD_FILE_LIMITS.maxPathLength + 2);
12388
+ artboardFileWriteSchema = union([
12389
+ object$1({
12390
+ content: string(),
12391
+ path: filePathSchema
12392
+ }).strict(),
12393
+ object$1({
12394
+ fileRef: string().min(1),
12395
+ path: filePathSchema
12396
+ }).strict(),
12397
+ object$1({
12398
+ base64: string().min(1),
12399
+ path: filePathSchema
12400
+ }).strict(),
12401
+ object$1({
12402
+ path: filePathSchema,
12403
+ uploaded: literal$1(true)
12404
+ }).strict(),
12405
+ object$1({
12406
+ fromCanvas: object$1({
12407
+ canvasId: string().min(1),
12408
+ version: number$1().int().positive().optional()
12409
+ }).strict(),
12410
+ path: filePathSchema
12411
+ }).strict()
12412
+ ]);
12413
+ artboardFileUploadsSchema = array(object$1({
12414
+ path: filePathSchema,
12415
+ size: number$1().int().nonnegative()
12416
+ }).strict()).min(1).max(ARTBOARD_FILE_LIMITS.maxFiles);
12417
+ artboardFileEditSchema = object$1({
12418
+ newText: string(),
12419
+ oldText: string().min(1),
12420
+ path: filePathSchema
12421
+ }).strict();
12422
+ artboardFileChangesSchema = object$1({
12423
+ deletes: array(filePathSchema).max(ARTBOARD_FILE_LIMITS.maxFiles).optional(),
12424
+ edits: array(artboardFileEditSchema).max(200).optional(),
12425
+ writes: array(artboardFileWriteSchema).max(ARTBOARD_FILE_LIMITS.maxFiles).optional()
12426
+ }).strict();
12427
+ }));
12428
+
12429
+ //#endregion
12430
+ //#region ../../packages/types/src/artboardPublish.ts
12431
+ var init_artboardPublish = __esmMin((() => {}));
12432
+
12433
+ //#endregion
12434
+ //#region ../../packages/types/src/artboardReadiness.ts
12435
+ var init_artboardReadiness = __esmMin((() => {}));
12181
12436
 
12182
12437
  //#endregion
12183
12438
  //#region ../../packages/types/src/connector.ts
@@ -12218,7 +12473,7 @@ var init_inboundWebhook = __esmMin((() => {
12218
12473
  remoteSubscriptionId: string().optional(),
12219
12474
  truncated: boolean().optional()
12220
12475
  }).strict();
12221
- McpEventsWebhookVerificationSchema = object$1({ scheme: literal("standard_webhooks") }).strict();
12476
+ McpEventsWebhookVerificationSchema = object$1({ scheme: literal$1("standard_webhooks") }).strict();
12222
12477
  GenericWebhookConfigSchema = object$1({
12223
12478
  autoApprove: boolean(),
12224
12479
  delivery: InboundWebhookChannelDeliverySchema.optional(),
@@ -12227,14 +12482,14 @@ var init_inboundWebhook = __esmMin((() => {
12227
12482
  topicId: string().min(1).optional()
12228
12483
  }).strict();
12229
12484
  GenericWebhookStateSchema = object$1({}).strict();
12230
- GenericWebhookVerificationSchema = object$1({ scheme: literal("bearer_token") }).strict();
12485
+ GenericWebhookVerificationSchema = object$1({ scheme: literal$1("bearer_token") }).strict();
12231
12486
  InboundWebhookDataSchema = discriminatedUnion("kind", [object$1({
12232
- kind: literal("mcp_events"),
12487
+ kind: literal$1("mcp_events"),
12233
12488
  config: McpEventsWebhookConfigSchema,
12234
12489
  state: McpEventsWebhookStateSchema,
12235
12490
  verification: McpEventsWebhookVerificationSchema
12236
12491
  }), object$1({
12237
- kind: literal("generic"),
12492
+ kind: literal$1("generic"),
12238
12493
  config: GenericWebhookConfigSchema,
12239
12494
  state: GenericWebhookStateSchema,
12240
12495
  verification: GenericWebhookVerificationSchema
@@ -12395,6 +12650,9 @@ var init_src$2 = __esmMin((() => {
12395
12650
  init_acceptanceReviewRound();
12396
12651
  init_agentRuntime();
12397
12652
  init_artboard();
12653
+ init_artboardFiles();
12654
+ init_artboardPublish();
12655
+ init_artboardReadiness();
12398
12656
  init_connector();
12399
12657
  init_connectorToolIdentifier();
12400
12658
  init_heteroPermissionMode();
@@ -18237,6 +18495,7 @@ const TRPC_NAMESPACE_API_KEY_RULES = {
18237
18495
  apiKey: "blocked",
18238
18496
  asr: { any: "model:invoke" },
18239
18497
  auth: "open",
18498
+ artboard: "blocked",
18240
18499
  artifactShare: rw("chat:read", null),
18241
18500
  botMessage: "blocked",
18242
18501
  brief: rw("chat:read", "chat:write"),
@@ -37586,6 +37845,7 @@ const uploadFileBuffer = async (client, { buffer, fileName, fileType }, options
37586
37845
  name: fileName,
37587
37846
  parentId: options.parentId,
37588
37847
  size: buffer.length,
37848
+ source: options.source,
37589
37849
  url: pathname
37590
37850
  });
37591
37851
  } catch (error) {
@@ -46454,8 +46714,8 @@ const AGENT_GRAPH_ROOT_NODE_ID = "__root__";
46454
46714
  const AgentGraphNodeSchema = discriminatedUnion("type", [object$1({
46455
46715
  allowedToolApiNames: array(string().min(1)).optional(),
46456
46716
  maxAgentSteps: number$1().int().positive().optional(),
46457
- type: literal("agent")
46458
- }), object$1({ type: literal("llm") })]);
46717
+ type: literal$1("agent")
46718
+ }), object$1({ type: literal$1("llm") })]);
46459
46719
  const AgentGraphFieldSchema = object$1({
46460
46720
  desc: string().min(1),
46461
46721
  schema: record(string(), unknown())
@@ -50784,6 +51044,833 @@ function registerAgentSignalCommand(program) {
50784
51044
  });
50785
51045
  }
50786
51046
 
51047
+ //#endregion
51048
+ //#region src/utils/desktopApp.ts
51049
+ const CHANNELS$1 = [
51050
+ "stable",
51051
+ "beta",
51052
+ "nightly"
51053
+ ];
51054
+ /** Matches `productName` in scripts/electronWorkflow/setDesktopVersion.ts. */
51055
+ const BUNDLE_NAMES = {
51056
+ beta: "LobeHub-Beta",
51057
+ nightly: "LobeHub-Nightly",
51058
+ stable: "LobeHub"
51059
+ };
51060
+ /** The shell command `lh app --install-cli` writes. */
51061
+ const CLI_SHIM_NAME = "lobehub";
51062
+ const SHIM_MARKER = "# installed by `lh app --install-cli`";
51063
+ const isDesktopChannel = (value) => CHANNELS$1.includes(value);
51064
+ const macBundleCandidates = (channel) => ["/Applications", path.join(os.homedir(), "Applications")].map((dir) => path.join(dir, `${BUNDLE_NAMES[channel]}.app`));
51065
+ /**
51066
+ * The executable inside a `.app`. `CFBundleExecutable` is not always the
51067
+ * product name (a downstream build may rename it), so fall back to reading the
51068
+ * single binary out of `Contents/MacOS` instead of guessing again.
51069
+ */
51070
+ const macExecutablePath = (bundlePath) => {
51071
+ const macosDir = path.join(bundlePath, "Contents", "MacOS");
51072
+ const named = path.join(macosDir, BUNDLE_NAMES.stable);
51073
+ if (existsSync(named)) return named;
51074
+ try {
51075
+ const binary = readdirSync(macosDir).find((entry) => {
51076
+ try {
51077
+ return statSync(path.join(macosDir, entry)).isFile();
51078
+ } catch {
51079
+ return false;
51080
+ }
51081
+ });
51082
+ return binary ? path.join(macosDir, binary) : null;
51083
+ } catch {
51084
+ return null;
51085
+ }
51086
+ };
51087
+ /**
51088
+ * Windows and Linux binary names are NOT derived from the channel's product
51089
+ * name. `electron-builder.mjs` pins `win.executableName` to a single constant
51090
+ * for every channel, while only the product (and therefore the install
51091
+ * directory) carries the suffix — so beta and nightly both ship
51092
+ * `LobeHub.exe` inside their own folder. Looking for `LobeHub-Beta.exe` finds
51093
+ * nothing and reports a missing installation.
51094
+ *
51095
+ * Linux leaves `executableName` unset, so the binary follows the product name;
51096
+ * the lowercase form covers a build that lowercased it.
51097
+ */
51098
+ const platformExecutableNames = (channel, platform = process.platform) => {
51099
+ if (platform === "win32") return ["LobeHub.exe"];
51100
+ if (platform === "linux") return [BUNDLE_NAMES[channel], BUNDLE_NAMES[channel].toLowerCase()];
51101
+ return [];
51102
+ };
51103
+ const toLocation = (channel, installPath, platform = process.platform) => {
51104
+ if (platform === "darwin") {
51105
+ const executablePath = macExecutablePath(installPath);
51106
+ return executablePath ? {
51107
+ channel,
51108
+ executablePath,
51109
+ installPath
51110
+ } : null;
51111
+ }
51112
+ for (const name of platformExecutableNames(channel, platform)) {
51113
+ const executablePath = path.join(installPath, name);
51114
+ if (existsSync(executablePath)) return {
51115
+ channel,
51116
+ executablePath,
51117
+ installPath
51118
+ };
51119
+ }
51120
+ return null;
51121
+ };
51122
+ const candidateInstallPaths = (channel) => {
51123
+ if (process.platform === "darwin") return macBundleCandidates(channel);
51124
+ const name = BUNDLE_NAMES[channel];
51125
+ if (process.platform === "win32") {
51126
+ const localAppData = process.env.LOCALAPPDATA ?? path.join(os.homedir(), "AppData", "Local");
51127
+ return [path.join(localAppData, "Programs", name), path.join(localAppData, name)];
51128
+ }
51129
+ return [
51130
+ `/opt/${name}`,
51131
+ path.join(os.homedir(), ".local", "opt", name),
51132
+ `/usr/lib/${name}`
51133
+ ];
51134
+ };
51135
+ /**
51136
+ * Find an installed desktop build.
51137
+ *
51138
+ * `LOBEHUB_DESKTOP_PATH` short-circuits the search so a dev build, a
51139
+ * white-label bundle, or a copy in `~/Downloads` can be used without teaching
51140
+ * the CLI every layout. It accepts either the bundle and the executable.
51141
+ */
51142
+ const resolveDesktopApp = (channel, env = process.env) => {
51143
+ const override = env.LOBEHUB_DESKTOP_PATH;
51144
+ if (override) {
51145
+ const located = locateFromOverride(override, channel ?? "stable");
51146
+ if (located) return located;
51147
+ }
51148
+ for (const candidateChannel of channel ? [channel] : CHANNELS$1) for (const installPath of candidateInstallPaths(candidateChannel)) {
51149
+ if (!existsSync(installPath)) continue;
51150
+ const located = toLocation(candidateChannel, installPath);
51151
+ if (located) return located;
51152
+ }
51153
+ return null;
51154
+ };
51155
+ const locateFromOverride = (override, channel) => {
51156
+ const absolute = path.resolve(override);
51157
+ if (!existsSync(absolute)) return null;
51158
+ if (statSync(absolute).isDirectory() && absolute.endsWith(".app")) return toLocation(channel, absolute);
51159
+ return {
51160
+ channel,
51161
+ executablePath: absolute,
51162
+ installPath: path.dirname(absolute)
51163
+ };
51164
+ };
51165
+ /**
51166
+ * Scheme the installed build answers to — a nightly and a stable install
51167
+ * coexist on one machine, and each handoff has to address its own.
51168
+ */
51169
+ const schemeFor = (location) => location.channel === "stable" ? "lobehub" : `lobehub-${location.channel}`;
51170
+ /**
51171
+ * Start the app detached and return as soon as it is running.
51172
+ *
51173
+ * NOT `--wait`: unlike an editor, the app is the session — blocking the shell
51174
+ * until the user quits would leave every terminal that ran `lh app` hanging.
51175
+ */
51176
+ const launchDesktopApp = (location, args) => new Promise((resolve, reject) => {
51177
+ const child = spawn(location.executablePath, args, {
51178
+ detached: true,
51179
+ stdio: "ignore"
51180
+ });
51181
+ child.once("error", reject);
51182
+ child.once("spawn", () => {
51183
+ child.unref();
51184
+ resolve();
51185
+ });
51186
+ });
51187
+ /** Where the shim goes: next to the running `lh`, else `~/.local/bin`. */
51188
+ const resolveShimDirectory = (env = process.env) => {
51189
+ const cliDir = env.LOBE_CLI_SHIM_DIR;
51190
+ if (cliDir) return path.resolve(cliDir);
51191
+ return path.join(os.homedir(), ".local", "bin");
51192
+ };
51193
+ const resolveShimPath = (env = process.env) => path.join(resolveShimDirectory(env), CLI_SHIM_NAME);
51194
+ /**
51195
+ * Write a one-line `lobehub` launcher.
51196
+ *
51197
+ * It execs the bundle's executable instead of symlinking to it: a symlink
51198
+ * pins whatever channel happened to be installed at the time, so switching
51199
+ * from nightly to stable would silently keep launching the old build.
51200
+ */
51201
+ const installShim = (location, env = process.env) => {
51202
+ const shimPath = resolveShimPath(env);
51203
+ mkdirSync(path.dirname(shimPath), { recursive: true });
51204
+ if (existsSync(shimPath)) {
51205
+ const existing = readFileSafe(shimPath);
51206
+ if (existing !== null && !existing.includes(SHIM_MARKER)) return {
51207
+ path: shimPath,
51208
+ written: false
51209
+ };
51210
+ }
51211
+ writeFileSync(shimPath, [
51212
+ "#!/bin/sh",
51213
+ SHIM_MARKER,
51214
+ `exec "${location.executablePath}" "$@"`,
51215
+ ""
51216
+ ].join("\n"), "utf8");
51217
+ chmodSync(shimPath, 493);
51218
+ return {
51219
+ path: shimPath,
51220
+ written: true
51221
+ };
51222
+ };
51223
+ const uninstallShim = (env = process.env) => {
51224
+ const shimPath = resolveShimPath(env);
51225
+ if (!existsSync(shimPath)) return false;
51226
+ const existing = readFileSafe(shimPath);
51227
+ if (existing === null || !existing.includes(SHIM_MARKER)) return false;
51228
+ rmSync(shimPath);
51229
+ return true;
51230
+ };
51231
+ const readFileSafe = (filePath) => {
51232
+ try {
51233
+ return readFileSync(filePath, "utf8");
51234
+ } catch {
51235
+ return null;
51236
+ }
51237
+ };
51238
+
51239
+ //#endregion
51240
+ //#region src/commands/app.ts
51241
+ /**
51242
+ * Canonicalize the directory a launch should open.
51243
+ *
51244
+ * Resolving here, in the invoking shell's process, is what makes the feature
51245
+ * work at all: the app itself may be started by launchd with `/` as its
51246
+ * working directory, so a relative `.` would mean nothing by the time it is
51247
+ * read on the other side.
51248
+ */
51249
+ const resolveLaunchDirectory = (input = ".") => {
51250
+ const absolute = path.resolve(input);
51251
+ if (!existsSync(absolute)) return null;
51252
+ if (!statSync(absolute).isDirectory()) return null;
51253
+ try {
51254
+ return realpathSync(absolute);
51255
+ } catch {
51256
+ return null;
51257
+ }
51258
+ };
51259
+ const describeMissingApp = (channel) => {
51260
+ return [
51261
+ `No ${channel ? `${channel} channel of ` : ""}LobeHub Desktop installation was found.`,
51262
+ "",
51263
+ " Install the desktop app, or point at a build explicitly:",
51264
+ ` ${import_picocolors.default.bold("LOBEHUB_DESKTOP_PATH=/path/to/LobeHub.app")} lh app .`,
51265
+ "",
51266
+ ` Check what is installed: ${import_picocolors.default.bold("lh app --scheme")}`
51267
+ ].join("\n");
51268
+ };
51269
+ const runInstallCli = (location, options) => {
51270
+ const result = installShim(location);
51271
+ if (options.json !== void 0) return outputJson({
51272
+ ...result,
51273
+ executablePath: location.executablePath
51274
+ }, options.json);
51275
+ if (!result.written) {
51276
+ log$15.error(`Refusing to overwrite ${result.path} — it was not written by LobeHub.`);
51277
+ process.exitCode = 1;
51278
+ return;
51279
+ }
51280
+ console.log(`Installed ${import_picocolors.default.bold(result.path)} → ${import_picocolors.default.dim(location.executablePath)}`);
51281
+ console.log(`\nNow run ${import_picocolors.default.bold("lobehub .")} to open a directory.`);
51282
+ if (!(process.env.PATH ?? "").split(path.delimiter).includes(path.dirname(result.path))) console.log(import_picocolors.default.yellow(`\n Note: ${path.dirname(result.path)} is not on your PATH.`), `\n Add it in your shell profile to use the command from anywhere.`);
51283
+ };
51284
+ function registerAppCommand(program) {
51285
+ program.command("app [path]").description("Open a directory in LobeHub Desktop (like `code .`)").option("-n, --new-window", "Start a new conversation instead of revealing the existing one").option("--channel <channel>", "Which installed build to use (stable, beta, nightly)").option("--scheme", "Print the deep-link scheme of the installed build").option("--install-cli", "Install the `lobehub` shell command").option("--uninstall-cli", "Remove the `lobehub` shell command").option("--dry-run", "Print what would be launched without starting it").option("--json [fields]", "Output JSON").action(async (pathArg, options) => {
51286
+ const channel = options.channel && isDesktopChannel(options.channel) ? options.channel : void 0;
51287
+ if (options.channel && !channel) {
51288
+ log$15.error(`Unknown channel "${options.channel}". Use stable, beta, or nightly.`);
51289
+ process.exitCode = 1;
51290
+ return;
51291
+ }
51292
+ if (options.uninstallCli) {
51293
+ const removed = uninstallShim();
51294
+ if (options.json !== void 0) return outputJson({ removed }, options.json);
51295
+ console.log(removed ? "Removed the `lobehub` command." : "No `lobehub` command to remove.");
51296
+ return;
51297
+ }
51298
+ const location = resolveDesktopApp(channel);
51299
+ if (!location) {
51300
+ log$15.error(describeMissingApp(channel));
51301
+ process.exitCode = 1;
51302
+ return;
51303
+ }
51304
+ if (options.installCli) return runInstallCli(location, options);
51305
+ if (options.scheme) {
51306
+ if (options.json !== void 0) return outputJson({
51307
+ channel: location.channel,
51308
+ executablePath: location.executablePath,
51309
+ scheme: schemeFor(location)
51310
+ }, options.json);
51311
+ console.log(schemeFor(location));
51312
+ return;
51313
+ }
51314
+ const target = pathArg ?? ".";
51315
+ const directory = resolveLaunchDirectory(target);
51316
+ if (!directory) {
51317
+ log$15.error(`Not a directory: ${target}`);
51318
+ process.exitCode = 1;
51319
+ return;
51320
+ }
51321
+ const args = [directory];
51322
+ if (options.newWindow) args.push("--new-window");
51323
+ if (options.dryRun) {
51324
+ if (options.json !== void 0) return outputJson({
51325
+ args,
51326
+ channel: location.channel,
51327
+ executablePath: location.executablePath
51328
+ }, options.json);
51329
+ console.log(`${location.executablePath} ${args.join(" ")}`);
51330
+ return;
51331
+ }
51332
+ await launchDesktopApp(location, args);
51333
+ if (options.json !== void 0) return outputJson({
51334
+ channel: location.channel,
51335
+ opened: directory
51336
+ }, options.json);
51337
+ log$15.info(`Opened ${import_picocolors.default.bold(directory)} in LobeHub Desktop`);
51338
+ });
51339
+ }
51340
+
51341
+ //#endregion
51342
+ //#region src/commands/artboardComments.ts
51343
+ const runAgentId = () => {
51344
+ const id = process.env.LOBEHUB_AGENT_ID?.trim();
51345
+ if (!id) throw new Error("Comments are answered by the agent of a LobeHub conversation, and LOBEHUB_AGENT_ID is not set in this shell");
51346
+ return id;
51347
+ };
51348
+ const placeOf = (thread, content) => {
51349
+ const board = content.boards.find((item) => item.id === thread.boardId);
51350
+ if (board) return `board ${board.id} "${board.title}"`;
51351
+ const group = content.groups.find((item) => item.id === thread.groupId);
51352
+ if (group) return `group ${group.id} "${group.title}"`;
51353
+ const page = content.pages.find((item) => item.id === thread.pageId);
51354
+ return page ? `page ${page.id} "${page.name}"` : "the canvas";
51355
+ };
51356
+ const speaker = (comment) => comment.authorAgentId ? "you" : "user";
51357
+ const formatThread = (thread, content) => {
51358
+ const tags = [
51359
+ thread.unread && "new",
51360
+ thread.resolvedAt && "resolved",
51361
+ thread.stale && "screen changed since"
51362
+ ].filter(Boolean);
51363
+ return [`${thread.id} on ${placeOf(thread, content)}${tags.length ? ` [${tags.join(", ")}]` : ""}`, ...[thread, ...thread.replies].map((comment) => ` ${speaker(comment)}: ${comment.content}`)].join("\n");
51364
+ };
51365
+ const textOf = (words) => {
51366
+ const text = words.join(" ").trim();
51367
+ if (!text) throw new Error("Write the text after the id");
51368
+ return text;
51369
+ };
51370
+ const registerArtboardCommentCommands = (artboard) => {
51371
+ artboard.command("comments <id>").description("Print the user's comment threads waiting for you, with their ids; the ones printed count as read").option("--json", "Print structured JSON").action(async (id, options) => {
51372
+ const agentId = runAgentId();
51373
+ const client = await getTrpcClient();
51374
+ const [threads, { artboard: board }] = await Promise.all([client.artboard.takeComments.mutate({
51375
+ agentId,
51376
+ id
51377
+ }), client.artboard.read.query({ id })]);
51378
+ if (options.json) return outputJson(threads);
51379
+ if (!threads.length) return console.log("No comment threads are waiting for you");
51380
+ console.log(threads.map((thread) => formatThread(thread, board.content)).join("\n\n"));
51381
+ });
51382
+ artboard.command("reply <commentId> <text...>").description("Answer a comment thread on the artboard").action(async (commentId, words) => {
51383
+ const agentId = runAgentId();
51384
+ await (await getTrpcClient()).artboard.replyAsAgent.mutate({
51385
+ agentId,
51386
+ commentId,
51387
+ content: textOf(words)
51388
+ });
51389
+ console.log(`replied in ${commentId}`);
51390
+ });
51391
+ artboard.command("resolve <commentId>").description("Close a thread once what it asks for is done, or once your question in it is answered").action(async (commentId) => {
51392
+ await (await getTrpcClient()).artboard.resolveComment.mutate({ commentId });
51393
+ console.log(`resolved ${commentId}`);
51394
+ });
51395
+ artboard.command("ask <id> <text...>").description("Ask the user a question on the artboard as a new thread; the artboard cannot be finalized while it is open").option("--board <boardId>", "Board the question is about").option("--group <groupId>", "Group the question is about").option("--page <pageId>", "Page the question is about").action(async (id, words, options) => {
51396
+ const agentId = runAgentId();
51397
+ const question = await (await getTrpcClient()).artboard.askQuestion.mutate({
51398
+ agentId,
51399
+ boardId: options.board,
51400
+ content: textOf(words),
51401
+ groupId: options.group,
51402
+ id,
51403
+ pageId: options.page
51404
+ });
51405
+ console.log(`asked ${question.id}`);
51406
+ });
51407
+ };
51408
+
51409
+ //#endregion
51410
+ //#region src/commands/artboardOps.ts
51411
+ init_src$2();
51412
+ init_zod$1();
51413
+ const literal = (value) => JSON.stringify(value);
51414
+ const renderNode = (node) => {
51415
+ if (node.const !== void 0) return literal(node.const);
51416
+ if (node.enum) return node.enum.map(literal).join(" | ");
51417
+ const variants = node.oneOf ?? node.anyOf;
51418
+ if (variants) return variants.map(renderNode).join(" | ");
51419
+ if (node.type === "object" && node.properties) return renderObject(node);
51420
+ if (node.type === "integer") return "number";
51421
+ return node.type ?? "unknown";
51422
+ };
51423
+ const renderObject = (node) => {
51424
+ const required = new Set(node.required);
51425
+ const rank = ([key, value]) => value.const !== void 0 ? 0 : required.has(key) ? 1 : 2;
51426
+ return `{ ${Object.entries(node.properties).map((entry, index) => ({
51427
+ entry,
51428
+ index,
51429
+ rank: rank(entry)
51430
+ })).sort((a, b) => a.rank - b.rank || a.index - b.index).map(({ entry: [key, value] }) => `"${key}"${required.has(key) ? "" : "?"}: ${renderNode(value)}`).join(", ")} }`;
51431
+ };
51432
+ const NOTES = [
51433
+ "--ops takes a JSON array of these, inline or as @file.json. Every op in one call applies, or none does.",
51434
+ "A field marked ? is optional.",
51435
+ "\"ref\" is a name you choose on an add op; later ops in the same call can use it wherever an id is expected.",
51436
+ "x and y are page coordinates; w and h default to 640×400. A board without pageId lands on the page of its group or round, otherwise on the first page.",
51437
+ "A file source names a file of the artboard: put it there with `lh artboard push <id> <dir>` or --files, then point the board at its relative path.",
51438
+ "A board of type \"decision\" has no source and no \"expected\". An .html file makes an \"html\" board and an image file an \"image\" board; \"video\" is refused.",
51439
+ "\"recommended\" marks a board as the option you would pick in its round; it needs \"roundId\", and a board with a \"roundId\" must sit in an options group."
51440
+ ];
51441
+ const opsAction = (options) => {
51442
+ const schema = toJSONSchema(artboardOpSchema);
51443
+ if (options.json) return outputJson(schema);
51444
+ console.log("Ops accepted by `lh artboard create --ops` and `lh artboard update --ops`:\n");
51445
+ for (const op of schema.oneOf ?? schema.anyOf ?? []) console.log(` ${renderNode(op)}\n`);
51446
+ for (const note of NOTES) console.log(`- ${note}`);
51447
+ };
51448
+ const registerArtboardOpsCommand = (artboard) => {
51449
+ artboard.command("ops").description("Print the shape of every op that create and update accept").option("--json", "Print the ops as JSON Schema").action(opsAction);
51450
+ };
51451
+
51452
+ //#endregion
51453
+ //#region src/commands/artboardPush.ts
51454
+ init_src$2();
51455
+ /**
51456
+ * Encoded JSON size of one writeFiles request. Vercel rejects bodies over 4.5 MB
51457
+ * and tRPC can batch other calls into the same request, so stay at 2 MB like
51458
+ * the web client's message write batcher.
51459
+ */
51460
+ const BATCH_BYTES = 2 * 1024 * 1024;
51461
+ const encodedBytes = (value) => Buffer.byteLength(JSON.stringify(value));
51462
+ const toLocalArtboardFile = (relative, bytes) => ({
51463
+ bytes,
51464
+ hash: createHash("md5").update(bytes).digest("hex"),
51465
+ path: relative
51466
+ });
51467
+ const putBlob = async (file, upload) => {
51468
+ const response = await fetch(upload.url, {
51469
+ body: file.bytes,
51470
+ headers: upload.headers,
51471
+ method: "PUT"
51472
+ }).catch((error) => {
51473
+ throw new Error(`Upload of ${file.path} failed: ${error?.message ?? String(error)}`);
51474
+ });
51475
+ if (!response.ok) throw new Error(`Upload of ${file.path} failed: ${response.status} ${response.statusText}`);
51476
+ };
51477
+ /**
51478
+ * Writes files to an artboard in requests of at most 2 MB encoded. A file too
51479
+ * large for one request is PUT to its path through a presigned URL first and
51480
+ * then committed as uploaded.
51481
+ */
51482
+ const writeArtboardFiles = async (api, id, files) => {
51483
+ const envelope = encodedBytes({
51484
+ files: { writes: [] },
51485
+ id
51486
+ });
51487
+ const writes = [];
51488
+ const large = [];
51489
+ for (const file of files) {
51490
+ const write = isArtboardTextPath(file.path) ? {
51491
+ content: file.bytes.toString("utf8"),
51492
+ path: file.path
51493
+ } : {
51494
+ base64: file.bytes.toString("base64"),
51495
+ path: file.path
51496
+ };
51497
+ if (envelope + encodedBytes(write) > BATCH_BYTES) large.push(file);
51498
+ else writes.push(write);
51499
+ }
51500
+ if (large.length) {
51501
+ const { uploads } = await api.prepareFileUploads.mutate({
51502
+ files: large.map((file) => ({
51503
+ path: file.path,
51504
+ size: file.bytes.byteLength
51505
+ })),
51506
+ id
51507
+ });
51508
+ const byPath = new Map(uploads.map((upload) => [upload.path, upload]));
51509
+ for (const file of large) {
51510
+ const upload = byPath.get(file.path);
51511
+ if (!upload) throw new Error(`Upload of ${file.path} failed: the server returned no upload URL`);
51512
+ await putBlob(file, upload);
51513
+ writes.push({
51514
+ path: file.path,
51515
+ uploaded: true
51516
+ });
51517
+ }
51518
+ }
51519
+ let batch = [];
51520
+ let batchBytes = envelope;
51521
+ for (const write of writes) {
51522
+ const bytes = encodedBytes(write) + 1;
51523
+ if (batch.length && batchBytes + bytes > BATCH_BYTES) {
51524
+ await api.writeFiles.mutate({
51525
+ files: { writes: batch },
51526
+ id
51527
+ });
51528
+ batch = [];
51529
+ batchBytes = envelope;
51530
+ }
51531
+ batch.push(write);
51532
+ batchBytes += bytes;
51533
+ }
51534
+ if (batch.length) await api.writeFiles.mutate({
51535
+ files: { writes: batch },
51536
+ id
51537
+ });
51538
+ };
51539
+ const listLocal = (root, dir = root) => fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
51540
+ if (entry.name.startsWith(".")) return [];
51541
+ const full = path.join(dir, entry.name);
51542
+ if (entry.isDirectory()) return listLocal(root, full);
51543
+ return entry.isFile() ? [path.relative(root, full).split(path.sep).join("/")] : [];
51544
+ });
51545
+ const pushArtboardDir = async (api, id, dir, options) => {
51546
+ const remote = new Map((await api.listFiles.query({ id })).map((file) => [file.path, file.hash]));
51547
+ const result = {
51548
+ deleted: [],
51549
+ skipped: [],
51550
+ unchanged: [],
51551
+ uploaded: []
51552
+ };
51553
+ const local = /* @__PURE__ */ new Set();
51554
+ const changed = [];
51555
+ for (const relative of listLocal(dir).sort()) {
51556
+ const normalized = normalizeArtboardFilePath(relative);
51557
+ if (!normalized) {
51558
+ result.skipped.push(relative);
51559
+ continue;
51560
+ }
51561
+ local.add(normalized);
51562
+ const file = toLocalArtboardFile(normalized, fs.readFileSync(path.join(dir, relative)));
51563
+ if (remote.get(normalized) === file.hash) {
51564
+ result.unchanged.push(normalized);
51565
+ continue;
51566
+ }
51567
+ changed.push(file);
51568
+ result.uploaded.push(normalized);
51569
+ }
51570
+ await writeArtboardFiles(api, id, changed);
51571
+ if (options.prune) {
51572
+ const missing = [...remote.keys()].filter((file) => !local.has(file));
51573
+ if (missing.length) {
51574
+ await api.writeFiles.mutate({
51575
+ files: { deletes: missing },
51576
+ id
51577
+ });
51578
+ result.deleted = missing;
51579
+ }
51580
+ }
51581
+ return result;
51582
+ };
51583
+
51584
+ //#endregion
51585
+ //#region src/commands/artboardSkillContent.ts
51586
+ const artboardSkillDescription = "Lay out a feature or requirement on a LobeHub artboard so the user decides on the canvas. Use when the user wants to discuss, explore, shape or confirm a feature or requirement and this session runs inside a LobeHub project conversation (`LOBEHUB_TOPIC_ID` is set). In that case this skill takes the place of a generic brainstorming or requirements skill: the open decisions go on the artboard as choices, not into a run of questions in chat. Not for bug fixes, small or already specified changes, or questions about existing code.";
51587
+ const artboardSkillBody = `# Requirement artboard
51588
+
51589
+ An artboard is a canvas in the user's LobeHub project. You lay a requirement out on it: the screens, the flow between them, and the decisions you are unsure of as choices. The user picks on the canvas and submits; you carry on from their picks. You work on it through the \`lh\` CLI, which is already installed and signed in for this run.
51590
+
51591
+ ## 1. Check first
51592
+
51593
+ - \`LOBEHUB_TOPIC_ID\` is set: this session runs inside a LobeHub conversation.
51594
+ - \`lh artboard --help\` prints the artboard commands.
51595
+
51596
+ If either fails, or \`lh artboard create\` is refused, say so in one line and hold the discussion in chat the way you normally would. Do not install or upgrade \`lh\`.
51597
+
51598
+ ## 2. Read before you draw
51599
+
51600
+ Read the repository for the data and the screens the requirement touches, so the artboard starts from what exists. Change no code while the requirement is being discussed.
51601
+
51602
+ ## 3. Lay it out
51603
+
51604
+ Run \`lh man artboard\` for the exact flags and \`lh artboard ops\` for the shape of every op; both come from the installed CLI and are not repeated here. One requirement gets one artboard: \`lh artboard create\` makes it for this conversation's project, \`lh artboard list\` shows the ones that already exist.
51605
+
51606
+ **Screens.** A board shows a screen. Write each screen as a plain HTML page, a real screen of the product at the board's size with its own layout, colors, type and inline SVG, in a folder laid out like the artboard (for example \`pages/checkout/a.html\`, shared CSS in \`shared/base.css\`, screenshots in \`shots/\`, all referenced by relative paths). A board points at its page with source \`{"kind":"file","path":"pages/checkout/a.html"}\`; the file may not be written yet, and the board shows the page as soon as it is. Build the artboard in this order, so the user watches it fill in:
51607
+
51608
+ 1. Lay out the whole structure first: one \`lh artboard create --ops\` (or \`lh artboard update --ops\` on an artboard that exists) with the pages, groups, edges and every board, each board's source pointing at the path its page will have although that file is not written yet.
51609
+ 2. Then write the pages one board at a time with \`lh artboard files write <id> <path> --from <file>\` (or from stdin), each as soon as it is ready, so the boards appear one by one. Write the shared CSS and images a page uses before the page.
51610
+ 3. \`lh artboard push <id> <dir>\` re-syncs a whole folder later: it uploads only the files that changed, and with \`--prune\` deletes the artboard files that are no longer in the folder.
51611
+
51612
+ - a page cannot fetch or open network connections; https images, fonts, styles and scripts load;
51613
+ - to change a screen, write its file again: every board showing it updates and comments on it are marked outdated;
51614
+ - \`lh artboard files list <id>\`, \`lh artboard files read <id> <path>\` and \`lh artboard files rm <id> <path>\` list, print and remove files; a board whose file is removed stays and shows the page again once it is written;
51615
+ - a screenshot of the current product can be an image board: write it under \`shots/\` and point a board at it.
51616
+
51617
+ A board of type "decision" needs no source.
51618
+
51619
+ If no screen can be made (writing the files is refused or times out), tell the user in one line which step failed and hold the discussion in chat. Never stand a decision board or a text card in for a screen: a decision board marks where the journey branches and shows only a short title.
51620
+
51621
+ **Layout.**
51622
+
51623
+ - An artboard has pages; each page has its own coordinates. Use a second page when the choices would crowd the flow.
51624
+ - Group the boards: one journey group for the flow the user will accept, and separate groups for options and references.
51625
+ - In the journey group one board is one page state. Edges connect boards. The journey has exactly one starting screen, the only journey board no edge points to, and every other journey board is reached from it. No edge may point back to it: a way back to the start belongs in that screen's acceptance check. A journey that breaks this cannot be finalized. Label an edge, in at most four words, only when the two screens do not already show what the user does to get there.
51626
+ - Where the flow branches, add a decision board, give each edge leaving it a condition, and mark the fallback branch as the default.
51627
+ - Give every journey board an acceptance check: what the user must see on that page. A decision board takes none; one that carries a check is refused.
51628
+ - You place every board; the user cannot move them. Boards are 640×400 unless you set a size. Leave 80 between boards in a row and lay a journey out left to right.
51629
+ - A frame is drawn around each group (144 above its boards, 48 on the other sides). Leave 240 between the boards of two groups stacked vertically and 200 between groups side by side, measured from the lowest and rightmost board of a group. An update whose group frames overlap is refused.
51630
+
51631
+ **Choices.** Every decision you are not sure of becomes a round:
51632
+
51633
+ - add a round whose title is the question, then add each alternative as a board that carries that round's id and sits in an options group, and mark the one you would pick as recommended;
51634
+ - one options group holds the options of exactly one round;
51635
+ - the user submits every open round at once, so open only the rounds you want answered now.
51636
+
51637
+ **Comments and questions.** The user comments on boards, groups and pages. Answer them on the artboard, not only in chat:
51638
+
51639
+ - \`lh artboard comments <id>\` prints the threads waiting for you, each with its id and what it is on; the ones printed count as read;
51640
+ - \`lh artboard reply <commentId> <text>\` answers a thread, and \`lh artboard resolve <commentId>\` closes it once what it asks for is done;
51641
+ - to ask about one screen, group or page, use \`lh artboard ask <id> --board <boardId> <question>\` (or \`--group\`, \`--page\`) instead of asking in chat. The user answers in that thread, and the artboard cannot be finalized while your question is open: resolve it once you have the answer.
51642
+
51643
+ ## 4. Hand over
51644
+
51645
+ Reply with what is on the artboard and what is waiting for the user's choice. Do not ask the same questions again in chat. A question about something on the artboard goes there with \`lh artboard ask\`; ask in your reply only what concerns no screen.
51646
+
51647
+ ## 5. After the user submits
51648
+
51649
+ The picks and the user's new comments arrive as one message in this conversation. Then:
51650
+
51651
+ 1. \`lh artboard read <id>\` to see each round's chosen board; a round the user left unpicked takes your recommendation.
51652
+ 2. \`lh artboard comments <id>\` for the threads and their ids; the user's answers to your questions are there too.
51653
+ 3. Apply the picks and what the comments ask for in one \`lh artboard update\`.
51654
+ 4. Reply in each thread with what you changed, then resolve the threads that are done and the questions that are answered.
51655
+ 5. Open the next rounds if something is still undecided; otherwise say the requirement is settled and what was decided.
51656
+
51657
+ ## 6. After the user finalizes
51658
+
51659
+ Finalizing turns the journey into an acceptance. The message that arrives carries its link, and \`lh artboard read <id> --json\` gives its \`acceptanceId\`. Its flow is already published: one check per journey board, whose expected result is that board's acceptance check. Then:
51660
+
51661
+ 1. Build the journey in this repository.
51662
+ 2. Verify it with the acceptance skill (\`lh acceptance install\` adds it to \`.agents/skills\` when it is missing), on that acceptance and its published flow: \`lh acceptance flow plan <acceptanceId>\` opens a round, \`lh acceptance flow record\` records each check's verdict, \`lh acceptance run evidence upload\` attaches a screenshot of the page to it, and \`lh acceptance flow complete\` closes the round. Do not publish another flow or create another acceptance: the artboard shows only this one.
51663
+ 3. Reply with the acceptance link and which checks passed or failed. Each journey board on the artboard then shows its check's result and screenshot.
51664
+
51665
+ ## Editing rules
51666
+
51667
+ - \`lh artboard update\` needs the revision you last read. If it is refused as stale, read again and redo the change on the new revision.
51668
+ - Every op in one update applies, or none does.
51669
+ - Use only ids the CLI returned; never invent one. Inside one call, give an added item a ref so later ops can point at it.
51670
+ - After the artboard is finalized, the journey group's boards, edges and checks are locked; other groups can still change.
51671
+ `;
51672
+
51673
+ //#endregion
51674
+ //#region src/commands/artboardSkill.ts
51675
+ const ARTBOARD_SKILL_ID = "lobehub-artboard";
51676
+ const VERSION_LINE = /^\s+version:\s*["']?(\d+)\.(\d+)\.(\d+)/m;
51677
+ const renderSkill = (version) => [
51678
+ "---",
51679
+ `name: ${ARTBOARD_SKILL_ID}`,
51680
+ `description: ${JSON.stringify(artboardSkillDescription)}`,
51681
+ "metadata:",
51682
+ ` version: ${JSON.stringify(version)}`,
51683
+ "---",
51684
+ "",
51685
+ artboardSkillBody
51686
+ ].join("\n");
51687
+ const versionParts = (text) => {
51688
+ const match = /^(\d+)\.(\d+)\.(\d+)/.exec(text);
51689
+ return match ? match.slice(1).map(Number) : void 0;
51690
+ };
51691
+ const installedVersion = (skillFile) => {
51692
+ if (!existsSync(skillFile)) return void 0;
51693
+ const match = VERSION_LINE.exec(readFileSync(skillFile, "utf8"));
51694
+ return match ? match.slice(1, 4).join(".") : void 0;
51695
+ };
51696
+ const isNewer = (installed, current) => {
51697
+ const a = installed && versionParts(installed);
51698
+ const b = versionParts(current);
51699
+ if (!a || !b) return false;
51700
+ for (let index = 0; index < 3; index += 1) if (a[index] !== b[index]) return a[index] > b[index];
51701
+ return false;
51702
+ };
51703
+ const listFiles = (directory) => {
51704
+ if (!existsSync(directory)) return [];
51705
+ return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
51706
+ const entryPath = path.join(directory, entry.name);
51707
+ return entry.isDirectory() ? listFiles(entryPath) : [entryPath];
51708
+ });
51709
+ };
51710
+ const printLinks = (links) => {
51711
+ const arrow = import_picocolors.default.dim(" ↳");
51712
+ for (const link of links) if (link.kind === "linked" || link.kind === "linked-single") console.log(`${arrow} linked ${link.link} → ${import_picocolors.default.dim(link.target)}`);
51713
+ else if (link.kind === "already") console.log(`${arrow} ${import_picocolors.default.dim(`${link.link} already linked`)}`);
51714
+ else if (link.kind === "skipped") console.log(`${arrow} ${import_picocolors.default.yellow(`skipped ${link.link}: ${link.reason}`)}`);
51715
+ else console.log(`${arrow} ${import_picocolors.default.dim("no harness dirs detected — agents that read .agents/skills pick it up automatically")}`);
51716
+ };
51717
+ const initAction = (options) => {
51718
+ const baseDir = options.dir ? path.resolve(options.dir) : process.cwd();
51719
+ const skillDir = path.join(baseDir, AGENTS_SKILLS_DIR, ARTBOARD_SKILL_ID);
51720
+ const skillFile = path.join(skillDir, "SKILL.md");
51721
+ if (lstatSync(skillDir, { throwIfNoEntry: false })?.isSymbolicLink()) throw new Error(`${skillDir} is a symbolic link; remove it or point --dir at the repository that owns the skill`);
51722
+ const installed = installedVersion(skillFile);
51723
+ if (isNewer(installed, cliVersion)) {
51724
+ const result = {
51725
+ dir: skillDir,
51726
+ installedVersion: installed,
51727
+ links: [],
51728
+ removed: [],
51729
+ skill: ARTBOARD_SKILL_ID,
51730
+ status: "newer-installed",
51731
+ version: cliVersion,
51732
+ written: []
51733
+ };
51734
+ if (options.json) return outputJson(result);
51735
+ console.log(`${import_picocolors.default.yellow("!")} ${ARTBOARD_SKILL_ID} v${installed} is already installed and this lh is v${cliVersion}; nothing changed`);
51736
+ return;
51737
+ }
51738
+ const removed = listFiles(skillDir).filter((file) => file !== skillFile).map((file) => {
51739
+ rmSync(file, { force: true });
51740
+ return path.relative(skillDir, file).split(path.sep).join("/");
51741
+ });
51742
+ mkdirSync(skillDir, { recursive: true });
51743
+ writeFileSync(skillFile, renderSkill(cliVersion), "utf8");
51744
+ const links = linkHarnessSkills(baseDir, ARTBOARD_SKILL_ID);
51745
+ const result = {
51746
+ dir: skillDir,
51747
+ installedVersion: installed,
51748
+ links,
51749
+ removed,
51750
+ skill: ARTBOARD_SKILL_ID,
51751
+ status: "installed",
51752
+ version: cliVersion,
51753
+ written: ["SKILL.md"]
51754
+ };
51755
+ if (options.json) return outputJson(result);
51756
+ console.log(`${import_picocolors.default.green("✓")} ${import_picocolors.default.bold(ARTBOARD_SKILL_ID)} ${import_picocolors.default.dim(`v${cliVersion}`)} skill → ${import_picocolors.default.dim(path.relative(process.cwd(), skillDir) || skillDir)}`);
51757
+ console.log(` written: SKILL.md${removed.length ? ` · removed: ${removed.join(", ")}` : ""}`);
51758
+ printLinks(links);
51759
+ console.log(import_picocolors.default.dim(" Commit these files so agents working in this repository load the skill."));
51760
+ };
51761
+ const registerArtboardSkillCommand = (artboard) => {
51762
+ artboard.command("skill").description("The agent skill that tells CLI agents when and how to use the artboard").command("init").description("Write the artboard skill into this repository (.agents/skills) or bring it up to date").option("--dir <path>", "Target working directory (default: current dir)").option("--json", "Print structured JSON").action(initAction);
51763
+ };
51764
+
51765
+ //#endregion
51766
+ //#region src/commands/artboard.ts
51767
+ init_src$2();
51768
+ const resultLine = (artboard) => formatArtboardResultLine({
51769
+ boardCount: artboard.content.boards.length,
51770
+ groupCount: artboard.content.groups.length,
51771
+ id: artboard.id,
51772
+ revision: artboard.revision
51773
+ });
51774
+ const parseOps = (value) => {
51775
+ if (value === void 0) return void 0;
51776
+ const text = value.startsWith("@") ? fs.readFileSync(value.slice(1), "utf8") : value;
51777
+ const ops = JSON.parse(text);
51778
+ if (!Array.isArray(ops)) throw new Error("--ops must be a JSON array of ops");
51779
+ return ops;
51780
+ };
51781
+ const parseFiles = (value) => {
51782
+ if (value === void 0) return void 0;
51783
+ const text = value.startsWith("@") ? fs.readFileSync(value.slice(1), "utf8") : value;
51784
+ const files = JSON.parse(text);
51785
+ if (!files || typeof files !== "object" || Array.isArray(files)) throw new Error("--files must be a JSON object of writes, edits and deletes");
51786
+ return files;
51787
+ };
51788
+ const FILES_HELP = "File changes applied before the ops: {\"writes\":[{\"path\",\"content\"}],\"edits\":[{\"path\",\"oldText\",\"newText\"}],\"deletes\":[path]} as JSON, or @file.json";
51789
+ const positiveInteger = (value) => {
51790
+ const result = Number(value);
51791
+ if (!Number.isSafeInteger(result) || result < 1) throw new Error("Expected a positive integer");
51792
+ return result;
51793
+ };
51794
+ const topicId = () => process.env.LOBEHUB_TOPIC_ID || void 0;
51795
+ const registerArtboardCommand = (program) => {
51796
+ const artboard = program.command("artboard").description("Lay out a requirement on a project artboard (same ops as the builtin-artboard tool)");
51797
+ artboard.command("create").description("Create the artboard for a task; without --task it uses the run's conversation project").requiredOption("--title <title>", "Board title").option("--description <text>", "One line shown on the board card").option("--task <task>", "Task id or identifier, such as PRJ-12").option("--files <json>", FILES_HELP).option("--ops <json>", "Initial ops (addGroup, addBoard, addEdge, addRound, addPage, …) as a JSON array, or @file.json; shapes: lh artboard ops").option("--json", "Print structured JSON").action(async (options) => {
51798
+ if (!options.task && !topicId()) throw new Error("Pass --task: this shell has no LOBEHUB_TOPIC_ID to find the project");
51799
+ const result = await (await getTrpcClient()).artboard.create.mutate({
51800
+ description: options.description,
51801
+ files: parseFiles(options.files),
51802
+ ops: parseOps(options.ops),
51803
+ taskId: options.task,
51804
+ title: options.title,
51805
+ topicId: topicId()
51806
+ });
51807
+ if (options.json) return outputJson(result);
51808
+ console.log(resultLine(result.artboard));
51809
+ });
51810
+ artboard.command("update <id>").description("Apply file changes and ops; everything applies or nothing does").requiredOption("--revision <n>", "Revision you last read", positiveInteger).option("--files <json>", FILES_HELP).option("--ops <json>", "Ops (add/update/remove Board, Group, Page; addRound, updateRound; addEdge, removeEdge; setCheck) as a JSON array, or @file.json; shapes: lh artboard ops").option("--json", "Print structured JSON").action(async (id, options) => {
51811
+ if (options.files === void 0 && options.ops === void 0) throw new Error("Pass --ops, --files or both");
51812
+ const result = await (await getTrpcClient()).artboard.update.mutate({
51813
+ files: parseFiles(options.files),
51814
+ id,
51815
+ ops: parseOps(options.ops),
51816
+ revision: options.revision
51817
+ });
51818
+ if (options.json) return outputJson(result);
51819
+ console.log(resultLine(result.artboard));
51820
+ });
51821
+ artboard.command("read <id>").description("Print the artboard and its revision").option("--json", "Print structured JSON").action(async (id, options) => {
51822
+ const result = await (await getTrpcClient()).artboard.read.query({ id });
51823
+ if (options.json) return outputJson(result);
51824
+ console.log(resultLine(result.artboard));
51825
+ console.log(JSON.stringify(result.artboard.content, null, 2));
51826
+ });
51827
+ artboard.command("push <id> <dir>").description("Upload the HTML pages, styles and images under <dir> as files of the artboard; unchanged files are skipped").option("--prune", "Also delete artboard files that are not in <dir>").option("--json", "Print structured JSON").action(async (id, dir, options) => {
51828
+ const result = await pushArtboardDir((await getTrpcClient()).artboard, id, dir, { prune: options.prune });
51829
+ if (options.json) return outputJson(result);
51830
+ console.log(`pushed ${result.uploaded.length} · unchanged ${result.unchanged.length} · deleted ${result.deleted.length}`);
51831
+ for (const skipped of result.skipped) console.log(`skipped ${skipped}: not a file a board can serve`);
51832
+ });
51833
+ const files = artboard.command("files").description("List, read, write and remove artboard files");
51834
+ files.command("list <id>").description("List the files of the artboard").option("--json", "Print structured JSON").action(async (id, options) => {
51835
+ const list = await (await getTrpcClient()).artboard.listFiles.query({ id });
51836
+ if (options.json) return outputJson(list);
51837
+ for (const file of list) console.log(`${file.path} ${file.size} B`);
51838
+ });
51839
+ files.command("read <id> <path>").description("Print one text file of the artboard").action(async (id, path) => {
51840
+ const file = await (await getTrpcClient()).artboard.readFile.query({
51841
+ id,
51842
+ path
51843
+ });
51844
+ if (file.content === void 0) throw new Error(`${file.path} is binary`);
51845
+ process.stdout.write(file.content);
51846
+ });
51847
+ files.command("write <id> <path>").description("Write one file of the artboard from stdin, or from a local file with --from").option("--from <file>", "Local file to upload instead of stdin").action(async (id, path, options) => {
51848
+ const normalized = normalizeArtboardFilePath(path);
51849
+ if (!normalized) throw new Error(`${path} is not a file a board can serve`);
51850
+ const bytes = options.from ? fs.readFileSync(options.from) : await buffer(process.stdin);
51851
+ await writeArtboardFiles((await getTrpcClient()).artboard, id, [toLocalArtboardFile(normalized, bytes)]);
51852
+ console.log(`wrote ${normalized} ${bytes.byteLength} B`);
51853
+ });
51854
+ files.command("rm <id> <paths...>").description("Delete files of the artboard; boards that show one stay and wait for it again").action(async (id, paths) => {
51855
+ await (await getTrpcClient()).artboard.writeFiles.mutate({
51856
+ files: { deletes: paths },
51857
+ id
51858
+ });
51859
+ for (const path of paths) console.log(`deleted ${path}`);
51860
+ });
51861
+ artboard.command("list").description("List the artboards in the run's project").option("--task <task>", "Find the project through this task instead").option("--json", "Print structured JSON").action(async (options) => {
51862
+ const boards = await (await getTrpcClient()).artboard.list.query({
51863
+ taskId: options.task,
51864
+ topicId: topicId()
51865
+ });
51866
+ if (options.json) return outputJson(boards);
51867
+ for (const board of boards) console.log(`${board.id} ${board.title} ${board.phase} revision ${board.revision}`);
51868
+ });
51869
+ registerArtboardCommentCommands(artboard);
51870
+ registerArtboardOpsCommand(artboard);
51871
+ registerArtboardSkillCommand(artboard);
51872
+ };
51873
+
50787
51874
  //#endregion
50788
51875
  //#region ../../packages/html-artifact/src/fileExtension.ts
50789
51876
  const getFileExtension = (filename) => {
@@ -56663,6 +57750,10 @@ const bindingSchema = object$1({
56663
57750
  workId: string().min(1)
56664
57751
  }).optional()
56665
57752
  }).optional(),
57753
+ pendingCanvasSave: object$1({
57754
+ fingerprint: string().regex(/^[\da-f]{64}$/),
57755
+ requestId: uuid()
57756
+ }).optional(),
56666
57757
  pendingCreateFingerprint: string().min(1).optional(),
56667
57758
  pendingCreateKey: string().min(1).optional(),
56668
57759
  pendingType: _enum(["canvas", "html"]).optional()
@@ -56674,7 +57765,7 @@ const bindingSchema = object$1({
56674
57765
  });
56675
57766
  const manifestSchema = object$1({
56676
57767
  artifacts: record(string(), bindingSchema),
56677
- version: literal(1)
57768
+ version: literal$1(1)
56678
57769
  }).passthrough();
56679
57770
  const emptyManifest = () => ({
56680
57771
  artifacts: {},
@@ -56875,6 +57966,55 @@ const publishCanvasArtifact = async (client, params) => {
56875
57966
  subdomainLabel: published.subdomainLabel
56876
57967
  };
56877
57968
  };
57969
+ const saveFingerprint = (html, title, createNew) => createHash("sha256").update(JSON.stringify([
57970
+ "save",
57971
+ html,
57972
+ title,
57973
+ createNew
57974
+ ])).digest("hex");
57975
+ const saveCanvasArtifact = async (client, params) => {
57976
+ const { binding, html, manifest, title } = params;
57977
+ if (binding.pendingCanvas) throw new Error("A Canvas publication is pending; retry lh artifact publish with the original input first");
57978
+ if (binding.pendingCreateKey && binding.pendingType !== "canvas") throw new Error("Complete the pending HTML publication before saving a Canvas");
57979
+ const context = await client.canvas.getPublishContext.query();
57980
+ const scope = JSON.stringify([
57981
+ resolveServerUrl(),
57982
+ context.userId,
57983
+ context.workspaceId
57984
+ ]);
57985
+ if (binding.scope && binding.scope !== scope) throw new Error("This artifact is bound to a different server, account or workspace");
57986
+ const createNew = !!params.new;
57987
+ const canvasId = createNew ? void 0 : binding.canvasId;
57988
+ const current = canvasId ? await client.canvas.getVersion.query({ canvasId }) : null;
57989
+ if (canvasId && !current) throw new Error("The bound Canvas is unavailable to this account; save it with --new");
57990
+ const fingerprint = saveFingerprint(html, title, createNew);
57991
+ const requestId = binding.pendingCanvasSave?.fingerprint === fingerprint ? binding.pendingCanvasSave.requestId : createIdempotencyKey();
57992
+ writeBinding(manifest, {
57993
+ ...binding,
57994
+ pendingCanvasSave: {
57995
+ fingerprint,
57996
+ requestId
57997
+ }
57998
+ });
57999
+ const saved = await client.canvas.save.mutate({
58000
+ canvasId,
58001
+ expectedVersion: current?.version ?? 0,
58002
+ html,
58003
+ requestId,
58004
+ title
58005
+ });
58006
+ const { pendingCanvasSave: _pending, ...settled } = binding;
58007
+ writeBinding(manifest, {
58008
+ ...settled,
58009
+ ...createNew && { deploymentId: void 0 },
58010
+ canvasId: saved.canvasId,
58011
+ scope,
58012
+ type: "canvas",
58013
+ version: saved.version,
58014
+ workId: saved.workId
58015
+ });
58016
+ return saved;
58017
+ };
56878
58018
 
56879
58019
  //#endregion
56880
58020
  //#region src/commands/artifact.ts
@@ -56928,6 +58068,42 @@ function registerArtifactCommand(program) {
56928
58068
  }
56929
58069
  console.log(output.content);
56930
58070
  });
58071
+ artifact.command("save <file>").description("Save a local Canvas page as a new Canvas version without publishing it to the web").option("--root <dir>", "Directory the page may reference assets from (defaults to the working directory)").option("--new", "Start a separate Canvas instead of a new version of the bound one").option("--title <title>", "Override the page title").option("--json [fields]", "Output JSON, optionally specify fields (comma-separated)").action(async (file, options) => {
58072
+ const entryPath = path.resolve(file);
58073
+ const rootDirectory = path.resolve(options.root ?? process.cwd());
58074
+ if (!entryPath.startsWith(`${rootDirectory}${path.sep}`) && entryPath !== rootDirectory) {
58075
+ fail$4(`${file} is outside ${rootDirectory}. Pass --root to widen the saved directory.`);
58076
+ return;
58077
+ }
58078
+ const entry = await readLocalHtmlAsset(entryPath);
58079
+ if (!entry.ok || entry.text === void 0) {
58080
+ fail$4(`Cannot read ${file}`);
58081
+ return;
58082
+ }
58083
+ const manifest = resolveManifest(entryPath, rootDirectory);
58084
+ const binding = readBinding(manifest);
58085
+ if (!options.new && binding.deploymentId && (binding.type ?? "html") !== "canvas") {
58086
+ fail$4("This file is bound to an HTML artifact; pass --new to save it as a Canvas.");
58087
+ return;
58088
+ }
58089
+ try {
58090
+ const saved = await saveCanvasArtifact(await getTrpcClient(), {
58091
+ binding,
58092
+ html: entry.text,
58093
+ manifest,
58094
+ new: options.new,
58095
+ title: options.title || extractHtmlTitle(entry.text) || path.basename(entryPath, path.extname(entryPath))
58096
+ });
58097
+ if (options.json !== void 0) outputJson(saved, typeof options.json === "string" ? options.json : void 0);
58098
+ else console.log(`${import_picocolors.default.green("✓")} Saved Canvas ${saved.canvasId} (version ${saved.version})`);
58099
+ } catch (error) {
58100
+ if (options.json !== void 0) outputJson({
58101
+ error: formatError(error),
58102
+ success: false
58103
+ });
58104
+ fail$4(formatError(error));
58105
+ }
58106
+ });
56931
58107
  artifact.command("publish <file>").description("Publish a local HTML file, bundling the assets it references").option("--root <dir>", "Directory the page may reference assets from (defaults to the working directory)").option("--deployment <id>", "Publish to this deployment for this run only").option("--new", "Create a separate deployment instead of updating the bound one").option("--type <type>", "Artifact content type: html or canvas (defaults to the bound type, then html)").option("--title <title>", "Override the page title").option("--slug <slug>", "Requested public slug").option("--json [fields]", "Output JSON, optionally specify fields (comma-separated)").action(async (file, options) => {
56932
58108
  const entryPath = path.resolve(file);
56933
58109
  const rootDirectory = path.resolve(options.root ?? process.cwd());
@@ -60775,7 +61951,7 @@ const LOBEHUB_CLI_GUIDE_CONTEXT = "lobehub-cli-guide";
60775
61951
  * agent keeps in context, so it names the LobeHub-shaped requests and, just as
60776
61952
  * deliberately, says what is not one.
60777
61953
  */
60778
- const lobeHubCliSkillDescription = "Reach the user's LobeHub — the app this conversation runs in — through the preinstalled `lh` CLI. Use when the request concerns LobeHub itself: its documents, knowledge bases, files, memory, earlier conversations (topic ids start with `tpc_`, or a `<refer_topic>` tag), agents and your own agent configuration, tasks, projects, widgets, bots, models, providers, plugins or skills, or generating images, video or speech there. Not needed for ordinary work on local files or other tools.";
61954
+ const lobeHubCliSkillDescription = "Reach the user's LobeHub — the app this conversation runs in — through the preinstalled `lh` CLI. Use when the request concerns LobeHub itself: its documents, knowledge bases, files, memory, earlier conversations (topic ids start with `tpc_`, or a `<refer_topic>` tag), agents and your own agent configuration, tasks, projects, artboards, widgets, bots, models, providers, plugins or skills, or generating images, video or speech there. Not needed for ordinary work on local files or other tools.";
60779
61955
  const lobeHubCliGuideBody = [
60780
61956
  "You are running inside a LobeHub conversation, on a machine where the `lh` CLI is already installed and the run normally carries the user's credentials in its environment. Never install, upgrade or replace `lh` globally — that binary may be the one running `lh connect`, which is executing you — and never run `lh login`.",
60781
61957
  "",
@@ -60785,7 +61961,7 @@ const lobeHubCliGuideBody = [
60785
61961
  "- **Talking to another conversation:** `lh topic send <tpc_id> -c \"…\"` delivers a message to that conversation and has its agent act on it (queued behind its current turn if it is busy). To hand work to a fresh conversation instead, `lh topic send --new -c \"…\"` opens one for you (or `--agent-id` another agent), optionally on a given machine with `--device <id|local>` and named with `--title`; it is linked to this conversation as its parent (`--parent-topic-id <tpc_id>` names another, `--detach` links none), and `lh topic list --opened-by-me` lists the ones you opened; `lh topic stop <tpc_id>` stops a topic's running turn and `lh topic archive <tpc_id>` archives it; `lh message send -c \"…\"` is the same thing spelled message-first: without `--topic-id` it opens a new conversation, with `--topic-id <tpc_id>` it sends to that one. Prefer these over `lh agent run` for handing off work. `lh message create` only writes a row — nobody sees or answers it. A message another agent sent you starts with an `<agent_sender>` header; answer it with `lh message reply <message_id> -c \"…\"`, which wakes the sender's conversation. Your ordinary response is not delivered to that agent.",
60786
61962
  "- **If `lh` is too old** — `lh man` lacks a command you expect, or `lh` reports an unknown command or option — the shell may have found a stale global install first. When `LOBEHUB_CLI` is set it is the path of the CLI this app ships — run that path instead of `lh` for the rest of the session. Otherwise, or if that one is too old as well, run the latest CLI once without installing it: `pnpm --package @lichao0223/lobehub-cli@latest dlx lh …` (or `npx -y -p @lichao0223/lobehub-cli@latest lh …`). It reads the same environment and saved login as `lh`. If the user asks you to run `lh` this way, do so.",
60787
61963
  "- **Look commands up, do not guess them.** `lh man` lists every command, and `lh man <command>` (e.g. `lh man doc create`) prints the manual for the CLI actually installed here, including exactly which flags that command takes. Many commands offer `--json` for structured output, but not all of them — the manual is what says so, and an invented flag just fails the call.",
60788
- "- **What it reaches:** `lh kb` knowledge bases · `lh doc` documents · `lh file` files · `lh artifact` artifacts · `lh topic` / `lh message` past conversations · `lh agent` agents · `lh task` / `lh project` work · `lh widget` / `lh dashboard` monitoring widgets and dashboards · `lh search` local resources and the web · `lh recall` past messages, topics, goals and pages in a time window · `lh gen` text/image/video/TTS/ASR generation · `lh memory` user memory · `lh notify` notifications to the user · `lh model` / `lh provider` / `lh legacy-plugin` / `lh skill` platform configuration · `lh bot` chat-platform bots.",
61964
+ "- **What it reaches:** `lh kb` knowledge bases · `lh doc` documents · `lh file` files · `lh artifact` artifacts · `lh topic` / `lh message` past conversations · `lh agent` agents · `lh task` / `lh project` work · `lh artboard` the requirement artboard of a project (boards, flows and choices the user answers on the canvas) · `lh widget` / `lh dashboard` monitoring widgets and dashboards · `lh search` local resources and the web · `lh recall` past messages, topics, goals and pages in a time window · `lh gen` text/image/video/TTS/ASR generation · `lh memory` user memory · `lh notify` notifications to the user · `lh model` / `lh provider` / `lh legacy-plugin` / `lh skill` platform configuration · `lh bot` chat-platform bots.",
60789
61965
  "- **Widgets run code with the user's credentials.** Before `lh widget dry-run` of a draft that declares connector credentials (`manifest.env`) or network hosts (`manifest.network.allow`), show the user that version id, what the script does and which credentials and hosts it uses, and wait for their explicit approval of that exact version before passing `--version <id> --yes`. Never publish (`lh widget publish`) without the user's confirmation.",
60790
61966
  "- **If a command fails with an authentication or permission error**, tell the user what you were trying to do — do not work around it.",
60791
61967
  "- **Leave these alone:** `lh hetero` and `lh connect` run the infrastructure that is executing you. And never change the persistent workspace scope with `lh workspace use` — it silently rewrites the target of every later command on this machine."
@@ -63246,7 +64422,7 @@ init_zod$1();
63246
64422
  const questionSchema = object$1({
63247
64423
  header: string().max(200),
63248
64424
  id: string().min(1),
63249
- isSecret: literal(false),
64425
+ isSecret: literal$1(false),
63250
64426
  options: array(object$1({
63251
64427
  description: string().max(1e3),
63252
64428
  label: string().min(1).max(200)
@@ -63294,13 +64470,13 @@ const codexUserInputResponse = (request, answer) => {
63294
64470
  init_zod$1();
63295
64471
  const nonBlank = string().refine((value) => value.trim().length > 0);
63296
64472
  const notificationSchema = object$1({ item: object$1({
63297
- delivery: literal("async"),
64473
+ delivery: literal$1("async"),
63298
64474
  id: nonBlank,
63299
64475
  questions: array(object$1({
63300
64476
  options: array(nonBlank).nullish(),
63301
64477
  title: nonBlank
63302
64478
  })).min(1),
63303
- type: literal("agentMessage")
64479
+ type: literal$1("agentMessage")
63304
64480
  }) });
63305
64481
  const readCodexAsyncQuestion = (params) => {
63306
64482
  const item = notificationSchema.safeParse(params).data?.item;
@@ -98650,14 +99826,14 @@ var require_stream$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
98650
99826
  //#endregion
98651
99827
  //#region node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js
98652
99828
  var require_safe_buffer$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
98653
- var buffer$1 = __require("buffer");
98654
- var Buffer = buffer$1.Buffer;
99829
+ var buffer$2 = __require("buffer");
99830
+ var Buffer = buffer$2.Buffer;
98655
99831
  function copyProps(src, dst) {
98656
99832
  for (var key in src) dst[key] = src[key];
98657
99833
  }
98658
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer$1;
99834
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer$2;
98659
99835
  else {
98660
- copyProps(buffer$1, exports);
99836
+ copyProps(buffer$2, exports);
98661
99837
  exports.Buffer = SafeBuffer;
98662
99838
  }
98663
99839
  function SafeBuffer(arg, encodingOrOffset, length) {
@@ -98682,7 +99858,7 @@ var require_safe_buffer$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) =
98682
99858
  };
98683
99859
  SafeBuffer.allocUnsafeSlow = function(size) {
98684
99860
  if (typeof size !== "number") throw new TypeError("Argument must be a number");
98685
- return buffer$1.SlowBuffer(size);
99861
+ return buffer$2.SlowBuffer(size);
98686
99862
  };
98687
99863
  }));
98688
99864
 
@@ -260890,14 +262066,14 @@ var require__stream_duplex = /* @__PURE__ */ __commonJSMin$2(((exports, module)
260890
262066
  //#region node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js
260891
262067
  var require_safe_buffer = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
260892
262068
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
260893
- var buffer = __require("buffer");
260894
- var Buffer = buffer.Buffer;
262069
+ var buffer$1 = __require("buffer");
262070
+ var Buffer = buffer$1.Buffer;
260895
262071
  function copyProps(src, dst) {
260896
262072
  for (var key in src) dst[key] = src[key];
260897
262073
  }
260898
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
262074
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer$1;
260899
262075
  else {
260900
- copyProps(buffer, exports);
262076
+ copyProps(buffer$1, exports);
260901
262077
  exports.Buffer = SafeBuffer;
260902
262078
  }
260903
262079
  function SafeBuffer(arg, encodingOrOffset, length) {
@@ -260923,7 +262099,7 @@ var require_safe_buffer = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
260923
262099
  };
260924
262100
  SafeBuffer.allocUnsafeSlow = function(size) {
260925
262101
  if (typeof size !== "number") throw new TypeError("Argument must be a number");
260926
- return buffer.SlowBuffer(size);
262102
+ return buffer$1.SlowBuffer(size);
260927
262103
  };
260928
262104
  }));
260929
262105
 
@@ -308763,21 +309939,21 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308763
309939
  ResultSchema = looseObject({ _meta: ResultMetaObjectSchema.optional() });
308764
309940
  RequestIdSchema = union([string(), number$1().int()]);
308765
309941
  JSONRPCRequestSchema = object$1({
308766
- jsonrpc: literal("2.0"),
309942
+ jsonrpc: literal$1("2.0"),
308767
309943
  id: RequestIdSchema,
308768
309944
  ...RequestSchema.shape
308769
309945
  }).strict();
308770
309946
  JSONRPCNotificationSchema = object$1({
308771
- jsonrpc: literal("2.0"),
309947
+ jsonrpc: literal$1("2.0"),
308772
309948
  ...NotificationSchema.shape
308773
309949
  }).strict();
308774
309950
  JSONRPCResultResponseSchema = object$1({
308775
- jsonrpc: literal("2.0"),
309951
+ jsonrpc: literal$1("2.0"),
308776
309952
  id: RequestIdSchema,
308777
309953
  result: ResultSchema
308778
309954
  }).strict();
308779
309955
  JSONRPCErrorResponseSchema = object$1({
308780
- jsonrpc: literal("2.0"),
309956
+ jsonrpc: literal$1("2.0"),
308781
309957
  id: RequestIdSchema.optional(),
308782
309958
  error: object$1({
308783
309959
  code: number$1().int(),
@@ -308798,7 +309974,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308798
309974
  reason: string().optional()
308799
309975
  });
308800
309976
  CancelledNotificationSchema = NotificationSchema.extend({
308801
- method: literal("notifications/cancelled"),
309977
+ method: literal$1("notifications/cancelled"),
308802
309978
  params: CancelledNotificationParamsSchema
308803
309979
  });
308804
309980
  IconSchema = object$1({
@@ -308857,7 +310033,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308857
310033
  clientInfo: ImplementationSchema
308858
310034
  });
308859
310035
  InitializeRequestSchema = RequestSchema.extend({
308860
- method: literal("initialize"),
310036
+ method: literal$1("initialize"),
308861
310037
  params: InitializeRequestParamsSchema
308862
310038
  });
308863
310039
  ServerCapabilitiesSchema = object$1({
@@ -308880,11 +310056,11 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308880
310056
  instructions: string().optional()
308881
310057
  });
308882
310058
  InitializedNotificationSchema = NotificationSchema.extend({
308883
- method: literal("notifications/initialized"),
310059
+ method: literal$1("notifications/initialized"),
308884
310060
  params: NotificationsParamsSchema.optional()
308885
310061
  });
308886
310062
  DiscoverRequestSchema = RequestSchema.extend({
308887
- method: literal("server/discover"),
310063
+ method: literal$1("server/discover"),
308888
310064
  params: BaseRequestParamsSchema.optional()
308889
310065
  });
308890
310066
  DiscoverResultSchema = ResultSchema.extend({
@@ -308893,7 +310069,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308893
310069
  instructions: string().optional()
308894
310070
  });
308895
310071
  PingRequestSchema = RequestSchema.extend({
308896
- method: literal("ping"),
310072
+ method: literal$1("ping"),
308897
310073
  params: BaseRequestParamsSchema.optional()
308898
310074
  });
308899
310075
  ProgressSchema = object$1({
@@ -308907,7 +310083,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308907
310083
  progressToken: ProgressTokenSchema
308908
310084
  });
308909
310085
  ProgressNotificationSchema = NotificationSchema.extend({
308910
- method: literal("notifications/progress"),
310086
+ method: literal$1("notifications/progress"),
308911
310087
  params: ProgressNotificationParamsSchema
308912
310088
  });
308913
310089
  PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({ cursor: CursorSchema.optional() });
@@ -308953,29 +310129,29 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308953
310129
  annotations: AnnotationsSchema.optional(),
308954
310130
  _meta: optional(looseObject({}))
308955
310131
  });
308956
- ListResourcesRequestSchema = PaginatedRequestSchema.extend({ method: literal("resources/list") });
310132
+ ListResourcesRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("resources/list") });
308957
310133
  ListResourcesResultSchema = PaginatedResultSchema.extend({ resources: array(ResourceSchema) });
308958
- ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ method: literal("resources/templates/list") });
310134
+ ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("resources/templates/list") });
308959
310135
  ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({ resourceTemplates: array(ResourceTemplateSchema) });
308960
310136
  ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({ uri: string() });
308961
310137
  ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
308962
310138
  ReadResourceRequestSchema = RequestSchema.extend({
308963
- method: literal("resources/read"),
310139
+ method: literal$1("resources/read"),
308964
310140
  params: ReadResourceRequestParamsSchema
308965
310141
  });
308966
310142
  ReadResourceResultSchema = ResultSchema.extend({ contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema])) });
308967
310143
  ResourceListChangedNotificationSchema = NotificationSchema.extend({
308968
- method: literal("notifications/resources/list_changed"),
310144
+ method: literal$1("notifications/resources/list_changed"),
308969
310145
  params: NotificationsParamsSchema.optional()
308970
310146
  });
308971
310147
  SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
308972
310148
  SubscribeRequestSchema = RequestSchema.extend({
308973
- method: literal("resources/subscribe"),
310149
+ method: literal$1("resources/subscribe"),
308974
310150
  params: SubscribeRequestParamsSchema
308975
310151
  });
308976
310152
  UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
308977
310153
  UnsubscribeRequestSchema = RequestSchema.extend({
308978
- method: literal("resources/unsubscribe"),
310154
+ method: literal$1("resources/unsubscribe"),
308979
310155
  params: UnsubscribeRequestParamsSchema
308980
310156
  });
308981
310157
  SubscriptionFilterSchema = object$1({
@@ -308986,19 +310162,19 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308986
310162
  });
308987
310163
  SubscriptionsListenRequestParamsSchema = BaseRequestParamsSchema.extend({ notifications: SubscriptionFilterSchema });
308988
310164
  SubscriptionsListenRequestSchema = RequestSchema.extend({
308989
- method: literal("subscriptions/listen"),
310165
+ method: literal$1("subscriptions/listen"),
308990
310166
  params: SubscriptionsListenRequestParamsSchema
308991
310167
  });
308992
310168
  SubscriptionsAcknowledgedNotificationParamsSchema = NotificationsParamsSchema.extend({ notifications: SubscriptionFilterSchema });
308993
310169
  SubscriptionsAcknowledgedNotificationSchema = NotificationSchema.extend({
308994
- method: literal("notifications/subscriptions/acknowledged"),
310170
+ method: literal$1("notifications/subscriptions/acknowledged"),
308995
310171
  params: SubscriptionsAcknowledgedNotificationParamsSchema
308996
310172
  });
308997
310173
  SubscriptionsListenResultMetaSchema = ResultMetaObjectSchema.extend({ [SUBSCRIPTION_ID_META_KEY]: RequestIdSchema });
308998
310174
  SubscriptionsListenResultSchema = ResultSchema.extend({ _meta: SubscriptionsListenResultMetaSchema });
308999
310175
  ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({ uri: string() });
309000
310176
  ResourceUpdatedNotificationSchema = NotificationSchema.extend({
309001
- method: literal("notifications/resources/updated"),
310177
+ method: literal$1("notifications/resources/updated"),
309002
310178
  params: ResourceUpdatedNotificationParamsSchema
309003
310179
  });
309004
310180
  PromptArgumentSchema = object$1({
@@ -309013,50 +310189,50 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309013
310189
  arguments: optional(array(PromptArgumentSchema)),
309014
310190
  _meta: optional(looseObject({}))
309015
310191
  });
309016
- ListPromptsRequestSchema = PaginatedRequestSchema.extend({ method: literal("prompts/list") });
310192
+ ListPromptsRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("prompts/list") });
309017
310193
  ListPromptsResultSchema = PaginatedResultSchema.extend({ prompts: array(PromptSchema) });
309018
310194
  GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
309019
310195
  name: string(),
309020
310196
  arguments: record(string(), string()).optional()
309021
310197
  });
309022
310198
  GetPromptRequestSchema = RequestSchema.extend({
309023
- method: literal("prompts/get"),
310199
+ method: literal$1("prompts/get"),
309024
310200
  params: GetPromptRequestParamsSchema
309025
310201
  });
309026
310202
  TextContentSchema = object$1({
309027
- type: literal("text"),
310203
+ type: literal$1("text"),
309028
310204
  text: string(),
309029
310205
  annotations: AnnotationsSchema.optional(),
309030
310206
  _meta: record(string(), unknown()).optional()
309031
310207
  });
309032
310208
  ImageContentSchema = object$1({
309033
- type: literal("image"),
310209
+ type: literal$1("image"),
309034
310210
  data: Base64Schema,
309035
310211
  mimeType: string(),
309036
310212
  annotations: AnnotationsSchema.optional(),
309037
310213
  _meta: record(string(), unknown()).optional()
309038
310214
  });
309039
310215
  AudioContentSchema = object$1({
309040
- type: literal("audio"),
310216
+ type: literal$1("audio"),
309041
310217
  data: Base64Schema,
309042
310218
  mimeType: string(),
309043
310219
  annotations: AnnotationsSchema.optional(),
309044
310220
  _meta: record(string(), unknown()).optional()
309045
310221
  });
309046
310222
  ToolUseContentSchema = object$1({
309047
- type: literal("tool_use"),
310223
+ type: literal$1("tool_use"),
309048
310224
  name: string(),
309049
310225
  id: string(),
309050
310226
  input: record(string(), unknown()),
309051
310227
  _meta: record(string(), unknown()).optional()
309052
310228
  });
309053
310229
  EmbeddedResourceSchema = object$1({
309054
- type: literal("resource"),
310230
+ type: literal$1("resource"),
309055
310231
  resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
309056
310232
  annotations: AnnotationsSchema.optional(),
309057
310233
  _meta: record(string(), unknown()).optional()
309058
310234
  });
309059
- ResourceLinkSchema = ResourceSchema.extend({ type: literal("resource_link") });
310235
+ ResourceLinkSchema = ResourceSchema.extend({ type: literal$1("resource_link") });
309060
310236
  ContentBlockSchema = union([
309061
310237
  TextContentSchema,
309062
310238
  ImageContentSchema,
@@ -309073,7 +310249,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309073
310249
  messages: array(PromptMessageSchema)
309074
310250
  });
309075
310251
  PromptListChangedNotificationSchema = NotificationSchema.extend({
309076
- method: literal("notifications/prompts/list_changed"),
310252
+ method: literal$1("notifications/prompts/list_changed"),
309077
310253
  params: NotificationsParamsSchema.optional()
309078
310254
  });
309079
310255
  ToolAnnotationsSchema = object$1({
@@ -309093,7 +310269,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309093
310269
  ...IconsSchema.shape,
309094
310270
  description: string().optional(),
309095
310271
  inputSchema: object$1({
309096
- type: literal("object"),
310272
+ type: literal$1("object"),
309097
310273
  properties: record(string(), JSONValueSchema).optional(),
309098
310274
  required: array(string()).optional()
309099
310275
  }).catchall(unknown()),
@@ -309102,7 +310278,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309102
310278
  execution: ToolExecutionSchema.optional(),
309103
310279
  _meta: record(string(), unknown()).optional()
309104
310280
  });
309105
- ListToolsRequestSchema = PaginatedRequestSchema.extend({ method: literal("tools/list") });
310281
+ ListToolsRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("tools/list") });
309106
310282
  ListToolsResultSchema = PaginatedResultSchema.extend({ tools: array(ToolSchema) });
309107
310283
  CallToolResultSchema = ResultSchema.extend({
309108
310284
  content: array(ContentBlockSchema).default([]),
@@ -309115,11 +310291,11 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309115
310291
  arguments: record(string(), unknown()).optional()
309116
310292
  });
309117
310293
  CallToolRequestSchema = RequestSchema.extend({
309118
- method: literal("tools/call"),
310294
+ method: literal$1("tools/call"),
309119
310295
  params: CallToolRequestParamsSchema
309120
310296
  });
309121
310297
  ToolListChangedNotificationSchema = NotificationSchema.extend({
309122
- method: literal("notifications/tools/list_changed"),
310298
+ method: literal$1("notifications/tools/list_changed"),
309123
310299
  params: NotificationsParamsSchema.optional()
309124
310300
  });
309125
310301
  ListChangedOptionsBaseSchema = object$1({
@@ -309138,7 +310314,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309138
310314
  ]);
309139
310315
  SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({ level: LoggingLevelSchema });
309140
310316
  SetLevelRequestSchema = RequestSchema.extend({
309141
- method: literal("logging/setLevel"),
310317
+ method: literal$1("logging/setLevel"),
309142
310318
  params: SetLevelRequestParamsSchema
309143
310319
  });
309144
310320
  LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
@@ -309147,7 +310323,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309147
310323
  data: unknown()
309148
310324
  });
309149
310325
  LoggingMessageNotificationSchema = NotificationSchema.extend({
309150
- method: literal("notifications/message"),
310326
+ method: literal$1("notifications/message"),
309151
310327
  params: LoggingMessageNotificationParamsSchema
309152
310328
  });
309153
310329
  ModelHintSchema = object$1({ name: string().optional() });
@@ -309163,7 +310339,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309163
310339
  "none"
309164
310340
  ]).optional() });
309165
310341
  ToolResultContentSchema = object$1({
309166
- type: literal("tool_result"),
310342
+ type: literal$1("tool_result"),
309167
310343
  toolUseId: string().describe("The unique identifier for the corresponding tool call."),
309168
310344
  content: array(ContentBlockSchema),
309169
310345
  structuredContent: unknown().optional(),
@@ -309204,7 +310380,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309204
310380
  toolChoice: ToolChoiceSchema.optional()
309205
310381
  });
309206
310382
  CreateMessageRequestSchema = RequestSchema.extend({
309207
- method: literal("sampling/createMessage"),
310383
+ method: literal$1("sampling/createMessage"),
309208
310384
  params: CreateMessageRequestParamsSchema
309209
310385
  });
309210
310386
  CreateMessageResultSchema = ResultSchema.extend({
@@ -309229,13 +310405,13 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309229
310405
  content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
309230
310406
  });
309231
310407
  BooleanSchemaSchema = object$1({
309232
- type: literal("boolean"),
310408
+ type: literal$1("boolean"),
309233
310409
  title: string().optional(),
309234
310410
  description: string().optional(),
309235
310411
  default: boolean().optional()
309236
310412
  });
309237
310413
  StringSchemaSchema = object$1({
309238
- type: literal("string"),
310414
+ type: literal$1("string"),
309239
310415
  title: string().optional(),
309240
310416
  description: string().optional(),
309241
310417
  minLength: number$1().optional(),
@@ -309257,14 +310433,14 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309257
310433
  default: number$1().optional()
309258
310434
  });
309259
310435
  UntitledSingleSelectEnumSchemaSchema = object$1({
309260
- type: literal("string"),
310436
+ type: literal$1("string"),
309261
310437
  title: string().optional(),
309262
310438
  description: string().optional(),
309263
310439
  enum: array(string()),
309264
310440
  default: string().optional()
309265
310441
  });
309266
310442
  TitledSingleSelectEnumSchemaSchema = object$1({
309267
- type: literal("string"),
310443
+ type: literal$1("string"),
309268
310444
  title: string().optional(),
309269
310445
  description: string().optional(),
309270
310446
  oneOf: array(object$1({
@@ -309274,7 +310450,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309274
310450
  default: string().optional()
309275
310451
  });
309276
310452
  LegacyTitledEnumSchemaSchema = object$1({
309277
- type: literal("string"),
310453
+ type: literal$1("string"),
309278
310454
  title: string().optional(),
309279
310455
  description: string().optional(),
309280
310456
  enum: array(string()),
@@ -309283,19 +310459,19 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309283
310459
  });
309284
310460
  SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
309285
310461
  UntitledMultiSelectEnumSchemaSchema = object$1({
309286
- type: literal("array"),
310462
+ type: literal$1("array"),
309287
310463
  title: string().optional(),
309288
310464
  description: string().optional(),
309289
310465
  minItems: number$1().optional(),
309290
310466
  maxItems: number$1().optional(),
309291
310467
  items: object$1({
309292
- type: literal("string"),
310468
+ type: literal$1("string"),
309293
310469
  enum: array(string())
309294
310470
  }),
309295
310471
  default: array(string()).optional()
309296
310472
  });
309297
310473
  TitledMultiSelectEnumSchemaSchema = object$1({
309298
- type: literal("array"),
310474
+ type: literal$1("array"),
309299
310475
  title: string().optional(),
309300
310476
  description: string().optional(),
309301
310477
  minItems: number$1().optional(),
@@ -309319,28 +310495,28 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309319
310495
  NumberSchemaSchema
309320
310496
  ]);
309321
310497
  ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
309322
- mode: literal("form").optional(),
310498
+ mode: literal$1("form").optional(),
309323
310499
  message: string(),
309324
310500
  requestedSchema: object$1({
309325
- type: literal("object"),
310501
+ type: literal$1("object"),
309326
310502
  properties: record(string(), PrimitiveSchemaDefinitionSchema),
309327
310503
  required: array(string()).optional()
309328
310504
  }).catchall(unknown())
309329
310505
  });
309330
310506
  ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
309331
- mode: literal("url"),
310507
+ mode: literal$1("url"),
309332
310508
  message: string(),
309333
310509
  elicitationId: string(),
309334
310510
  url: string().url()
309335
310511
  });
309336
310512
  ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
309337
310513
  ElicitRequestSchema = RequestSchema.extend({
309338
- method: literal("elicitation/create"),
310514
+ method: literal$1("elicitation/create"),
309339
310515
  params: ElicitRequestParamsSchema
309340
310516
  });
309341
310517
  ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({ elicitationId: string() });
309342
310518
  ElicitationCompleteNotificationSchema = NotificationSchema.extend({
309343
- method: literal("notifications/elicitation/complete"),
310519
+ method: literal$1("notifications/elicitation/complete"),
309344
310520
  params: ElicitationCompleteNotificationParamsSchema
309345
310521
  });
309346
310522
  ElicitResultSchema = ResultSchema.extend({
@@ -309357,11 +310533,11 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309357
310533
  ])).optional())
309358
310534
  });
309359
310535
  ResourceTemplateReferenceSchema = object$1({
309360
- type: literal("ref/resource"),
310536
+ type: literal$1("ref/resource"),
309361
310537
  uri: string()
309362
310538
  });
309363
310539
  PromptReferenceSchema = object$1({
309364
- type: literal("ref/prompt"),
310540
+ type: literal$1("ref/prompt"),
309365
310541
  name: string()
309366
310542
  });
309367
310543
  CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
@@ -309373,7 +310549,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309373
310549
  context: object$1({ arguments: record(string(), string()).optional() }).optional()
309374
310550
  });
309375
310551
  CompleteRequestSchema = RequestSchema.extend({
309376
- method: literal("completion/complete"),
310552
+ method: literal$1("completion/complete"),
309377
310553
  params: CompleteRequestParamsSchema
309378
310554
  });
309379
310555
  CompleteResultSchema = ResultSchema.extend({ completion: looseObject({
@@ -309387,12 +310563,12 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309387
310563
  _meta: record(string(), unknown()).optional()
309388
310564
  });
309389
310565
  ListRootsRequestSchema = RequestSchema.extend({
309390
- method: literal("roots/list"),
310566
+ method: literal$1("roots/list"),
309391
310567
  params: BaseRequestParamsSchema.optional()
309392
310568
  });
309393
310569
  ListRootsResultSchema = ResultSchema.extend({ roots: array(RootSchema) });
309394
310570
  RootsListChangedNotificationSchema = NotificationSchema.extend({
309395
- method: literal("notifications/roots/list_changed"),
310571
+ method: literal$1("notifications/roots/list_changed"),
309396
310572
  params: NotificationsParamsSchema.optional()
309397
310573
  });
309398
310574
  TaskCreationParamsSchema = looseObject({
@@ -309418,23 +310594,23 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309418
310594
  CreateTaskResultSchema = ResultSchema.extend({ task: TaskSchema });
309419
310595
  TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
309420
310596
  TaskStatusNotificationSchema = NotificationSchema.extend({
309421
- method: literal("notifications/tasks/status"),
310597
+ method: literal$1("notifications/tasks/status"),
309422
310598
  params: TaskStatusNotificationParamsSchema
309423
310599
  });
309424
310600
  GetTaskRequestSchema = RequestSchema.extend({
309425
- method: literal("tasks/get"),
310601
+ method: literal$1("tasks/get"),
309426
310602
  params: BaseRequestParamsSchema.extend({ taskId: string() })
309427
310603
  });
309428
310604
  GetTaskResultSchema = ResultSchema.merge(TaskSchema);
309429
310605
  GetTaskPayloadRequestSchema = RequestSchema.extend({
309430
- method: literal("tasks/result"),
310606
+ method: literal$1("tasks/result"),
309431
310607
  params: BaseRequestParamsSchema.extend({ taskId: string() })
309432
310608
  });
309433
310609
  GetTaskPayloadResultSchema = ResultSchema.loose();
309434
- ListTasksRequestSchema = PaginatedRequestSchema.extend({ method: literal("tasks/list") });
310610
+ ListTasksRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("tasks/list") });
309435
310611
  ListTasksResultSchema = PaginatedResultSchema.extend({ tasks: array(TaskSchema) });
309436
310612
  CancelTaskRequestSchema = RequestSchema.extend({
309437
- method: literal("tasks/cancel"),
310613
+ method: literal$1("tasks/cancel"),
309438
310614
  params: BaseRequestParamsSchema.extend({ taskId: string() })
309439
310615
  });
309440
310616
  CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
@@ -309611,7 +310787,7 @@ var init_auth_UMQCo_ad = __esmMin((() => {
309611
310787
  issuer: string().optional().catch(void 0)
309612
310788
  }).strip();
309613
310789
  IdJagTokenExchangeResponseSchema = object$1({
309614
- issued_token_type: literal("urn:ietf:params:oauth:token-type:id-jag"),
310790
+ issued_token_type: literal$1("urn:ietf:params:oauth:token-type:id-jag"),
309615
310791
  access_token: string(),
309616
310792
  token_type: string().optional(),
309617
310793
  expires_in: number$1().optional(),
@@ -309622,7 +310798,7 @@ var init_auth_UMQCo_ad = __esmMin((() => {
309622
310798
  error_description: string().optional(),
309623
310799
  error_uri: string().optional()
309624
310800
  });
309625
- OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literal("").transform(() => void 0));
310801
+ OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literal$1("").transform(() => void 0));
309626
310802
  OAuthClientMetadataSchema = object$1({
309627
310803
  redirect_uris: array(SafeUrlSchema),
309628
310804
  token_endpoint_auth_method: string().optional(),
@@ -309895,7 +311071,7 @@ function build$1$1() {
309895
311071
  * A client MUST NOT attempt to cancel its {@linkcode InitializeRequest | initialize} request.
309896
311072
  */
309897
311073
  const CancelledNotificationSchema$1 = NotificationSchema$1.extend({
309898
- method: literal("notifications/cancelled"),
311074
+ method: literal$1("notifications/cancelled"),
309899
311075
  params: CancelledNotificationParamsSchema$1
309900
311076
  });
309901
311077
  /**
@@ -309983,7 +311159,7 @@ function build$1$1() {
309983
311159
  * This request is sent from the client to the server when it first connects, asking it to begin initialization.
309984
311160
  */
309985
311161
  const InitializeRequestSchema$1 = RequestSchema$1.extend({
309986
- method: literal("initialize"),
311162
+ method: literal$1("initialize"),
309987
311163
  params: InitializeRequestParamsSchema$1
309988
311164
  });
309989
311165
  /**
@@ -310015,14 +311191,14 @@ function build$1$1() {
310015
311191
  * This notification is sent from the client to the server after initialization has finished.
310016
311192
  */
310017
311193
  const InitializedNotificationSchema$1 = NotificationSchema$1.extend({
310018
- method: literal("notifications/initialized"),
311194
+ method: literal$1("notifications/initialized"),
310019
311195
  params: NotificationsParamsSchema$1.optional()
310020
311196
  });
310021
311197
  /**
310022
311198
  * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
310023
311199
  */
310024
311200
  const PingRequestSchema$1 = RequestSchema$1.extend({
310025
- method: literal("ping"),
311201
+ method: literal$1("ping"),
310026
311202
  params: BaseRequestParamsSchema$1.optional()
310027
311203
  });
310028
311204
  const ProgressSchema$1 = object$1({
@@ -310041,7 +311217,7 @@ function build$1$1() {
310041
311217
  * @category notifications/progress
310042
311218
  */
310043
311219
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
310044
- method: literal("notifications/progress"),
311220
+ method: literal$1("notifications/progress"),
310045
311221
  params: ProgressNotificationParamsSchema$1
310046
311222
  });
310047
311223
  const PaginatedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ cursor: CursorSchema$1.optional() });
@@ -310110,7 +311286,7 @@ function build$1$1() {
310110
311286
  /**
310111
311287
  * Sent from the client to request a list of resources the server has.
310112
311288
  */
310113
- const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/list") });
311289
+ const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/list") });
310114
311290
  /**
310115
311291
  * The server's response to a {@linkcode ListResourcesRequest | resources/list} request from the client.
310116
311292
  */
@@ -310118,7 +311294,7 @@ function build$1$1() {
310118
311294
  /**
310119
311295
  * Sent from the client to request a list of resource templates the server has.
310120
311296
  */
310121
- const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/templates/list") });
311297
+ const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/templates/list") });
310122
311298
  /**
310123
311299
  * The server's response to a {@linkcode ListResourceTemplatesRequest | resources/templates/list} request from the client.
310124
311300
  */
@@ -310132,7 +311308,7 @@ function build$1$1() {
310132
311308
  * Sent from the client to the server, to read a specific resource URI.
310133
311309
  */
310134
311310
  const ReadResourceRequestSchema$1 = RequestSchema$1.extend({
310135
- method: literal("resources/read"),
311311
+ method: literal$1("resources/read"),
310136
311312
  params: ReadResourceRequestParamsSchema$1
310137
311313
  });
310138
311314
  /**
@@ -310143,7 +311319,7 @@ function build$1$1() {
310143
311319
  * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
310144
311320
  */
310145
311321
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310146
- method: literal("notifications/resources/list_changed"),
311322
+ method: literal$1("notifications/resources/list_changed"),
310147
311323
  params: NotificationsParamsSchema$1.optional()
310148
311324
  });
310149
311325
  const SubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -310151,7 +311327,7 @@ function build$1$1() {
310151
311327
  * Sent from the client to request `resources/updated` notifications from the server whenever a particular resource changes.
310152
311328
  */
310153
311329
  const SubscribeRequestSchema$1 = RequestSchema$1.extend({
310154
- method: literal("resources/subscribe"),
311330
+ method: literal$1("resources/subscribe"),
310155
311331
  params: SubscribeRequestParamsSchema$1
310156
311332
  });
310157
311333
  const UnsubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -310159,7 +311335,7 @@ function build$1$1() {
310159
311335
  * Sent from the client to request cancellation of {@linkcode ResourceUpdatedNotification | resources/updated} notifications from the server. This should follow a previous {@linkcode SubscribeRequest | resources/subscribe} request.
310160
311336
  */
310161
311337
  const UnsubscribeRequestSchema$1 = RequestSchema$1.extend({
310162
- method: literal("resources/unsubscribe"),
311338
+ method: literal$1("resources/unsubscribe"),
310163
311339
  params: UnsubscribeRequestParamsSchema$1
310164
311340
  });
310165
311341
  /**
@@ -310170,7 +311346,7 @@ function build$1$1() {
310170
311346
  * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a {@linkcode SubscribeRequest | resources/subscribe} request.
310171
311347
  */
310172
311348
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
310173
- method: literal("notifications/resources/updated"),
311349
+ method: literal$1("notifications/resources/updated"),
310174
311350
  params: ResourceUpdatedNotificationParamsSchema$1
310175
311351
  });
310176
311352
  /**
@@ -310194,7 +311370,7 @@ function build$1$1() {
310194
311370
  /**
310195
311371
  * Sent from the client to request a list of prompts and prompt templates the server has.
310196
311372
  */
310197
- const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("prompts/list") });
311373
+ const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("prompts/list") });
310198
311374
  /**
310199
311375
  * The server's response to a {@linkcode ListPromptsRequest | prompts/list} request from the client.
310200
311376
  */
@@ -310210,14 +311386,14 @@ function build$1$1() {
310210
311386
  * Used by the client to get a prompt provided by the server.
310211
311387
  */
310212
311388
  const GetPromptRequestSchema$1 = RequestSchema$1.extend({
310213
- method: literal("prompts/get"),
311389
+ method: literal$1("prompts/get"),
310214
311390
  params: GetPromptRequestParamsSchema$1
310215
311391
  });
310216
311392
  /**
310217
311393
  * Text provided to or from an LLM.
310218
311394
  */
310219
311395
  const TextContentSchema$1 = object$1({
310220
- type: literal("text"),
311396
+ type: literal$1("text"),
310221
311397
  text: string(),
310222
311398
  annotations: AnnotationsSchema$1.optional(),
310223
311399
  _meta: record(string(), unknown()).optional()
@@ -310226,7 +311402,7 @@ function build$1$1() {
310226
311402
  * An image provided to or from an LLM.
310227
311403
  */
310228
311404
  const ImageContentSchema$1 = object$1({
310229
- type: literal("image"),
311405
+ type: literal$1("image"),
310230
311406
  data: Base64Schema,
310231
311407
  mimeType: string(),
310232
311408
  annotations: AnnotationsSchema$1.optional(),
@@ -310236,7 +311412,7 @@ function build$1$1() {
310236
311412
  * Audio content provided to or from an LLM.
310237
311413
  */
310238
311414
  const AudioContentSchema$1 = object$1({
310239
- type: literal("audio"),
311415
+ type: literal$1("audio"),
310240
311416
  data: Base64Schema,
310241
311417
  mimeType: string(),
310242
311418
  annotations: AnnotationsSchema$1.optional(),
@@ -310251,7 +311427,7 @@ function build$1$1() {
310251
311427
  * provider APIs directly.
310252
311428
  */
310253
311429
  const ToolUseContentSchema$1 = object$1({
310254
- type: literal("tool_use"),
311430
+ type: literal$1("tool_use"),
310255
311431
  name: string(),
310256
311432
  id: string(),
310257
311433
  input: record(string(), unknown()),
@@ -310261,7 +311437,7 @@ function build$1$1() {
310261
311437
  * The contents of a resource, embedded into a prompt or tool call result.
310262
311438
  */
310263
311439
  const EmbeddedResourceSchema$1 = object$1({
310264
- type: literal("resource"),
311440
+ type: literal$1("resource"),
310265
311441
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
310266
311442
  annotations: AnnotationsSchema$1.optional(),
310267
311443
  _meta: record(string(), unknown()).optional()
@@ -310271,7 +311447,7 @@ function build$1$1() {
310271
311447
  *
310272
311448
  * Note: resource links returned by tools are not guaranteed to appear in the results of {@linkcode ListResourcesRequest | resources/list} requests.
310273
311449
  */
310274
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
311450
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
310275
311451
  /**
310276
311452
  * A content block that can be used in prompts and tool results.
310277
311453
  */
@@ -310300,7 +311476,7 @@ function build$1$1() {
310300
311476
  * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
310301
311477
  */
310302
311478
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310303
- method: literal("notifications/prompts/list_changed"),
311479
+ method: literal$1("notifications/prompts/list_changed"),
310304
311480
  params: NotificationsParamsSchema$1.optional()
310305
311481
  });
310306
311482
  /**
@@ -310336,12 +311512,12 @@ function build$1$1() {
310336
311512
  ...IconsSchema$1.shape,
310337
311513
  description: string().optional(),
310338
311514
  inputSchema: object$1({
310339
- type: literal("object"),
311515
+ type: literal$1("object"),
310340
311516
  properties: record(string(), JSONValueSchema$1).optional(),
310341
311517
  required: array(string()).optional()
310342
311518
  }).catchall(unknown()),
310343
311519
  outputSchema: object$1({
310344
- type: literal("object"),
311520
+ type: literal$1("object"),
310345
311521
  properties: record(string(), JSONValueSchema$1).optional(),
310346
311522
  required: array(string()).optional()
310347
311523
  }).catchall(unknown()).optional(),
@@ -310352,7 +311528,7 @@ function build$1$1() {
310352
311528
  /**
310353
311529
  * Sent from the client to request a list of tools the server has.
310354
311530
  */
310355
- const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tools/list") });
311531
+ const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tools/list") });
310356
311532
  /**
310357
311533
  * The server's response to a {@linkcode ListToolsRequest | tools/list} request from the client.
310358
311534
  */
@@ -310376,14 +311552,14 @@ function build$1$1() {
310376
311552
  * Used by the client to invoke a tool provided by the server.
310377
311553
  */
310378
311554
  const CallToolRequestSchema$1 = RequestSchema$1.extend({
310379
- method: literal("tools/call"),
311555
+ method: literal$1("tools/call"),
310380
311556
  params: CallToolRequestParamsSchema$1
310381
311557
  });
310382
311558
  /**
310383
311559
  * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
310384
311560
  */
310385
311561
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310386
- method: literal("notifications/tools/list_changed"),
311562
+ method: literal$1("notifications/tools/list_changed"),
310387
311563
  params: NotificationsParamsSchema$1.optional()
310388
311564
  });
310389
311565
  /**
@@ -310419,7 +311595,7 @@ function build$1$1() {
310419
311595
  * (STDIO servers) or OpenTelemetry.
310420
311596
  */
310421
311597
  const SetLevelRequestSchema$1 = RequestSchema$1.extend({
310422
- method: literal("logging/setLevel"),
311598
+ method: literal$1("logging/setLevel"),
310423
311599
  params: SetLevelRequestParamsSchema$1
310424
311600
  });
310425
311601
  /**
@@ -310442,7 +311618,7 @@ function build$1$1() {
310442
311618
  * (STDIO servers) or OpenTelemetry.
310443
311619
  */
310444
311620
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
310445
- method: literal("notifications/message"),
311621
+ method: literal$1("notifications/message"),
310446
311622
  params: LoggingMessageNotificationParamsSchema$1
310447
311623
  });
310448
311624
  /**
@@ -310487,7 +311663,7 @@ function build$1$1() {
310487
311663
  * provider APIs directly.
310488
311664
  */
310489
311665
  const ToolResultContentSchema$1 = object$1({
310490
- type: literal("tool_result"),
311666
+ type: literal$1("tool_result"),
310491
311667
  toolUseId: string().describe("The unique identifier for the corresponding tool call."),
310492
311668
  content: array(ContentBlockSchema$1),
310493
311669
  structuredContent: object$1({}).loose().optional(),
@@ -310565,7 +311741,7 @@ function build$1$1() {
310565
311741
  * provider APIs directly.
310566
311742
  */
310567
311743
  const CreateMessageRequestSchema$1 = RequestSchema$1.extend({
310568
- method: literal("sampling/createMessage"),
311744
+ method: literal$1("sampling/createMessage"),
310569
311745
  params: CreateMessageRequestParamsSchema$1
310570
311746
  });
310571
311747
  /**
@@ -310610,7 +311786,7 @@ function build$1$1() {
310610
311786
  * Primitive schema definition for boolean fields.
310611
311787
  */
310612
311788
  const BooleanSchemaSchema$1 = object$1({
310613
- type: literal("boolean"),
311789
+ type: literal$1("boolean"),
310614
311790
  title: string().optional(),
310615
311791
  description: string().optional(),
310616
311792
  default: boolean().optional()
@@ -310619,7 +311795,7 @@ function build$1$1() {
310619
311795
  * Primitive schema definition for string fields.
310620
311796
  */
310621
311797
  const StringSchemaSchema$1 = object$1({
310622
- type: literal("string"),
311798
+ type: literal$1("string"),
310623
311799
  title: string().optional(),
310624
311800
  description: string().optional(),
310625
311801
  minLength: number$1().optional(),
@@ -310647,7 +311823,7 @@ function build$1$1() {
310647
311823
  * Schema for single-selection enumeration without display titles for options.
310648
311824
  */
310649
311825
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
310650
- type: literal("string"),
311826
+ type: literal$1("string"),
310651
311827
  title: string().optional(),
310652
311828
  description: string().optional(),
310653
311829
  enum: array(string()),
@@ -310657,7 +311833,7 @@ function build$1$1() {
310657
311833
  * Schema for single-selection enumeration with display titles for each option.
310658
311834
  */
310659
311835
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
310660
- type: literal("string"),
311836
+ type: literal$1("string"),
310661
311837
  title: string().optional(),
310662
311838
  description: string().optional(),
310663
311839
  oneOf: array(object$1({
@@ -310671,7 +311847,7 @@ function build$1$1() {
310671
311847
  * This interface will be removed in a future version.
310672
311848
  */
310673
311849
  const LegacyTitledEnumSchemaSchema$1 = object$1({
310674
- type: literal("string"),
311850
+ type: literal$1("string"),
310675
311851
  title: string().optional(),
310676
311852
  description: string().optional(),
310677
311853
  enum: array(string()),
@@ -310683,13 +311859,13 @@ function build$1$1() {
310683
311859
  * Schema for multiple-selection enumeration without display titles for options.
310684
311860
  */
310685
311861
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
310686
- type: literal("array"),
311862
+ type: literal$1("array"),
310687
311863
  title: string().optional(),
310688
311864
  description: string().optional(),
310689
311865
  minItems: number$1().optional(),
310690
311866
  maxItems: number$1().optional(),
310691
311867
  items: object$1({
310692
- type: literal("string"),
311868
+ type: literal$1("string"),
310693
311869
  enum: array(string())
310694
311870
  }),
310695
311871
  default: array(string()).optional()
@@ -310698,7 +311874,7 @@ function build$1$1() {
310698
311874
  * Schema for multiple-selection enumeration with display titles for each option.
310699
311875
  */
310700
311876
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
310701
- type: literal("array"),
311877
+ type: literal$1("array"),
310702
311878
  title: string().optional(),
310703
311879
  description: string().optional(),
310704
311880
  minItems: number$1().optional(),
@@ -310734,10 +311910,10 @@ function build$1$1() {
310734
311910
  * Parameters for an `elicitation/create` request for form-based elicitation.
310735
311911
  */
310736
311912
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
310737
- mode: literal("form").optional(),
311913
+ mode: literal$1("form").optional(),
310738
311914
  message: string(),
310739
311915
  requestedSchema: object$1({
310740
- type: literal("object"),
311916
+ type: literal$1("object"),
310741
311917
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
310742
311918
  required: array(string()).optional()
310743
311919
  }).catchall(unknown())
@@ -310746,7 +311922,7 @@ function build$1$1() {
310746
311922
  * Parameters for an {@linkcode ElicitRequest | elicitation/create} request for URL-based elicitation.
310747
311923
  */
310748
311924
  const ElicitRequestURLParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
310749
- mode: literal("url"),
311925
+ mode: literal$1("url"),
310750
311926
  message: string(),
310751
311927
  elicitationId: string(),
310752
311928
  url: string().url()
@@ -310761,7 +311937,7 @@ function build$1$1() {
310761
311937
  * or navigate to a URL (URL mode).
310762
311938
  */
310763
311939
  const ElicitRequestSchema$1 = RequestSchema$1.extend({
310764
- method: literal("elicitation/create"),
311940
+ method: literal$1("elicitation/create"),
310765
311941
  params: ElicitRequestParamsSchema$1
310766
311942
  });
310767
311943
  /**
@@ -310776,7 +311952,7 @@ function build$1$1() {
310776
311952
  * @category notifications/elicitation/complete
310777
311953
  */
310778
311954
  const ElicitationCompleteNotificationSchema$1 = NotificationSchema$1.extend({
310779
- method: literal("notifications/elicitation/complete"),
311955
+ method: literal$1("notifications/elicitation/complete"),
310780
311956
  params: ElicitationCompleteNotificationParamsSchema$1
310781
311957
  });
310782
311958
  /**
@@ -310799,14 +311975,14 @@ function build$1$1() {
310799
311975
  * A reference to a resource or resource template definition.
310800
311976
  */
310801
311977
  const ResourceTemplateReferenceSchema$1 = object$1({
310802
- type: literal("ref/resource"),
311978
+ type: literal$1("ref/resource"),
310803
311979
  uri: string()
310804
311980
  });
310805
311981
  /**
310806
311982
  * Identifies a prompt.
310807
311983
  */
310808
311984
  const PromptReferenceSchema$1 = object$1({
310809
- type: literal("ref/prompt"),
311985
+ type: literal$1("ref/prompt"),
310810
311986
  name: string()
310811
311987
  });
310812
311988
  /**
@@ -310824,7 +312000,7 @@ function build$1$1() {
310824
312000
  * A request from the client to the server, to ask for completion options.
310825
312001
  */
310826
312002
  const CompleteRequestSchema$1 = RequestSchema$1.extend({
310827
- method: literal("completion/complete"),
312003
+ method: literal$1("completion/complete"),
310828
312004
  params: CompleteRequestParamsSchema$1
310829
312005
  });
310830
312006
  /**
@@ -310855,7 +312031,7 @@ function build$1$1() {
310855
312031
  * tool parameters, resource URIs, or configuration.
310856
312032
  */
310857
312033
  const ListRootsRequestSchema$1 = RequestSchema$1.extend({
310858
- method: literal("roots/list"),
312034
+ method: literal$1("roots/list"),
310859
312035
  params: BaseRequestParamsSchema$1.optional()
310860
312036
  });
310861
312037
  /**
@@ -310874,7 +312050,7 @@ function build$1$1() {
310874
312050
  * tool parameters, resource URIs, or configuration.
310875
312051
  */
310876
312052
  const RootsListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310877
- method: literal("notifications/roots/list_changed"),
312053
+ method: literal$1("notifications/roots/list_changed"),
310878
312054
  params: NotificationsParamsSchema$1.optional()
310879
312055
  });
310880
312056
  /**
@@ -310930,7 +312106,7 @@ function build$1$1() {
310930
312106
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310931
312107
  */
310932
312108
  const TaskStatusNotificationSchema$1 = NotificationSchema$1.extend({
310933
- method: literal("notifications/tasks/status"),
312109
+ method: literal$1("notifications/tasks/status"),
310934
312110
  params: TaskStatusNotificationParamsSchema$1
310935
312111
  });
310936
312112
  /**
@@ -310939,7 +312115,7 @@ function build$1$1() {
310939
312115
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310940
312116
  */
310941
312117
  const GetTaskRequestSchema$1 = RequestSchema$1.extend({
310942
- method: literal("tasks/get"),
312118
+ method: literal$1("tasks/get"),
310943
312119
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
310944
312120
  });
310945
312121
  /**
@@ -310954,7 +312130,7 @@ function build$1$1() {
310954
312130
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310955
312131
  */
310956
312132
  const GetTaskPayloadRequestSchema$1 = RequestSchema$1.extend({
310957
- method: literal("tasks/result"),
312133
+ method: literal$1("tasks/result"),
310958
312134
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
310959
312135
  });
310960
312136
  /**
@@ -310971,7 +312147,7 @@ function build$1$1() {
310971
312147
  *
310972
312148
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310973
312149
  */
310974
- const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tasks/list") });
312150
+ const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tasks/list") });
310975
312151
  /**
310976
312152
  * The response to a {@linkcode ListTasksRequest | tasks/list} request.
310977
312153
  *
@@ -310984,7 +312160,7 @@ function build$1$1() {
310984
312160
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310985
312161
  */
310986
312162
  const CancelTaskRequestSchema$1 = RequestSchema$1.extend({
310987
- method: literal("tasks/cancel"),
312163
+ method: literal$1("tasks/cancel"),
310988
312164
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
310989
312165
  });
310990
312166
  return {
@@ -311602,7 +312778,7 @@ function build$2() {
311602
312778
  progressToken: ProgressTokenSchema$1
311603
312779
  });
311604
312780
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
311605
- method: literal("notifications/progress"),
312781
+ method: literal$1("notifications/progress"),
311606
312782
  params: ProgressNotificationParamsSchema$1
311607
312783
  });
311608
312784
  const LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({
@@ -311611,7 +312787,7 @@ function build$2() {
311611
312787
  data: unknown()
311612
312788
  });
311613
312789
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
311614
- method: literal("notifications/message"),
312790
+ method: literal$1("notifications/message"),
311615
312791
  params: LoggingMessageNotificationParamsSchema$1
311616
312792
  });
311617
312793
  const ResourceContentsSchema$1 = object$1({
@@ -311646,12 +312822,12 @@ function build$2() {
311646
312822
  _meta: optional(looseObject({}))
311647
312823
  });
311648
312824
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
311649
- method: literal("notifications/resources/list_changed"),
312825
+ method: literal$1("notifications/resources/list_changed"),
311650
312826
  params: NotificationsParamsSchema$1.optional()
311651
312827
  });
311652
312828
  const ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: string() });
311653
312829
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
311654
- method: literal("notifications/resources/updated"),
312830
+ method: literal$1("notifications/resources/updated"),
311655
312831
  params: ResourceUpdatedNotificationParamsSchema$1
311656
312832
  });
311657
312833
  const PromptArgumentSchema$1 = object$1({
@@ -311667,43 +312843,43 @@ function build$2() {
311667
312843
  _meta: optional(looseObject({}))
311668
312844
  });
311669
312845
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
311670
- method: literal("notifications/prompts/list_changed"),
312846
+ method: literal$1("notifications/prompts/list_changed"),
311671
312847
  params: NotificationsParamsSchema$1.optional()
311672
312848
  });
311673
312849
  const TextContentSchema$1 = object$1({
311674
- type: literal("text"),
312850
+ type: literal$1("text"),
311675
312851
  text: string(),
311676
312852
  annotations: AnnotationsSchema$1.optional(),
311677
312853
  _meta: record(string(), unknown()).optional()
311678
312854
  });
311679
312855
  const ImageContentSchema$1 = object$1({
311680
- type: literal("image"),
312856
+ type: literal$1("image"),
311681
312857
  data: Base64Schema,
311682
312858
  mimeType: string(),
311683
312859
  annotations: AnnotationsSchema$1.optional(),
311684
312860
  _meta: record(string(), unknown()).optional()
311685
312861
  });
311686
312862
  const AudioContentSchema$1 = object$1({
311687
- type: literal("audio"),
312863
+ type: literal$1("audio"),
311688
312864
  data: Base64Schema,
311689
312865
  mimeType: string(),
311690
312866
  annotations: AnnotationsSchema$1.optional(),
311691
312867
  _meta: record(string(), unknown()).optional()
311692
312868
  });
311693
312869
  const ToolUseContentSchema$1 = object$1({
311694
- type: literal("tool_use"),
312870
+ type: literal$1("tool_use"),
311695
312871
  name: string(),
311696
312872
  id: string(),
311697
312873
  input: record(string(), unknown()),
311698
312874
  _meta: record(string(), unknown()).optional()
311699
312875
  });
311700
312876
  const EmbeddedResourceSchema$1 = object$1({
311701
- type: literal("resource"),
312877
+ type: literal$1("resource"),
311702
312878
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
311703
312879
  annotations: AnnotationsSchema$1.optional(),
311704
312880
  _meta: record(string(), unknown()).optional()
311705
312881
  });
311706
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
312882
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
311707
312883
  const ContentBlockSchema$1 = union([
311708
312884
  TextContentSchema$1,
311709
312885
  ImageContentSchema$1,
@@ -311723,7 +312899,7 @@ function build$2() {
311723
312899
  openWorldHint: boolean().optional()
311724
312900
  });
311725
312901
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
311726
- method: literal("notifications/tools/list_changed"),
312902
+ method: literal$1("notifications/tools/list_changed"),
311727
312903
  params: NotificationsParamsSchema$1.optional()
311728
312904
  });
311729
312905
  const ModelHintSchema$1 = object$1({ name: string().optional() });
@@ -311739,13 +312915,13 @@ function build$2() {
311739
312915
  "none"
311740
312916
  ]).optional() });
311741
312917
  const BooleanSchemaSchema$1 = object$1({
311742
- type: literal("boolean"),
312918
+ type: literal$1("boolean"),
311743
312919
  title: string().optional(),
311744
312920
  description: string().optional(),
311745
312921
  default: boolean().optional()
311746
312922
  });
311747
312923
  const StringSchemaSchema$1 = object$1({
311748
- type: literal("string"),
312924
+ type: literal$1("string"),
311749
312925
  title: string().optional(),
311750
312926
  description: string().optional(),
311751
312927
  minLength: number$1().optional(),
@@ -311767,14 +312943,14 @@ function build$2() {
311767
312943
  default: number$1().optional()
311768
312944
  });
311769
312945
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
311770
- type: literal("string"),
312946
+ type: literal$1("string"),
311771
312947
  title: string().optional(),
311772
312948
  description: string().optional(),
311773
312949
  enum: array(string()),
311774
312950
  default: string().optional()
311775
312951
  });
311776
312952
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
311777
- type: literal("string"),
312953
+ type: literal$1("string"),
311778
312954
  title: string().optional(),
311779
312955
  description: string().optional(),
311780
312956
  oneOf: array(object$1({
@@ -311784,7 +312960,7 @@ function build$2() {
311784
312960
  default: string().optional()
311785
312961
  });
311786
312962
  const LegacyTitledEnumSchemaSchema$1 = object$1({
311787
- type: literal("string"),
312963
+ type: literal$1("string"),
311788
312964
  title: string().optional(),
311789
312965
  description: string().optional(),
311790
312966
  enum: array(string()),
@@ -311793,19 +312969,19 @@ function build$2() {
311793
312969
  });
311794
312970
  const SingleSelectEnumSchemaSchema$1 = union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);
311795
312971
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
311796
- type: literal("array"),
312972
+ type: literal$1("array"),
311797
312973
  title: string().optional(),
311798
312974
  description: string().optional(),
311799
312975
  minItems: number$1().optional(),
311800
312976
  maxItems: number$1().optional(),
311801
312977
  items: object$1({
311802
- type: literal("string"),
312978
+ type: literal$1("string"),
311803
312979
  enum: array(string())
311804
312980
  }),
311805
312981
  default: array(string()).optional()
311806
312982
  });
311807
312983
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
311808
- type: literal("array"),
312984
+ type: literal$1("array"),
311809
312985
  title: string().optional(),
311810
312986
  description: string().optional(),
311811
312987
  minItems: number$1().optional(),
@@ -311829,20 +313005,20 @@ function build$2() {
311829
313005
  NumberSchemaSchema$1
311830
313006
  ]);
311831
313007
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
311832
- mode: literal("form").optional(),
313008
+ mode: literal$1("form").optional(),
311833
313009
  message: string(),
311834
313010
  requestedSchema: object$1({
311835
- type: literal("object"),
313011
+ type: literal$1("object"),
311836
313012
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
311837
313013
  required: array(string()).optional()
311838
313014
  }).catchall(unknown())
311839
313015
  });
311840
313016
  const ResourceTemplateReferenceSchema$1 = object$1({
311841
- type: literal("ref/resource"),
313017
+ type: literal$1("ref/resource"),
311842
313018
  uri: string()
311843
313019
  });
311844
313020
  const PromptReferenceSchema$1 = object$1({
311845
- type: literal("ref/prompt"),
313021
+ type: literal$1("ref/prompt"),
311846
313022
  name: string()
311847
313023
  });
311848
313024
  const RootSchema$1 = object$1({
@@ -311893,7 +313069,7 @@ function build$2() {
311893
313069
  description: string().optional(),
311894
313070
  inputSchema: looseObject({
311895
313071
  $schema: string().optional(),
311896
- type: literal("object")
313072
+ type: literal$1("object")
311897
313073
  }),
311898
313074
  outputSchema: looseObject({ $schema: string().optional() }).optional(),
311899
313075
  annotations: ToolAnnotationsSchema$1.optional(),
@@ -311901,7 +313077,7 @@ function build$2() {
311901
313077
  });
311902
313078
  /** 2026-era ToolResultContent (anchor-exact: `structuredContent?: unknown`). */
311903
313079
  const ToolResultContentSchema$1 = object$1({
311904
- type: literal("tool_result"),
313080
+ type: literal$1("tool_result"),
311905
313081
  toolUseId: string(),
311906
313082
  content: array(ContentBlockSchema$1),
311907
313083
  structuredContent: unknown().optional(),
@@ -312014,7 +313190,7 @@ function build$2() {
312014
313190
  });
312015
313191
  /** 2026-era embedded sampling request (de-JSON-RPC'd). */
312016
313192
  const CreateMessageRequestSchema$1 = object$1({
312017
- method: literal("sampling/createMessage"),
313193
+ method: literal$1("sampling/createMessage"),
312018
313194
  params: CreateMessageRequestParamsSchema$1
312019
313195
  });
312020
313196
  /**
@@ -312023,7 +313199,7 @@ function build$2() {
312023
313199
  * the anchor declares a bare optional `_meta` on `params`.
312024
313200
  */
312025
313201
  const ListRootsRequestSchema$1 = object$1({
312026
- method: literal("roots/list"),
313202
+ method: literal$1("roots/list"),
312027
313203
  params: object$1({ _meta: record(string(), unknown()).optional() }).optional()
312028
313204
  });
312029
313205
  /** 2026-era embedded sampling response (anchor-exact: extends the forked SamplingMessage). */
@@ -312055,7 +313231,7 @@ function build$2() {
312055
313231
  * frozen 2025-11-25 revision.
312056
313232
  */
312057
313233
  const ElicitRequestURLParamsSchema$1 = object$1({
312058
- mode: literal("url"),
313234
+ mode: literal$1("url"),
312059
313235
  message: string(),
312060
313236
  url: string().url()
312061
313237
  });
@@ -312063,7 +313239,7 @@ function build$2() {
312063
313239
  const ElicitRequestParamsSchema$1 = union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);
312064
313240
  /** 2026-era embedded elicitation request (de-JSON-RPC'd; see the URL-mode fork above). */
312065
313241
  const ElicitRequestSchema$1 = object$1({
312066
- method: literal("elicitation/create"),
313242
+ method: literal$1("elicitation/create"),
312067
313243
  params: ElicitRequestParamsSchema$1
312068
313244
  });
312069
313245
  /** A single embedded input request (one of the three demoted server→client requests). */
@@ -312105,7 +313281,7 @@ function build$2() {
312105
313281
  const DispatchRequestMetaSchema = looseObject({ progressToken: ProgressTokenSchema$1.optional() });
312106
313282
  function wireRequest(method, paramsShape) {
312107
313283
  return object$1({
312108
- method: literal(method),
313284
+ method: literal$1(method),
312109
313285
  params: object$1({
312110
313286
  _meta: RequestMetaEnvelopeSchema,
312111
313287
  ...paramsShape
@@ -312114,7 +313290,7 @@ function build$2() {
312114
313290
  }
312115
313291
  function dispatchRequest(method, paramsShape) {
312116
313292
  return object$1({
312117
- method: literal(method),
313293
+ method: literal$1(method),
312118
313294
  params: object$1({
312119
313295
  _meta: DispatchRequestMetaSchema.optional(),
312120
313296
  ...paramsShape
@@ -312262,7 +313438,7 @@ function build$2() {
312262
313438
  const NotificationMetaSchema = looseObject({ "io.modelcontextprotocol/subscriptionId": RequestIdSchema$1.optional() });
312263
313439
  /** Anchor SubscriptionsAcknowledgedNotification (2026-only). */
312264
313440
  const SubscriptionsAcknowledgedNotificationSchema$1 = object$1({
312265
- method: literal("notifications/subscriptions/acknowledged"),
313441
+ method: literal$1("notifications/subscriptions/acknowledged"),
312266
313442
  params: object$1({
312267
313443
  _meta: NotificationMetaSchema.optional(),
312268
313444
  notifications: SubscriptionFilterSchema$1
@@ -312282,7 +313458,7 @@ function build$2() {
312282
313458
  });
312283
313459
  /** 2026-era `notifications/cancelled` (see the params fork above). */
312284
313460
  const CancelledNotificationSchema$1 = object$1({
312285
- method: literal("notifications/cancelled"),
313461
+ method: literal$1("notifications/cancelled"),
312286
313462
  params: CancelledNotificationParamsSchema$1
312287
313463
  });
312288
313464
  const notificationSchemas2026 = {
@@ -312296,7 +313472,7 @@ function build$2() {
312296
313472
  "notifications/subscriptions/acknowledged": SubscriptionsAcknowledgedNotificationSchema$1
312297
313473
  };
312298
313474
  const wireResultResponse = (result) => object$1({
312299
- jsonrpc: literal("2.0"),
313475
+ jsonrpc: literal$1("2.0"),
312300
313476
  id: union([string(), number$1().int()]),
312301
313477
  result
312302
313478
  }).strict();
@@ -312579,15 +313755,15 @@ function inputSchemaMaps$1() {
312579
313755
  maps$2 = {
312580
313756
  request: {
312581
313757
  "elicitation/create": object$1({
312582
- method: literal("elicitation/create"),
313758
+ method: literal$1("elicitation/create"),
312583
313759
  params: s.ElicitRequestParamsSchema
312584
313760
  }),
312585
313761
  "sampling/createMessage": object$1({
312586
- method: literal("sampling/createMessage"),
313762
+ method: literal$1("sampling/createMessage"),
312587
313763
  params: s.CreateMessageRequestParamsSchema
312588
313764
  }),
312589
313765
  "roots/list": object$1({
312590
- method: literal("roots/list"),
313766
+ method: literal$1("roots/list"),
312591
313767
  params: looseObject({}).optional()
312592
313768
  })
312593
313769
  },
@@ -564047,7 +565223,7 @@ function build$1() {
564047
565223
  * A client MUST NOT attempt to cancel its {@linkcode InitializeRequest | initialize} request.
564048
565224
  */
564049
565225
  const CancelledNotificationSchema$1 = NotificationSchema$1.extend({
564050
- method: literal("notifications/cancelled"),
565226
+ method: literal$1("notifications/cancelled"),
564051
565227
  params: CancelledNotificationParamsSchema$1
564052
565228
  });
564053
565229
  /**
@@ -564135,7 +565311,7 @@ function build$1() {
564135
565311
  * This request is sent from the client to the server when it first connects, asking it to begin initialization.
564136
565312
  */
564137
565313
  const InitializeRequestSchema$1 = RequestSchema$1.extend({
564138
- method: literal("initialize"),
565314
+ method: literal$1("initialize"),
564139
565315
  params: InitializeRequestParamsSchema$1
564140
565316
  });
564141
565317
  /**
@@ -564167,14 +565343,14 @@ function build$1() {
564167
565343
  * This notification is sent from the client to the server after initialization has finished.
564168
565344
  */
564169
565345
  const InitializedNotificationSchema$1 = NotificationSchema$1.extend({
564170
- method: literal("notifications/initialized"),
565346
+ method: literal$1("notifications/initialized"),
564171
565347
  params: NotificationsParamsSchema$1.optional()
564172
565348
  });
564173
565349
  /**
564174
565350
  * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
564175
565351
  */
564176
565352
  const PingRequestSchema$1 = RequestSchema$1.extend({
564177
- method: literal("ping"),
565353
+ method: literal$1("ping"),
564178
565354
  params: BaseRequestParamsSchema$1.optional()
564179
565355
  });
564180
565356
  const ProgressSchema$1 = object$1({
@@ -564193,7 +565369,7 @@ function build$1() {
564193
565369
  * @category notifications/progress
564194
565370
  */
564195
565371
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
564196
- method: literal("notifications/progress"),
565372
+ method: literal$1("notifications/progress"),
564197
565373
  params: ProgressNotificationParamsSchema$1
564198
565374
  });
564199
565375
  const PaginatedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ cursor: CursorSchema$1.optional() });
@@ -564262,7 +565438,7 @@ function build$1() {
564262
565438
  /**
564263
565439
  * Sent from the client to request a list of resources the server has.
564264
565440
  */
564265
- const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/list") });
565441
+ const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/list") });
564266
565442
  /**
564267
565443
  * The server's response to a {@linkcode ListResourcesRequest | resources/list} request from the client.
564268
565444
  */
@@ -564270,7 +565446,7 @@ function build$1() {
564270
565446
  /**
564271
565447
  * Sent from the client to request a list of resource templates the server has.
564272
565448
  */
564273
- const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/templates/list") });
565449
+ const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/templates/list") });
564274
565450
  /**
564275
565451
  * The server's response to a {@linkcode ListResourceTemplatesRequest | resources/templates/list} request from the client.
564276
565452
  */
@@ -564284,7 +565460,7 @@ function build$1() {
564284
565460
  * Sent from the client to the server, to read a specific resource URI.
564285
565461
  */
564286
565462
  const ReadResourceRequestSchema$1 = RequestSchema$1.extend({
564287
- method: literal("resources/read"),
565463
+ method: literal$1("resources/read"),
564288
565464
  params: ReadResourceRequestParamsSchema$1
564289
565465
  });
564290
565466
  /**
@@ -564295,7 +565471,7 @@ function build$1() {
564295
565471
  * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
564296
565472
  */
564297
565473
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
564298
- method: literal("notifications/resources/list_changed"),
565474
+ method: literal$1("notifications/resources/list_changed"),
564299
565475
  params: NotificationsParamsSchema$1.optional()
564300
565476
  });
564301
565477
  const SubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -564303,7 +565479,7 @@ function build$1() {
564303
565479
  * Sent from the client to request `resources/updated` notifications from the server whenever a particular resource changes.
564304
565480
  */
564305
565481
  const SubscribeRequestSchema$1 = RequestSchema$1.extend({
564306
- method: literal("resources/subscribe"),
565482
+ method: literal$1("resources/subscribe"),
564307
565483
  params: SubscribeRequestParamsSchema$1
564308
565484
  });
564309
565485
  const UnsubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -564311,7 +565487,7 @@ function build$1() {
564311
565487
  * Sent from the client to request cancellation of {@linkcode ResourceUpdatedNotification | resources/updated} notifications from the server. This should follow a previous {@linkcode SubscribeRequest | resources/subscribe} request.
564312
565488
  */
564313
565489
  const UnsubscribeRequestSchema$1 = RequestSchema$1.extend({
564314
- method: literal("resources/unsubscribe"),
565490
+ method: literal$1("resources/unsubscribe"),
564315
565491
  params: UnsubscribeRequestParamsSchema$1
564316
565492
  });
564317
565493
  /**
@@ -564322,7 +565498,7 @@ function build$1() {
564322
565498
  * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a {@linkcode SubscribeRequest | resources/subscribe} request.
564323
565499
  */
564324
565500
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
564325
- method: literal("notifications/resources/updated"),
565501
+ method: literal$1("notifications/resources/updated"),
564326
565502
  params: ResourceUpdatedNotificationParamsSchema$1
564327
565503
  });
564328
565504
  /**
@@ -564346,7 +565522,7 @@ function build$1() {
564346
565522
  /**
564347
565523
  * Sent from the client to request a list of prompts and prompt templates the server has.
564348
565524
  */
564349
- const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("prompts/list") });
565525
+ const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("prompts/list") });
564350
565526
  /**
564351
565527
  * The server's response to a {@linkcode ListPromptsRequest | prompts/list} request from the client.
564352
565528
  */
@@ -564362,14 +565538,14 @@ function build$1() {
564362
565538
  * Used by the client to get a prompt provided by the server.
564363
565539
  */
564364
565540
  const GetPromptRequestSchema$1 = RequestSchema$1.extend({
564365
- method: literal("prompts/get"),
565541
+ method: literal$1("prompts/get"),
564366
565542
  params: GetPromptRequestParamsSchema$1
564367
565543
  });
564368
565544
  /**
564369
565545
  * Text provided to or from an LLM.
564370
565546
  */
564371
565547
  const TextContentSchema$1 = object$1({
564372
- type: literal("text"),
565548
+ type: literal$1("text"),
564373
565549
  text: string(),
564374
565550
  annotations: AnnotationsSchema$1.optional(),
564375
565551
  _meta: record(string(), unknown()).optional()
@@ -564378,7 +565554,7 @@ function build$1() {
564378
565554
  * An image provided to or from an LLM.
564379
565555
  */
564380
565556
  const ImageContentSchema$1 = object$1({
564381
- type: literal("image"),
565557
+ type: literal$1("image"),
564382
565558
  data: Base64Schema,
564383
565559
  mimeType: string(),
564384
565560
  annotations: AnnotationsSchema$1.optional(),
@@ -564388,7 +565564,7 @@ function build$1() {
564388
565564
  * Audio content provided to or from an LLM.
564389
565565
  */
564390
565566
  const AudioContentSchema$1 = object$1({
564391
- type: literal("audio"),
565567
+ type: literal$1("audio"),
564392
565568
  data: Base64Schema,
564393
565569
  mimeType: string(),
564394
565570
  annotations: AnnotationsSchema$1.optional(),
@@ -564403,7 +565579,7 @@ function build$1() {
564403
565579
  * provider APIs directly.
564404
565580
  */
564405
565581
  const ToolUseContentSchema$1 = object$1({
564406
- type: literal("tool_use"),
565582
+ type: literal$1("tool_use"),
564407
565583
  name: string(),
564408
565584
  id: string(),
564409
565585
  input: record(string(), unknown()),
@@ -564413,7 +565589,7 @@ function build$1() {
564413
565589
  * The contents of a resource, embedded into a prompt or tool call result.
564414
565590
  */
564415
565591
  const EmbeddedResourceSchema$1 = object$1({
564416
- type: literal("resource"),
565592
+ type: literal$1("resource"),
564417
565593
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
564418
565594
  annotations: AnnotationsSchema$1.optional(),
564419
565595
  _meta: record(string(), unknown()).optional()
@@ -564423,7 +565599,7 @@ function build$1() {
564423
565599
  *
564424
565600
  * Note: resource links returned by tools are not guaranteed to appear in the results of {@linkcode ListResourcesRequest | resources/list} requests.
564425
565601
  */
564426
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
565602
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
564427
565603
  /**
564428
565604
  * A content block that can be used in prompts and tool results.
564429
565605
  */
@@ -564452,7 +565628,7 @@ function build$1() {
564452
565628
  * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
564453
565629
  */
564454
565630
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
564455
- method: literal("notifications/prompts/list_changed"),
565631
+ method: literal$1("notifications/prompts/list_changed"),
564456
565632
  params: NotificationsParamsSchema$1.optional()
564457
565633
  });
564458
565634
  /**
@@ -564488,12 +565664,12 @@ function build$1() {
564488
565664
  ...IconsSchema$1.shape,
564489
565665
  description: string().optional(),
564490
565666
  inputSchema: object$1({
564491
- type: literal("object"),
565667
+ type: literal$1("object"),
564492
565668
  properties: record(string(), JSONValueSchema$1).optional(),
564493
565669
  required: array(string()).optional()
564494
565670
  }).catchall(unknown()),
564495
565671
  outputSchema: object$1({
564496
- type: literal("object"),
565672
+ type: literal$1("object"),
564497
565673
  properties: record(string(), JSONValueSchema$1).optional(),
564498
565674
  required: array(string()).optional()
564499
565675
  }).catchall(unknown()).optional(),
@@ -564504,7 +565680,7 @@ function build$1() {
564504
565680
  /**
564505
565681
  * Sent from the client to request a list of tools the server has.
564506
565682
  */
564507
- const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tools/list") });
565683
+ const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tools/list") });
564508
565684
  /**
564509
565685
  * The server's response to a {@linkcode ListToolsRequest | tools/list} request from the client.
564510
565686
  */
@@ -564528,14 +565704,14 @@ function build$1() {
564528
565704
  * Used by the client to invoke a tool provided by the server.
564529
565705
  */
564530
565706
  const CallToolRequestSchema$1 = RequestSchema$1.extend({
564531
- method: literal("tools/call"),
565707
+ method: literal$1("tools/call"),
564532
565708
  params: CallToolRequestParamsSchema$1
564533
565709
  });
564534
565710
  /**
564535
565711
  * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
564536
565712
  */
564537
565713
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
564538
- method: literal("notifications/tools/list_changed"),
565714
+ method: literal$1("notifications/tools/list_changed"),
564539
565715
  params: NotificationsParamsSchema$1.optional()
564540
565716
  });
564541
565717
  /**
@@ -564571,7 +565747,7 @@ function build$1() {
564571
565747
  * (STDIO servers) or OpenTelemetry.
564572
565748
  */
564573
565749
  const SetLevelRequestSchema$1 = RequestSchema$1.extend({
564574
- method: literal("logging/setLevel"),
565750
+ method: literal$1("logging/setLevel"),
564575
565751
  params: SetLevelRequestParamsSchema$1
564576
565752
  });
564577
565753
  /**
@@ -564594,7 +565770,7 @@ function build$1() {
564594
565770
  * (STDIO servers) or OpenTelemetry.
564595
565771
  */
564596
565772
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
564597
- method: literal("notifications/message"),
565773
+ method: literal$1("notifications/message"),
564598
565774
  params: LoggingMessageNotificationParamsSchema$1
564599
565775
  });
564600
565776
  /**
@@ -564639,7 +565815,7 @@ function build$1() {
564639
565815
  * provider APIs directly.
564640
565816
  */
564641
565817
  const ToolResultContentSchema$1 = object$1({
564642
- type: literal("tool_result"),
565818
+ type: literal$1("tool_result"),
564643
565819
  toolUseId: string().describe("The unique identifier for the corresponding tool call."),
564644
565820
  content: array(ContentBlockSchema$1),
564645
565821
  structuredContent: object$1({}).loose().optional(),
@@ -564717,7 +565893,7 @@ function build$1() {
564717
565893
  * provider APIs directly.
564718
565894
  */
564719
565895
  const CreateMessageRequestSchema$1 = RequestSchema$1.extend({
564720
- method: literal("sampling/createMessage"),
565896
+ method: literal$1("sampling/createMessage"),
564721
565897
  params: CreateMessageRequestParamsSchema$1
564722
565898
  });
564723
565899
  /**
@@ -564762,7 +565938,7 @@ function build$1() {
564762
565938
  * Primitive schema definition for boolean fields.
564763
565939
  */
564764
565940
  const BooleanSchemaSchema$1 = object$1({
564765
- type: literal("boolean"),
565941
+ type: literal$1("boolean"),
564766
565942
  title: string().optional(),
564767
565943
  description: string().optional(),
564768
565944
  default: boolean().optional()
@@ -564771,7 +565947,7 @@ function build$1() {
564771
565947
  * Primitive schema definition for string fields.
564772
565948
  */
564773
565949
  const StringSchemaSchema$1 = object$1({
564774
- type: literal("string"),
565950
+ type: literal$1("string"),
564775
565951
  title: string().optional(),
564776
565952
  description: string().optional(),
564777
565953
  minLength: number$1().optional(),
@@ -564799,7 +565975,7 @@ function build$1() {
564799
565975
  * Schema for single-selection enumeration without display titles for options.
564800
565976
  */
564801
565977
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
564802
- type: literal("string"),
565978
+ type: literal$1("string"),
564803
565979
  title: string().optional(),
564804
565980
  description: string().optional(),
564805
565981
  enum: array(string()),
@@ -564809,7 +565985,7 @@ function build$1() {
564809
565985
  * Schema for single-selection enumeration with display titles for each option.
564810
565986
  */
564811
565987
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
564812
- type: literal("string"),
565988
+ type: literal$1("string"),
564813
565989
  title: string().optional(),
564814
565990
  description: string().optional(),
564815
565991
  oneOf: array(object$1({
@@ -564823,7 +565999,7 @@ function build$1() {
564823
565999
  * This interface will be removed in a future version.
564824
566000
  */
564825
566001
  const LegacyTitledEnumSchemaSchema$1 = object$1({
564826
- type: literal("string"),
566002
+ type: literal$1("string"),
564827
566003
  title: string().optional(),
564828
566004
  description: string().optional(),
564829
566005
  enum: array(string()),
@@ -564835,13 +566011,13 @@ function build$1() {
564835
566011
  * Schema for multiple-selection enumeration without display titles for options.
564836
566012
  */
564837
566013
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
564838
- type: literal("array"),
566014
+ type: literal$1("array"),
564839
566015
  title: string().optional(),
564840
566016
  description: string().optional(),
564841
566017
  minItems: number$1().optional(),
564842
566018
  maxItems: number$1().optional(),
564843
566019
  items: object$1({
564844
- type: literal("string"),
566020
+ type: literal$1("string"),
564845
566021
  enum: array(string())
564846
566022
  }),
564847
566023
  default: array(string()).optional()
@@ -564850,7 +566026,7 @@ function build$1() {
564850
566026
  * Schema for multiple-selection enumeration with display titles for each option.
564851
566027
  */
564852
566028
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
564853
- type: literal("array"),
566029
+ type: literal$1("array"),
564854
566030
  title: string().optional(),
564855
566031
  description: string().optional(),
564856
566032
  minItems: number$1().optional(),
@@ -564886,10 +566062,10 @@ function build$1() {
564886
566062
  * Parameters for an `elicitation/create` request for form-based elicitation.
564887
566063
  */
564888
566064
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
564889
- mode: literal("form").optional(),
566065
+ mode: literal$1("form").optional(),
564890
566066
  message: string(),
564891
566067
  requestedSchema: object$1({
564892
- type: literal("object"),
566068
+ type: literal$1("object"),
564893
566069
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
564894
566070
  required: array(string()).optional()
564895
566071
  }).catchall(unknown())
@@ -564898,7 +566074,7 @@ function build$1() {
564898
566074
  * Parameters for an {@linkcode ElicitRequest | elicitation/create} request for URL-based elicitation.
564899
566075
  */
564900
566076
  const ElicitRequestURLParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
564901
- mode: literal("url"),
566077
+ mode: literal$1("url"),
564902
566078
  message: string(),
564903
566079
  elicitationId: string(),
564904
566080
  url: string().url()
@@ -564913,7 +566089,7 @@ function build$1() {
564913
566089
  * or navigate to a URL (URL mode).
564914
566090
  */
564915
566091
  const ElicitRequestSchema$1 = RequestSchema$1.extend({
564916
- method: literal("elicitation/create"),
566092
+ method: literal$1("elicitation/create"),
564917
566093
  params: ElicitRequestParamsSchema$1
564918
566094
  });
564919
566095
  /**
@@ -564928,7 +566104,7 @@ function build$1() {
564928
566104
  * @category notifications/elicitation/complete
564929
566105
  */
564930
566106
  const ElicitationCompleteNotificationSchema$1 = NotificationSchema$1.extend({
564931
- method: literal("notifications/elicitation/complete"),
566107
+ method: literal$1("notifications/elicitation/complete"),
564932
566108
  params: ElicitationCompleteNotificationParamsSchema$1
564933
566109
  });
564934
566110
  /**
@@ -564951,14 +566127,14 @@ function build$1() {
564951
566127
  * A reference to a resource or resource template definition.
564952
566128
  */
564953
566129
  const ResourceTemplateReferenceSchema$1 = object$1({
564954
- type: literal("ref/resource"),
566130
+ type: literal$1("ref/resource"),
564955
566131
  uri: string()
564956
566132
  });
564957
566133
  /**
564958
566134
  * Identifies a prompt.
564959
566135
  */
564960
566136
  const PromptReferenceSchema$1 = object$1({
564961
- type: literal("ref/prompt"),
566137
+ type: literal$1("ref/prompt"),
564962
566138
  name: string()
564963
566139
  });
564964
566140
  /**
@@ -564976,7 +566152,7 @@ function build$1() {
564976
566152
  * A request from the client to the server, to ask for completion options.
564977
566153
  */
564978
566154
  const CompleteRequestSchema$1 = RequestSchema$1.extend({
564979
- method: literal("completion/complete"),
566155
+ method: literal$1("completion/complete"),
564980
566156
  params: CompleteRequestParamsSchema$1
564981
566157
  });
564982
566158
  /**
@@ -565007,7 +566183,7 @@ function build$1() {
565007
566183
  * tool parameters, resource URIs, or configuration.
565008
566184
  */
565009
566185
  const ListRootsRequestSchema$1 = RequestSchema$1.extend({
565010
- method: literal("roots/list"),
566186
+ method: literal$1("roots/list"),
565011
566187
  params: BaseRequestParamsSchema$1.optional()
565012
566188
  });
565013
566189
  /**
@@ -565026,7 +566202,7 @@ function build$1() {
565026
566202
  * tool parameters, resource URIs, or configuration.
565027
566203
  */
565028
566204
  const RootsListChangedNotificationSchema$1 = NotificationSchema$1.extend({
565029
- method: literal("notifications/roots/list_changed"),
566205
+ method: literal$1("notifications/roots/list_changed"),
565030
566206
  params: NotificationsParamsSchema$1.optional()
565031
566207
  });
565032
566208
  /**
@@ -565082,7 +566258,7 @@ function build$1() {
565082
566258
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565083
566259
  */
565084
566260
  const TaskStatusNotificationSchema$1 = NotificationSchema$1.extend({
565085
- method: literal("notifications/tasks/status"),
566261
+ method: literal$1("notifications/tasks/status"),
565086
566262
  params: TaskStatusNotificationParamsSchema$1
565087
566263
  });
565088
566264
  /**
@@ -565091,7 +566267,7 @@ function build$1() {
565091
566267
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565092
566268
  */
565093
566269
  const GetTaskRequestSchema$1 = RequestSchema$1.extend({
565094
- method: literal("tasks/get"),
566270
+ method: literal$1("tasks/get"),
565095
566271
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
565096
566272
  });
565097
566273
  /**
@@ -565106,7 +566282,7 @@ function build$1() {
565106
566282
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565107
566283
  */
565108
566284
  const GetTaskPayloadRequestSchema$1 = RequestSchema$1.extend({
565109
- method: literal("tasks/result"),
566285
+ method: literal$1("tasks/result"),
565110
566286
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
565111
566287
  });
565112
566288
  /**
@@ -565123,7 +566299,7 @@ function build$1() {
565123
566299
  *
565124
566300
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565125
566301
  */
565126
- const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tasks/list") });
566302
+ const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tasks/list") });
565127
566303
  /**
565128
566304
  * The response to a {@linkcode ListTasksRequest | tasks/list} request.
565129
566305
  *
@@ -565136,7 +566312,7 @@ function build$1() {
565136
566312
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565137
566313
  */
565138
566314
  const CancelTaskRequestSchema$1 = RequestSchema$1.extend({
565139
- method: literal("tasks/cancel"),
566315
+ method: literal$1("tasks/cancel"),
565140
566316
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
565141
566317
  });
565142
566318
  return {
@@ -565890,7 +567066,7 @@ function build() {
565890
567066
  progressToken: ProgressTokenSchema$1
565891
567067
  });
565892
567068
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
565893
- method: literal("notifications/progress"),
567069
+ method: literal$1("notifications/progress"),
565894
567070
  params: ProgressNotificationParamsSchema$1
565895
567071
  });
565896
567072
  const LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({
@@ -565899,7 +567075,7 @@ function build() {
565899
567075
  data: unknown()
565900
567076
  });
565901
567077
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
565902
- method: literal("notifications/message"),
567078
+ method: literal$1("notifications/message"),
565903
567079
  params: LoggingMessageNotificationParamsSchema$1
565904
567080
  });
565905
567081
  const ResourceContentsSchema$1 = object$1({
@@ -565934,12 +567110,12 @@ function build() {
565934
567110
  _meta: optional(looseObject({}))
565935
567111
  });
565936
567112
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
565937
- method: literal("notifications/resources/list_changed"),
567113
+ method: literal$1("notifications/resources/list_changed"),
565938
567114
  params: NotificationsParamsSchema$1.optional()
565939
567115
  });
565940
567116
  const ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: string() });
565941
567117
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
565942
- method: literal("notifications/resources/updated"),
567118
+ method: literal$1("notifications/resources/updated"),
565943
567119
  params: ResourceUpdatedNotificationParamsSchema$1
565944
567120
  });
565945
567121
  const PromptArgumentSchema$1 = object$1({
@@ -565955,43 +567131,43 @@ function build() {
565955
567131
  _meta: optional(looseObject({}))
565956
567132
  });
565957
567133
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
565958
- method: literal("notifications/prompts/list_changed"),
567134
+ method: literal$1("notifications/prompts/list_changed"),
565959
567135
  params: NotificationsParamsSchema$1.optional()
565960
567136
  });
565961
567137
  const TextContentSchema$1 = object$1({
565962
- type: literal("text"),
567138
+ type: literal$1("text"),
565963
567139
  text: string(),
565964
567140
  annotations: AnnotationsSchema$1.optional(),
565965
567141
  _meta: record(string(), unknown()).optional()
565966
567142
  });
565967
567143
  const ImageContentSchema$1 = object$1({
565968
- type: literal("image"),
567144
+ type: literal$1("image"),
565969
567145
  data: Base64Schema,
565970
567146
  mimeType: string(),
565971
567147
  annotations: AnnotationsSchema$1.optional(),
565972
567148
  _meta: record(string(), unknown()).optional()
565973
567149
  });
565974
567150
  const AudioContentSchema$1 = object$1({
565975
- type: literal("audio"),
567151
+ type: literal$1("audio"),
565976
567152
  data: Base64Schema,
565977
567153
  mimeType: string(),
565978
567154
  annotations: AnnotationsSchema$1.optional(),
565979
567155
  _meta: record(string(), unknown()).optional()
565980
567156
  });
565981
567157
  const ToolUseContentSchema$1 = object$1({
565982
- type: literal("tool_use"),
567158
+ type: literal$1("tool_use"),
565983
567159
  name: string(),
565984
567160
  id: string(),
565985
567161
  input: record(string(), unknown()),
565986
567162
  _meta: record(string(), unknown()).optional()
565987
567163
  });
565988
567164
  const EmbeddedResourceSchema$1 = object$1({
565989
- type: literal("resource"),
567165
+ type: literal$1("resource"),
565990
567166
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
565991
567167
  annotations: AnnotationsSchema$1.optional(),
565992
567168
  _meta: record(string(), unknown()).optional()
565993
567169
  });
565994
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
567170
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
565995
567171
  const ContentBlockSchema$1 = union([
565996
567172
  TextContentSchema$1,
565997
567173
  ImageContentSchema$1,
@@ -566011,7 +567187,7 @@ function build() {
566011
567187
  openWorldHint: boolean().optional()
566012
567188
  });
566013
567189
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
566014
- method: literal("notifications/tools/list_changed"),
567190
+ method: literal$1("notifications/tools/list_changed"),
566015
567191
  params: NotificationsParamsSchema$1.optional()
566016
567192
  });
566017
567193
  const ModelHintSchema$1 = object$1({ name: string().optional() });
@@ -566027,13 +567203,13 @@ function build() {
566027
567203
  "none"
566028
567204
  ]).optional() });
566029
567205
  const BooleanSchemaSchema$1 = object$1({
566030
- type: literal("boolean"),
567206
+ type: literal$1("boolean"),
566031
567207
  title: string().optional(),
566032
567208
  description: string().optional(),
566033
567209
  default: boolean().optional()
566034
567210
  });
566035
567211
  const StringSchemaSchema$1 = object$1({
566036
- type: literal("string"),
567212
+ type: literal$1("string"),
566037
567213
  title: string().optional(),
566038
567214
  description: string().optional(),
566039
567215
  minLength: number$1().optional(),
@@ -566055,14 +567231,14 @@ function build() {
566055
567231
  default: number$1().optional()
566056
567232
  });
566057
567233
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
566058
- type: literal("string"),
567234
+ type: literal$1("string"),
566059
567235
  title: string().optional(),
566060
567236
  description: string().optional(),
566061
567237
  enum: array(string()),
566062
567238
  default: string().optional()
566063
567239
  });
566064
567240
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
566065
- type: literal("string"),
567241
+ type: literal$1("string"),
566066
567242
  title: string().optional(),
566067
567243
  description: string().optional(),
566068
567244
  oneOf: array(object$1({
@@ -566072,7 +567248,7 @@ function build() {
566072
567248
  default: string().optional()
566073
567249
  });
566074
567250
  const LegacyTitledEnumSchemaSchema$1 = object$1({
566075
- type: literal("string"),
567251
+ type: literal$1("string"),
566076
567252
  title: string().optional(),
566077
567253
  description: string().optional(),
566078
567254
  enum: array(string()),
@@ -566081,19 +567257,19 @@ function build() {
566081
567257
  });
566082
567258
  const SingleSelectEnumSchemaSchema$1 = union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);
566083
567259
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
566084
- type: literal("array"),
567260
+ type: literal$1("array"),
566085
567261
  title: string().optional(),
566086
567262
  description: string().optional(),
566087
567263
  minItems: number$1().optional(),
566088
567264
  maxItems: number$1().optional(),
566089
567265
  items: object$1({
566090
- type: literal("string"),
567266
+ type: literal$1("string"),
566091
567267
  enum: array(string())
566092
567268
  }),
566093
567269
  default: array(string()).optional()
566094
567270
  });
566095
567271
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
566096
- type: literal("array"),
567272
+ type: literal$1("array"),
566097
567273
  title: string().optional(),
566098
567274
  description: string().optional(),
566099
567275
  minItems: number$1().optional(),
@@ -566117,20 +567293,20 @@ function build() {
566117
567293
  NumberSchemaSchema$1
566118
567294
  ]);
566119
567295
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
566120
- mode: literal("form").optional(),
567296
+ mode: literal$1("form").optional(),
566121
567297
  message: string(),
566122
567298
  requestedSchema: object$1({
566123
- type: literal("object"),
567299
+ type: literal$1("object"),
566124
567300
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
566125
567301
  required: array(string()).optional()
566126
567302
  }).catchall(unknown())
566127
567303
  });
566128
567304
  const ResourceTemplateReferenceSchema$1 = object$1({
566129
- type: literal("ref/resource"),
567305
+ type: literal$1("ref/resource"),
566130
567306
  uri: string()
566131
567307
  });
566132
567308
  const PromptReferenceSchema$1 = object$1({
566133
- type: literal("ref/prompt"),
567309
+ type: literal$1("ref/prompt"),
566134
567310
  name: string()
566135
567311
  });
566136
567312
  const RootSchema$1 = object$1({
@@ -566181,7 +567357,7 @@ function build() {
566181
567357
  description: string().optional(),
566182
567358
  inputSchema: looseObject({
566183
567359
  $schema: string().optional(),
566184
- type: literal("object")
567360
+ type: literal$1("object")
566185
567361
  }),
566186
567362
  outputSchema: looseObject({ $schema: string().optional() }).optional(),
566187
567363
  annotations: ToolAnnotationsSchema$1.optional(),
@@ -566189,7 +567365,7 @@ function build() {
566189
567365
  });
566190
567366
  /** 2026-era ToolResultContent (anchor-exact: `structuredContent?: unknown`). */
566191
567367
  const ToolResultContentSchema$1 = object$1({
566192
- type: literal("tool_result"),
567368
+ type: literal$1("tool_result"),
566193
567369
  toolUseId: string(),
566194
567370
  content: array(ContentBlockSchema$1),
566195
567371
  structuredContent: unknown().optional(),
@@ -566302,7 +567478,7 @@ function build() {
566302
567478
  });
566303
567479
  /** 2026-era embedded sampling request (de-JSON-RPC'd). */
566304
567480
  const CreateMessageRequestSchema$1 = object$1({
566305
- method: literal("sampling/createMessage"),
567481
+ method: literal$1("sampling/createMessage"),
566306
567482
  params: CreateMessageRequestParamsSchema$1
566307
567483
  });
566308
567484
  /**
@@ -566311,7 +567487,7 @@ function build() {
566311
567487
  * the anchor declares a bare optional `_meta` on `params`.
566312
567488
  */
566313
567489
  const ListRootsRequestSchema$1 = object$1({
566314
- method: literal("roots/list"),
567490
+ method: literal$1("roots/list"),
566315
567491
  params: object$1({ _meta: record(string(), unknown()).optional() }).optional()
566316
567492
  });
566317
567493
  /** 2026-era embedded sampling response (anchor-exact: extends the forked SamplingMessage). */
@@ -566343,7 +567519,7 @@ function build() {
566343
567519
  * frozen 2025-11-25 revision.
566344
567520
  */
566345
567521
  const ElicitRequestURLParamsSchema$1 = object$1({
566346
- mode: literal("url"),
567522
+ mode: literal$1("url"),
566347
567523
  message: string(),
566348
567524
  url: string().url()
566349
567525
  });
@@ -566351,7 +567527,7 @@ function build() {
566351
567527
  const ElicitRequestParamsSchema$1 = union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);
566352
567528
  /** 2026-era embedded elicitation request (de-JSON-RPC'd; see the URL-mode fork above). */
566353
567529
  const ElicitRequestSchema$1 = object$1({
566354
- method: literal("elicitation/create"),
567530
+ method: literal$1("elicitation/create"),
566355
567531
  params: ElicitRequestParamsSchema$1
566356
567532
  });
566357
567533
  /** A single embedded input request (one of the three demoted server→client requests). */
@@ -566393,7 +567569,7 @@ function build() {
566393
567569
  const DispatchRequestMetaSchema = looseObject({ progressToken: ProgressTokenSchema$1.optional() });
566394
567570
  function wireRequest(method, paramsShape) {
566395
567571
  return object$1({
566396
- method: literal(method),
567572
+ method: literal$1(method),
566397
567573
  params: object$1({
566398
567574
  _meta: RequestMetaEnvelopeSchema,
566399
567575
  ...paramsShape
@@ -566402,7 +567578,7 @@ function build() {
566402
567578
  }
566403
567579
  function dispatchRequest(method, paramsShape) {
566404
567580
  return object$1({
566405
- method: literal(method),
567581
+ method: literal$1(method),
566406
567582
  params: object$1({
566407
567583
  _meta: DispatchRequestMetaSchema.optional(),
566408
567584
  ...paramsShape
@@ -566550,7 +567726,7 @@ function build() {
566550
567726
  const NotificationMetaSchema = looseObject({ "io.modelcontextprotocol/subscriptionId": RequestIdSchema$1.optional() });
566551
567727
  /** Anchor SubscriptionsAcknowledgedNotification (2026-only). */
566552
567728
  const SubscriptionsAcknowledgedNotificationSchema$1 = object$1({
566553
- method: literal("notifications/subscriptions/acknowledged"),
567729
+ method: literal$1("notifications/subscriptions/acknowledged"),
566554
567730
  params: object$1({
566555
567731
  _meta: NotificationMetaSchema.optional(),
566556
567732
  notifications: SubscriptionFilterSchema$1
@@ -566570,7 +567746,7 @@ function build() {
566570
567746
  });
566571
567747
  /** 2026-era `notifications/cancelled` (see the params fork above). */
566572
567748
  const CancelledNotificationSchema$1 = object$1({
566573
- method: literal("notifications/cancelled"),
567749
+ method: literal$1("notifications/cancelled"),
566574
567750
  params: CancelledNotificationParamsSchema$1
566575
567751
  });
566576
567752
  const notificationSchemas2026 = {
@@ -566584,7 +567760,7 @@ function build() {
566584
567760
  "notifications/subscriptions/acknowledged": SubscriptionsAcknowledgedNotificationSchema$1
566585
567761
  };
566586
567762
  const wireResultResponse = (result) => object$1({
566587
- jsonrpc: literal("2.0"),
567763
+ jsonrpc: literal$1("2.0"),
566588
567764
  id: union([string(), number$1().int()]),
566589
567765
  result
566590
567766
  }).strict();
@@ -567163,15 +568339,15 @@ function inputSchemaMaps() {
567163
568339
  maps = {
567164
568340
  request: {
567165
568341
  "elicitation/create": object$1({
567166
- method: literal("elicitation/create"),
568342
+ method: literal$1("elicitation/create"),
567167
568343
  params: s.ElicitRequestParamsSchema
567168
568344
  }),
567169
568345
  "sampling/createMessage": object$1({
567170
- method: literal("sampling/createMessage"),
568346
+ method: literal$1("sampling/createMessage"),
567171
568347
  params: s.CreateMessageRequestParamsSchema
567172
568348
  }),
567173
568349
  "roots/list": object$1({
567174
- method: literal("roots/list"),
568350
+ method: literal$1("roots/list"),
567175
568351
  params: looseObject({}).optional()
567176
568352
  })
567177
568353
  },
@@ -592359,8 +593535,89 @@ function registerWidgetCommand(program) {
592359
593535
 
592360
593536
  //#endregion
592361
593537
  //#region src/commands/work.ts
593538
+ const requireOperationId = (options) => {
593539
+ const operationId = options.operation ?? process.env.LOBEHUB_OPERATION_ID;
593540
+ if (!operationId) throw new Error("lh work registers Works of a running agent: pass --operation or run it inside an agent run (LOBEHUB_OPERATION_ID)");
593541
+ return operationId;
593542
+ };
593543
+ /**
593544
+ * Upload a produced file as the run's own output. The `tool-result` source
593545
+ * keeps it out of the resource library, and is the source an operation token
593546
+ * may write.
593547
+ */
593548
+ const uploadWorkFile = async (client, filePath) => {
593549
+ const absolutePath = path.resolve(filePath);
593550
+ return {
593551
+ absolutePath,
593552
+ fileId: (await uploadLocalFile(client, absolutePath, { source: "tool-result" })).id
593553
+ };
593554
+ };
593555
+ const printWork = (work, options, verb) => {
593556
+ if (options.json) outputJson(work);
593557
+ else console.log(`${verb} Work ${work.id}: ${work.title}`);
593558
+ };
592362
593559
  function registerWorkCommand(program) {
592363
- program.command("work").description("Look up agent work").command("lookup").argument("<github-pr-url>", "GitHub pull request URL").description("Find all conversations linked to a GitHub pull request in the current workspace").option("--json", "Output JSON").action(async (url, options) => {
593560
+ const work = program.command("work").description("Register the files and links this agent produced as Works, or look them up");
593561
+ work.command("create").description([
593562
+ "Register a file or link this agent produced as a Work card under its reply.",
593563
+ "Pass exactly one of --file or --url. Creating the same file path or link again in",
593564
+ "this conversation adds a new version. GitHub and Linear links are registered",
593565
+ "automatically when you create or edit them; do not pass them here."
593566
+ ].join("\n")).option("--file <path>", "Local file to upload and register").option("--url <url>", "http(s) link to register; requires --title").option("--title <title>", "Card title (defaults to the file name for --file)").option("--description <text>", "Card description").option("--operation <id>", "Defaults to LOBEHUB_OPERATION_ID").option("--json", "Output JSON").action(async (options) => {
593567
+ if (Boolean(options.file) === Boolean(options.url)) throw new Error("Pass exactly one of --file or --url");
593568
+ if (options.url && !options.title) throw new Error("--title is required with --url");
593569
+ const operationId = requireOperationId(options);
593570
+ const client = await getTrpcClient();
593571
+ const text = {
593572
+ description: options.description,
593573
+ operationId,
593574
+ title: options.title
593575
+ };
593576
+ let created;
593577
+ if (options.url) created = await client.work.createAgentWork.mutate({
593578
+ ...text,
593579
+ title: options.title,
593580
+ type: "link",
593581
+ url: options.url
593582
+ });
593583
+ else {
593584
+ const { absolutePath, fileId } = await uploadWorkFile(client, options.file);
593585
+ created = await client.work.createAgentWork.mutate({
593586
+ ...text,
593587
+ fileId,
593588
+ filePath: absolutePath,
593589
+ type: "file"
593590
+ });
593591
+ }
593592
+ printWork(created, options, "Created");
593593
+ });
593594
+ work.command("update").argument("<work-id>", "Id of a Work this agent created with lh work create").description([
593595
+ "Add a version to a Work this agent created. Options left out keep their values.",
593596
+ "A link Work keeps its URL; register a new link with lh work create --url.",
593597
+ "Works registered automatically (GitHub, Linear, scanned files) cannot be updated."
593598
+ ].join("\n")).option("--file <path>", "New content for a file Work").option("--title <title>", "New card title").option("--description <text>", "New card description").option("--operation <id>", "Defaults to LOBEHUB_OPERATION_ID").option("--json", "Output JSON").action(async (workId, options) => {
593599
+ if (!options.file && !options.title && options.description === void 0) throw new Error("Pass at least one of --file, --title or --description");
593600
+ const operationId = requireOperationId(options);
593601
+ const client = await getTrpcClient();
593602
+ const fileId = options.file ? (await uploadWorkFile(client, options.file)).fileId : void 0;
593603
+ printWork(await client.work.updateAgentWork.mutate({
593604
+ description: options.description,
593605
+ fileId,
593606
+ operationId,
593607
+ title: options.title,
593608
+ workId
593609
+ }), options, "Updated");
593610
+ });
593611
+ work.command("delete").argument("<work-id>", "Id of a Work this agent created with lh work create").description(["Delete a Work this agent created by mistake: its card and versions are removed,", "uploaded files stay. Works registered automatically cannot be deleted."].join("\n")).option("--operation <id>", "Defaults to LOBEHUB_OPERATION_ID").option("--json", "Output JSON").action(async (workId, options) => {
593612
+ const operationId = requireOperationId(options);
593613
+ const deleted = await (await getTrpcClient()).work.deleteAgentWork.mutate({
593614
+ operationId,
593615
+ workId
593616
+ });
593617
+ if (options.json) outputJson(deleted);
593618
+ else console.log(`Deleted Work ${deleted.id}${deleted.title ? `: ${deleted.title}` : ""}`);
593619
+ });
593620
+ work.command("lookup").argument("<github-pr-url>", "GitHub pull request URL").description("Find all conversations linked to a GitHub pull request in the current workspace").option("--json", "Output JSON").action(async (url, options) => {
592364
593621
  const client = await getTrpcClient();
592365
593622
  const { data } = await client.work.lookupPullRequest.query({ url });
592366
593623
  if (data.length === 0) {
@@ -592854,7 +594111,9 @@ function createProgram() {
592854
594111
  registerAgentCommand(program);
592855
594112
  registerAgentGroupCommand(program);
592856
594113
  registerAgentSignalCommand(program);
594114
+ registerAppCommand(program);
592857
594115
  registerBotCommand(program);
594116
+ registerArtboardCommand(program);
592858
594117
  registerChannelCommand(program);
592859
594118
  registerGenerateCommand(program);
592860
594119
  registerGoalCommand$1(program);