@lobehub/cli 0.0.150 → 0.0.152

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
@@ -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,7 +7788,7 @@ var init_pluginConfig = __esmMin((() => {
7788
7788
  "disabled"
7789
7789
  ]);
7790
7790
  AgentPluginEntrySchema = union([string(), object$1({
7791
- builtinOverride: literal(true).optional(),
7791
+ builtinOverride: literal$1(true).optional(),
7792
7792
  identifier: string(),
7793
7793
  mode: AgentPluginModeSchema.optional()
7794
7794
  })]);
@@ -8154,8 +8154,8 @@ var init_agentHook = __esmMin((() => {
8154
8154
  var toolCallHookDecisionSchema;
8155
8155
  var init_agentHookResponse = __esmMin((() => {
8156
8156
  init_zod$1();
8157
- toolCallHookDecisionSchema = discriminatedUnion("decision", [object$1({ decision: literal("allow") }), object$1({
8158
- decision: literal("deny"),
8157
+ toolCallHookDecisionSchema = discriminatedUnion("decision", [object$1({ decision: literal$1("allow") }), object$1({
8158
+ decision: literal$1("deny"),
8159
8159
  reason: string().optional()
8160
8160
  })]);
8161
8161
  }));
@@ -8239,9 +8239,9 @@ var init_base$1 = __esmMin((() => {
8239
8239
  ]).optional(),
8240
8240
  summary: array(object$1({
8241
8241
  text: string(),
8242
- type: literal("summary_text")
8242
+ type: literal$1("summary_text")
8243
8243
  })),
8244
- type: literal("reasoning")
8244
+ type: literal$1("reasoning")
8245
8245
  }).passthrough();
8246
8246
  ModelReasoningSchema = object$1({
8247
8247
  content: string().optional(),
@@ -8370,7 +8370,7 @@ var init_contextAccounting = __esmMin((() => {
8370
8370
  toolCalls: 0,
8371
8371
  toolDefinition: 0
8372
8372
  }),
8373
- estimator: literal("tokenx").catch("tokenx"),
8373
+ estimator: literal$1("tokenx").catch("tokenx"),
8374
8374
  messageCount: tokens,
8375
8375
  system: tokens,
8376
8376
  total: tokens
@@ -8407,7 +8407,7 @@ var init_contextSelection = __esmMin((() => {
8407
8407
  startOffset: number$1()
8408
8408
  }).optional(),
8409
8409
  pageId: string(),
8410
- source: literal("page"),
8410
+ source: literal$1("page"),
8411
8411
  xml: string().optional()
8412
8412
  });
8413
8413
  CodeContextSelectionSchema = ContextSelectionBaseSchema.extend({
@@ -8418,10 +8418,10 @@ var init_contextSelection = __esmMin((() => {
8418
8418
  "context",
8419
8419
  "deletions"
8420
8420
  ]).optional(),
8421
- source: literal("code"),
8421
+ source: literal$1("code"),
8422
8422
  workingDirectory: string().optional()
8423
8423
  });
8424
- TextContextSelectionSchema = ContextSelectionBaseSchema.extend({ source: literal("text") });
8424
+ TextContextSelectionSchema = ContextSelectionBaseSchema.extend({ source: literal$1("text") });
8425
8425
  ElementContextSelectionSchema = ContextSelectionBaseSchema.extend({
8426
8426
  element: object$1({
8427
8427
  pageTitle: string().optional(),
@@ -8431,11 +8431,11 @@ var init_contextSelection = __esmMin((() => {
8431
8431
  thumbnailUrl: string().optional(),
8432
8432
  url: string().optional()
8433
8433
  }),
8434
- source: literal("element")
8434
+ source: literal$1("element")
8435
8435
  });
8436
8436
  McpAppContextSelectionSchema = ContextSelectionBaseSchema.extend({
8437
8437
  identifier: string(),
8438
- source: literal("mcpApp")
8438
+ source: literal$1("mcpApp")
8439
8439
  });
8440
8440
  ContextSelectionSchema = discriminatedUnion("source", [
8441
8441
  PageContextSelectionSchema,
@@ -8487,17 +8487,17 @@ var init_metadata = __esmMin((() => {
8487
8487
  taskId: string().optional(),
8488
8488
  taskIdentifier: string().optional()
8489
8489
  })),
8490
- type: literal("task")
8490
+ type: literal$1("task")
8491
8491
  }),
8492
8492
  object$1({
8493
8493
  args: record(string(), unknown()).optional(),
8494
8494
  data: unknown(),
8495
8495
  provider: string(),
8496
8496
  toolName: string(),
8497
- type: literal("skill")
8497
+ type: literal$1("skill")
8498
8498
  }),
8499
8499
  object$1({
8500
- action: literal("register"),
8500
+ action: literal$1("register"),
8501
8501
  document: object$1({
8502
8502
  agentDocumentId: string().nullish(),
8503
8503
  agentId: string().nullish(),
@@ -8506,19 +8506,19 @@ var init_metadata = __esmMin((() => {
8506
8506
  changeType: _enum(["created", "updated"]),
8507
8507
  toolName: string()
8508
8508
  }),
8509
- type: literal("document")
8509
+ type: literal$1("document")
8510
8510
  }),
8511
8511
  object$1({
8512
- action: literal("delete"),
8512
+ action: literal$1("delete"),
8513
8513
  document: object$1({
8514
8514
  agentDocumentId: string().nullish(),
8515
8515
  agentId: string().nullish(),
8516
8516
  documentId: string()
8517
8517
  }),
8518
- type: literal("document")
8518
+ type: literal$1("document")
8519
8519
  }),
8520
8520
  object$1({
8521
- action: literal("register"),
8521
+ action: literal$1("register"),
8522
8522
  canvas: object$1({
8523
8523
  canvasId: string(),
8524
8524
  description: string().nullish(),
@@ -8532,7 +8532,7 @@ var init_metadata = __esmMin((() => {
8532
8532
  totalSize: number$1()
8533
8533
  })
8534
8534
  }),
8535
- type: literal("canvas")
8535
+ type: literal$1("canvas")
8536
8536
  })
8537
8537
  ]);
8538
8538
  LocalSystemToolSnapshotSchema = object$1({
@@ -8546,7 +8546,7 @@ var init_metadata = __esmMin((() => {
8546
8546
  capturedAt: string(),
8547
8547
  content: string().nullable(),
8548
8548
  error: unknown().optional(),
8549
- identifier: literal("lobe-local-system"),
8549
+ identifier: literal$1("lobe-local-system"),
8550
8550
  result: unknown().optional(),
8551
8551
  snapshotId: string(),
8552
8552
  state: unknown().optional(),
@@ -8625,7 +8625,7 @@ var init_metadata = __esmMin((() => {
8625
8625
  });
8626
8626
  AgentDispatchMetadataSchema = object$1({
8627
8627
  kind: _enum(["callAgent"]),
8628
- visibility: literal("internal")
8628
+ visibility: literal$1("internal")
8629
8629
  });
8630
8630
  AgentSenderMetadataSchema = object$1({
8631
8631
  agentId: string(),
@@ -8887,6 +8887,22 @@ var init_params$1 = __esmMin((() => {
8887
8887
  });
8888
8888
  }));
8889
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
+
8890
8906
  //#endregion
8891
8907
  //#region ../../packages/types/src/tool/intervention.ts
8892
8908
  var HumanInterventionPolicySchema, ArgumentMatcherSchema, HumanInterventionRuleSchema, HumanInterventionConfigSchema, HumanInterventionResponseSchema, UserInterventionConfigSchema, SecurityBlacklistRuleSchema, SecurityBlacklistConfigSchema, ShouldInterveneParamsSchema;
@@ -8952,11 +8968,13 @@ var init_builtinIntervention = __esmMin((() => {}));
8952
8968
 
8953
8969
  //#endregion
8954
8970
  //#region ../../packages/types/src/tool/builtin.ts
8955
- var MetaSchema, RenderDisplayControlSchema, DynamicInterventionConfigSchema, ExtendedHumanInterventionConfigSchema, PluginApiWorkConfigSchema, LobeChatPluginApiSchema, BuiltinToolManifestSchema, LobeBuiltinToolSchema;
8971
+ var MetaSchema, RenderDisplayControlSchema, DynamicInterventionConfigSchema, ExtendedHumanInterventionConfigSchema, LobeChatPluginApiSchema, BuiltinToolManifestSchema, LobeBuiltinToolSchema;
8956
8972
  var init_builtin = __esmMin((() => {
8957
8973
  init_zod$1();
8974
+ init_builtinWork();
8958
8975
  init_intervention();
8959
8976
  init_builtinIntervention();
8977
+ init_builtinWork();
8960
8978
  MetaSchema = object$1({
8961
8979
  avatar: string().optional(),
8962
8980
  description: string().optional(),
@@ -8975,14 +8993,6 @@ var init_builtin = __esmMin((() => {
8975
8993
  type: string()
8976
8994
  });
8977
8995
  ExtendedHumanInterventionConfigSchema = union([HumanInterventionConfigSchema, object$1({ dynamic: DynamicInterventionConfigSchema })]);
8978
- PluginApiWorkConfigSchema = object$1({
8979
- action: _enum([
8980
- "create",
8981
- "update",
8982
- "delete"
8983
- ]),
8984
- resourceType: _enum(["document", "task"])
8985
- });
8986
8996
  LobeChatPluginApiSchema = object$1({
8987
8997
  defaultTimeoutMs: number$1().int().positive().optional(),
8988
8998
  description: string(),
@@ -9003,14 +9013,14 @@ var init_builtin = __esmMin((() => {
9003
9013
  identifier: string(),
9004
9014
  meta: MetaSchema,
9005
9015
  systemRole: string(),
9006
- type: literal("builtin").optional()
9016
+ type: literal$1("builtin").optional()
9007
9017
  });
9008
9018
  LobeBuiltinToolSchema = object$1({
9009
9019
  discoverable: boolean().optional(),
9010
9020
  hidden: boolean().optional(),
9011
9021
  identifier: string(),
9012
9022
  manifest: BuiltinToolManifestSchema,
9013
- type: literal("builtin")
9023
+ type: literal$1("builtin")
9014
9024
  });
9015
9025
  }));
9016
9026
 
@@ -9031,7 +9041,7 @@ var init_manifest = __esmMin((() => {
9031
9041
  ToolManifestSettingsSchema = object$1({
9032
9042
  properties: record(string(), any()),
9033
9043
  required: array(string()).optional(),
9034
- type: literal("object")
9044
+ type: literal$1("object")
9035
9045
  });
9036
9046
  ToolManifestSchema = object$1({
9037
9047
  $schema: string().optional(),
@@ -9097,7 +9107,7 @@ var init_tool$2 = __esmMin((() => {
9097
9107
  additionalProperties: boolean().optional(),
9098
9108
  properties: record(string(), any()),
9099
9109
  required: array(string()).optional(),
9100
- type: literal("object")
9110
+ type: literal$1("object")
9101
9111
  })
9102
9112
  });
9103
9113
  }));
@@ -9130,7 +9140,7 @@ var init_understanding = __esmMin((() => {
9130
9140
  MAX_UNDERSTANDING_FEEDBACK_LENGTH = 2e3;
9131
9141
  MAX_UNDERSTANDING_FEEDBACK_TURNS = 16;
9132
9142
  MAX_PERSONA_CONTENT_LENGTH = 12e3;
9133
- OnboardingUnderstandingThreadMarkerSchema = object$1({ kind: literal("writing") }).strict();
9143
+ OnboardingUnderstandingThreadMarkerSchema = object$1({ kind: literal$1("writing") }).strict();
9134
9144
  CollectionErrorSchema = object$1({
9135
9145
  code: string().max(64),
9136
9146
  message: string(),
@@ -9192,7 +9202,7 @@ var init_understanding = __esmMin((() => {
9192
9202
  diagnostics: CollectionDiagnosticsSchema,
9193
9203
  feedbackRevision: number$1().int().nonnegative().max(MAX_COLLECTION_COUNT).default(0),
9194
9204
  generationRevision: number$1().int().nonnegative().max(MAX_COLLECTION_COUNT).default(0),
9195
- kind: literal("proposal"),
9205
+ kind: literal$1("proposal"),
9196
9206
  providers: array(string().max(64)),
9197
9207
  resultId: string(),
9198
9208
  sourceFingerprint: string()
@@ -9222,16 +9232,16 @@ var init_understanding = __esmMin((() => {
9222
9232
  understandingWritingStateBaseShape = {
9223
9233
  detailed: discriminatedUnion("status", [
9224
9234
  object$1({
9225
- status: literal("running"),
9235
+ status: literal$1("running"),
9226
9236
  updatedAt: string()
9227
9237
  }).strict(),
9228
9238
  object$1({
9229
- status: literal("completed"),
9239
+ status: literal$1("completed"),
9230
9240
  updatedAt: string()
9231
9241
  }).strict(),
9232
9242
  object$1({
9233
9243
  error: CollectionErrorSchema,
9234
- status: literal("failed"),
9244
+ status: literal$1("failed"),
9235
9245
  updatedAt: string()
9236
9246
  }).strict()
9237
9247
  ]).optional(),
@@ -9244,18 +9254,18 @@ var init_understanding = __esmMin((() => {
9244
9254
  object$1({
9245
9255
  ...understandingWritingStateBaseShape,
9246
9256
  resultMessageId: string().optional(),
9247
- status: literal("running")
9257
+ status: literal$1("running")
9248
9258
  }).strict(),
9249
9259
  object$1({
9250
9260
  ...understandingWritingStateBaseShape,
9251
9261
  resultMessageId: string(),
9252
- status: literal("completed")
9262
+ status: literal$1("completed")
9253
9263
  }).strict(),
9254
9264
  object$1({
9255
9265
  ...understandingWritingStateBaseShape,
9256
9266
  error: CollectionErrorSchema,
9257
9267
  resultMessageId: string().optional(),
9258
- status: literal("failed")
9268
+ status: literal$1("failed")
9259
9269
  }).strict()
9260
9270
  ]);
9261
9271
  OnboardingUnderstandingSessionSchema = object$1({
@@ -9404,7 +9414,7 @@ var init_aiChat = __esmMin((() => {
9404
9414
  additionalProperties: boolean().optional(),
9405
9415
  properties: record(string(), any()),
9406
9416
  required: array(string()).optional(),
9407
- type: literal("object")
9417
+ type: literal$1("object")
9408
9418
  }),
9409
9419
  strict: boolean().optional()
9410
9420
  });
@@ -9420,7 +9430,7 @@ var init_aiChat = __esmMin((() => {
9420
9430
  schema: StructureSchema.optional(),
9421
9431
  tools: array(object$1({
9422
9432
  function: LobeUniformToolSchema,
9423
- type: literal("function")
9433
+ type: literal$1("function")
9424
9434
  })).optional(),
9425
9435
  /**
9426
9436
  * Structured tracing config (scenario / promptVersion / schemaName /
@@ -9447,17 +9457,17 @@ var init_aiChat = __esmMin((() => {
9447
9457
  true: DecisionContentSchema
9448
9458
  }).optional(),
9449
9459
  instructions: DecisionContentSchema,
9450
- type: literal("boolean")
9460
+ type: literal$1("boolean")
9451
9461
  }),
9452
9462
  object$1({
9453
9463
  criteria: record(string(), DecisionContentSchema.nullable()),
9454
9464
  instructions: DecisionContentSchema,
9455
- type: literal("choice")
9465
+ type: literal$1("choice")
9456
9466
  }),
9457
9467
  object$1({
9458
9468
  criteria: array(DecisionContentSchema).min(1),
9459
9469
  instructions: DecisionContentSchema,
9460
- type: literal("score")
9470
+ type: literal$1("score")
9461
9471
  })
9462
9472
  ]);
9463
9473
  DecisionOutputSchema = object$1({
@@ -10110,9 +10120,9 @@ var init_followUpAction = __esmMin((() => {
10110
10120
  init_zod$1();
10111
10121
  init_agentOnboarding();
10112
10122
  FollowUpHintSchema = union([object$1({
10113
- kind: literal("onboarding"),
10123
+ kind: literal$1("onboarding"),
10114
10124
  phase: OnboardingPhaseSchema
10115
- }), object$1({ kind: literal("chat") })]);
10125
+ }), object$1({ kind: literal$1("chat") })]);
10116
10126
  FollowUpModelConfigSchema = object$1({
10117
10127
  model: string().min(1),
10118
10128
  provider: string().min(1)
@@ -10240,7 +10250,7 @@ var init_heteroSessionImport = __esmMin((() => {
10240
10250
  arguments: string(),
10241
10251
  id: string(),
10242
10252
  identifier: string(),
10243
- type: literal("default")
10253
+ type: literal$1("default")
10244
10254
  });
10245
10255
  heteroSessionImportMessageSchema = object$1({
10246
10256
  clientId: string(),
@@ -11068,7 +11078,7 @@ var init_topic$1 = __esmMin((() => {
11068
11078
  resumeAfterRateLimitRunSchema = topicScheduledRunBaseSchema.extend({
11069
11079
  /** The failed assistant turn that hit the rate limit (regenerated in place). */
11070
11080
  failedAssistantMessageId: string(),
11071
- kind: literal("resume_after_rate_limit"),
11081
+ kind: literal$1("resume_after_rate_limit"),
11072
11082
  /** Diagnostics only — `runAt` is derived from `resetsAt` at write time. */
11073
11083
  rateLimit: object$1({
11074
11084
  rateLimitType: string().optional(),
@@ -11079,12 +11089,12 @@ var init_topic$1 = __esmMin((() => {
11079
11089
  sessionId: string().optional(),
11080
11090
  workingDirectory: string().optional()
11081
11091
  }).optional(),
11082
- source: literal("heterogeneous_agent"),
11092
+ source: literal$1("heterogeneous_agent"),
11083
11093
  /** The user message whose turn is being continued. */
11084
11094
  userMessageId: string()
11085
11095
  });
11086
11096
  delayedStartRunSchema = topicScheduledRunBaseSchema.extend({
11087
- kind: literal("delayed_start"),
11097
+ kind: literal$1("delayed_start"),
11088
11098
  /** Model override captured at schedule time (the agent default is used if absent). */
11089
11099
  model: string().optional(),
11090
11100
  /** Provider override captured at schedule time. */
@@ -11109,7 +11119,7 @@ var init_topic$1 = __esmMin((() => {
11109
11119
  });
11110
11120
  worktreeStartRunSchema = topicScheduledRunBaseSchema.extend({
11111
11121
  error: string().optional(),
11112
- kind: literal("worktree_start"),
11122
+ kind: literal$1("worktree_start"),
11113
11123
  operationId: string(),
11114
11124
  retryable: boolean().optional(),
11115
11125
  userMessageId: string(),
@@ -11129,12 +11139,12 @@ var init_topic$1 = __esmMin((() => {
11129
11139
  rateLimitType: string().optional(),
11130
11140
  resetsAt: number$1().optional()
11131
11141
  }).optional(),
11132
- reason: literal("rate_limit"),
11142
+ reason: literal$1("rate_limit"),
11133
11143
  resume: object$1({
11134
11144
  sessionId: string().optional(),
11135
11145
  workingDirectory: string().optional()
11136
11146
  }).optional(),
11137
- source: literal("heterogeneous_agent"),
11147
+ source: literal$1("heterogeneous_agent"),
11138
11148
  updatedAt: string(),
11139
11149
  userMessageId: string()
11140
11150
  });
@@ -11815,23 +11825,23 @@ var init_tools = __esmMin((() => {
11815
11825
  ]);
11816
11826
  searchMemoryDayIntentSchema = object$1({
11817
11827
  date: date$1(),
11818
- selector: literal("day")
11828
+ selector: literal$1("day")
11819
11829
  });
11820
11830
  searchMemoryMonthIntentSchema = object$1({
11821
11831
  month: number$1().int().min(1).max(12),
11822
- selector: literal("month"),
11832
+ selector: literal$1("month"),
11823
11833
  year: number$1().int().min(1970).max(9999)
11824
11834
  });
11825
11835
  searchMemoryRangeIntentSchema = object$1({
11826
11836
  end: date$1().optional(),
11827
- selector: literal("range"),
11837
+ selector: literal$1("range"),
11828
11838
  start: date$1().optional()
11829
11839
  }).refine((value) => Boolean(value.start || value.end), {
11830
11840
  message: "range selector requires start or end",
11831
11841
  path: ["start"]
11832
11842
  });
11833
11843
  searchMemoryYearIntentSchema = object$1({
11834
- selector: literal("year"),
11844
+ selector: literal$1("year"),
11835
11845
  year: number$1().int().min(1970).max(9999)
11836
11846
  });
11837
11847
  searchMemoryLegacyRelativeDayAnchorSchema = _enum(["today", "yesterday"]);
@@ -11842,7 +11852,7 @@ var init_tools = __esmMin((() => {
11842
11852
  object$1({
11843
11853
  anchor: union([searchMemoryLegacyRelativeDayAnchorSchema, searchMemoryTimeIntentSchema]),
11844
11854
  offsetDays: number$1().int(),
11845
- selector: literal("relativeDay")
11855
+ selector: literal$1("relativeDay")
11846
11856
  }),
11847
11857
  searchMemoryRangeIntentSchema,
11848
11858
  searchMemoryYearIntentSchema
@@ -12064,7 +12074,7 @@ var init_acceptanceReview = __esmMin((() => {
12064
12074
  })).max(8),
12065
12075
  title: string().max(300).optional(),
12066
12076
  url: string().url().max(2e3),
12067
- v: literal(1),
12077
+ v: literal$1(1),
12068
12078
  viewport: object$1({
12069
12079
  dpr: number$1().positive(),
12070
12080
  height: number$1().finite(),
@@ -12178,7 +12188,251 @@ var init_acceptanceReviewRound = __esmMin((() => {
12178
12188
 
12179
12189
  //#endregion
12180
12190
  //#region ../../packages/types/src/artboard.ts
12181
- 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((() => {}));
12182
12436
 
12183
12437
  //#endregion
12184
12438
  //#region ../../packages/types/src/connector.ts
@@ -12219,7 +12473,7 @@ var init_inboundWebhook = __esmMin((() => {
12219
12473
  remoteSubscriptionId: string().optional(),
12220
12474
  truncated: boolean().optional()
12221
12475
  }).strict();
12222
- McpEventsWebhookVerificationSchema = object$1({ scheme: literal("standard_webhooks") }).strict();
12476
+ McpEventsWebhookVerificationSchema = object$1({ scheme: literal$1("standard_webhooks") }).strict();
12223
12477
  GenericWebhookConfigSchema = object$1({
12224
12478
  autoApprove: boolean(),
12225
12479
  delivery: InboundWebhookChannelDeliverySchema.optional(),
@@ -12228,14 +12482,14 @@ var init_inboundWebhook = __esmMin((() => {
12228
12482
  topicId: string().min(1).optional()
12229
12483
  }).strict();
12230
12484
  GenericWebhookStateSchema = object$1({}).strict();
12231
- GenericWebhookVerificationSchema = object$1({ scheme: literal("bearer_token") }).strict();
12485
+ GenericWebhookVerificationSchema = object$1({ scheme: literal$1("bearer_token") }).strict();
12232
12486
  InboundWebhookDataSchema = discriminatedUnion("kind", [object$1({
12233
- kind: literal("mcp_events"),
12487
+ kind: literal$1("mcp_events"),
12234
12488
  config: McpEventsWebhookConfigSchema,
12235
12489
  state: McpEventsWebhookStateSchema,
12236
12490
  verification: McpEventsWebhookVerificationSchema
12237
12491
  }), object$1({
12238
- kind: literal("generic"),
12492
+ kind: literal$1("generic"),
12239
12493
  config: GenericWebhookConfigSchema,
12240
12494
  state: GenericWebhookStateSchema,
12241
12495
  verification: GenericWebhookVerificationSchema
@@ -12392,6 +12646,9 @@ var init_src$2 = __esmMin((() => {
12392
12646
  init_acceptanceReviewRound();
12393
12647
  init_agentRuntime();
12394
12648
  init_artboard();
12649
+ init_artboardFiles();
12650
+ init_artboardPublish();
12651
+ init_artboardReadiness();
12395
12652
  init_connector();
12396
12653
  init_connectorToolIdentifier();
12397
12654
  init_heteroPermissionMode();
@@ -18233,6 +18490,7 @@ const TRPC_NAMESPACE_API_KEY_RULES = {
18233
18490
  apiKey: "blocked",
18234
18491
  asr: { any: "model:invoke" },
18235
18492
  auth: "open",
18493
+ artboard: "blocked",
18236
18494
  artifactShare: rw("chat:read", null),
18237
18495
  botMessage: "blocked",
18238
18496
  brief: rw("chat:read", "chat:write"),
@@ -37582,6 +37840,7 @@ const uploadFileBuffer = async (client, { buffer, fileName, fileType }, options
37582
37840
  name: fileName,
37583
37841
  parentId: options.parentId,
37584
37842
  size: buffer.length,
37843
+ source: options.source,
37585
37844
  url: pathname
37586
37845
  });
37587
37846
  } catch (error) {
@@ -46450,8 +46709,8 @@ const AGENT_GRAPH_ROOT_NODE_ID = "__root__";
46450
46709
  const AgentGraphNodeSchema = discriminatedUnion("type", [object$1({
46451
46710
  allowedToolApiNames: array(string().min(1)).optional(),
46452
46711
  maxAgentSteps: number$1().int().positive().optional(),
46453
- type: literal("agent")
46454
- }), object$1({ type: literal("llm") })]);
46712
+ type: literal$1("agent")
46713
+ }), object$1({ type: literal$1("llm") })]);
46455
46714
  const AgentGraphFieldSchema = object$1({
46456
46715
  desc: string().min(1),
46457
46716
  schema: record(string(), unknown())
@@ -50780,6 +51039,539 @@ function registerAgentSignalCommand(program) {
50780
51039
  });
50781
51040
  }
50782
51041
 
51042
+ //#endregion
51043
+ //#region src/commands/artboardComments.ts
51044
+ const runAgentId = () => {
51045
+ const id = process.env.LOBEHUB_AGENT_ID?.trim();
51046
+ 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");
51047
+ return id;
51048
+ };
51049
+ const placeOf = (thread, content) => {
51050
+ const board = content.boards.find((item) => item.id === thread.boardId);
51051
+ if (board) return `board ${board.id} "${board.title}"`;
51052
+ const group = content.groups.find((item) => item.id === thread.groupId);
51053
+ if (group) return `group ${group.id} "${group.title}"`;
51054
+ const page = content.pages.find((item) => item.id === thread.pageId);
51055
+ return page ? `page ${page.id} "${page.name}"` : "the canvas";
51056
+ };
51057
+ const speaker = (comment) => comment.authorAgentId ? "you" : "user";
51058
+ const formatThread = (thread, content) => {
51059
+ const tags = [
51060
+ thread.unread && "new",
51061
+ thread.resolvedAt && "resolved",
51062
+ thread.stale && "screen changed since"
51063
+ ].filter(Boolean);
51064
+ return [`${thread.id} on ${placeOf(thread, content)}${tags.length ? ` [${tags.join(", ")}]` : ""}`, ...[thread, ...thread.replies].map((comment) => ` ${speaker(comment)}: ${comment.content}`)].join("\n");
51065
+ };
51066
+ const textOf = (words) => {
51067
+ const text = words.join(" ").trim();
51068
+ if (!text) throw new Error("Write the text after the id");
51069
+ return text;
51070
+ };
51071
+ const registerArtboardCommentCommands = (artboard) => {
51072
+ 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) => {
51073
+ const agentId = runAgentId();
51074
+ const client = await getTrpcClient();
51075
+ const [threads, { artboard: board }] = await Promise.all([client.artboard.takeComments.mutate({
51076
+ agentId,
51077
+ id
51078
+ }), client.artboard.read.query({ id })]);
51079
+ if (options.json) return outputJson(threads);
51080
+ if (!threads.length) return console.log("No comment threads are waiting for you");
51081
+ console.log(threads.map((thread) => formatThread(thread, board.content)).join("\n\n"));
51082
+ });
51083
+ artboard.command("reply <commentId> <text...>").description("Answer a comment thread on the artboard").action(async (commentId, words) => {
51084
+ const agentId = runAgentId();
51085
+ await (await getTrpcClient()).artboard.replyAsAgent.mutate({
51086
+ agentId,
51087
+ commentId,
51088
+ content: textOf(words)
51089
+ });
51090
+ console.log(`replied in ${commentId}`);
51091
+ });
51092
+ 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) => {
51093
+ await (await getTrpcClient()).artboard.resolveComment.mutate({ commentId });
51094
+ console.log(`resolved ${commentId}`);
51095
+ });
51096
+ 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) => {
51097
+ const agentId = runAgentId();
51098
+ const question = await (await getTrpcClient()).artboard.askQuestion.mutate({
51099
+ agentId,
51100
+ boardId: options.board,
51101
+ content: textOf(words),
51102
+ groupId: options.group,
51103
+ id,
51104
+ pageId: options.page
51105
+ });
51106
+ console.log(`asked ${question.id}`);
51107
+ });
51108
+ };
51109
+
51110
+ //#endregion
51111
+ //#region src/commands/artboardOps.ts
51112
+ init_src$2();
51113
+ init_zod$1();
51114
+ const literal = (value) => JSON.stringify(value);
51115
+ const renderNode = (node) => {
51116
+ if (node.const !== void 0) return literal(node.const);
51117
+ if (node.enum) return node.enum.map(literal).join(" | ");
51118
+ const variants = node.oneOf ?? node.anyOf;
51119
+ if (variants) return variants.map(renderNode).join(" | ");
51120
+ if (node.type === "object" && node.properties) return renderObject(node);
51121
+ if (node.type === "integer") return "number";
51122
+ return node.type ?? "unknown";
51123
+ };
51124
+ const renderObject = (node) => {
51125
+ const required = new Set(node.required);
51126
+ const rank = ([key, value]) => value.const !== void 0 ? 0 : required.has(key) ? 1 : 2;
51127
+ return `{ ${Object.entries(node.properties).map((entry, index) => ({
51128
+ entry,
51129
+ index,
51130
+ rank: rank(entry)
51131
+ })).sort((a, b) => a.rank - b.rank || a.index - b.index).map(({ entry: [key, value] }) => `"${key}"${required.has(key) ? "" : "?"}: ${renderNode(value)}`).join(", ")} }`;
51132
+ };
51133
+ const NOTES = [
51134
+ "--ops takes a JSON array of these, inline or as @file.json. Every op in one call applies, or none does.",
51135
+ "A field marked ? is optional.",
51136
+ "\"ref\" is a name you choose on an add op; later ops in the same call can use it wherever an id is expected.",
51137
+ "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.",
51138
+ "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.",
51139
+ "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.",
51140
+ "\"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."
51141
+ ];
51142
+ const opsAction = (options) => {
51143
+ const schema = toJSONSchema(artboardOpSchema);
51144
+ if (options.json) return outputJson(schema);
51145
+ console.log("Ops accepted by `lh artboard create --ops` and `lh artboard update --ops`:\n");
51146
+ for (const op of schema.oneOf ?? schema.anyOf ?? []) console.log(` ${renderNode(op)}\n`);
51147
+ for (const note of NOTES) console.log(`- ${note}`);
51148
+ };
51149
+ const registerArtboardOpsCommand = (artboard) => {
51150
+ 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);
51151
+ };
51152
+
51153
+ //#endregion
51154
+ //#region src/commands/artboardPush.ts
51155
+ init_src$2();
51156
+ /**
51157
+ * Encoded JSON size of one writeFiles request. Vercel rejects bodies over 4.5 MB
51158
+ * and tRPC can batch other calls into the same request, so stay at 2 MB like
51159
+ * the web client's message write batcher.
51160
+ */
51161
+ const BATCH_BYTES = 2 * 1024 * 1024;
51162
+ const encodedBytes = (value) => Buffer.byteLength(JSON.stringify(value));
51163
+ const toLocalArtboardFile = (relative, bytes) => ({
51164
+ bytes,
51165
+ hash: createHash("md5").update(bytes).digest("hex"),
51166
+ path: relative
51167
+ });
51168
+ const putBlob = async (file, upload) => {
51169
+ const response = await fetch(upload.url, {
51170
+ body: file.bytes,
51171
+ headers: upload.headers,
51172
+ method: "PUT"
51173
+ }).catch((error) => {
51174
+ throw new Error(`Upload of ${file.path} failed: ${error?.message ?? String(error)}`);
51175
+ });
51176
+ if (!response.ok) throw new Error(`Upload of ${file.path} failed: ${response.status} ${response.statusText}`);
51177
+ };
51178
+ /**
51179
+ * Writes files to an artboard in requests of at most 2 MB encoded. A file too
51180
+ * large for one request is PUT to its path through a presigned URL first and
51181
+ * then committed as uploaded.
51182
+ */
51183
+ const writeArtboardFiles = async (api, id, files) => {
51184
+ const envelope = encodedBytes({
51185
+ files: { writes: [] },
51186
+ id
51187
+ });
51188
+ const writes = [];
51189
+ const large = [];
51190
+ for (const file of files) {
51191
+ const write = isArtboardTextPath(file.path) ? {
51192
+ content: file.bytes.toString("utf8"),
51193
+ path: file.path
51194
+ } : {
51195
+ base64: file.bytes.toString("base64"),
51196
+ path: file.path
51197
+ };
51198
+ if (envelope + encodedBytes(write) > BATCH_BYTES) large.push(file);
51199
+ else writes.push(write);
51200
+ }
51201
+ if (large.length) {
51202
+ const { uploads } = await api.prepareFileUploads.mutate({
51203
+ files: large.map((file) => ({
51204
+ path: file.path,
51205
+ size: file.bytes.byteLength
51206
+ })),
51207
+ id
51208
+ });
51209
+ const byPath = new Map(uploads.map((upload) => [upload.path, upload]));
51210
+ for (const file of large) {
51211
+ const upload = byPath.get(file.path);
51212
+ if (!upload) throw new Error(`Upload of ${file.path} failed: the server returned no upload URL`);
51213
+ await putBlob(file, upload);
51214
+ writes.push({
51215
+ path: file.path,
51216
+ uploaded: true
51217
+ });
51218
+ }
51219
+ }
51220
+ let batch = [];
51221
+ let batchBytes = envelope;
51222
+ for (const write of writes) {
51223
+ const bytes = encodedBytes(write) + 1;
51224
+ if (batch.length && batchBytes + bytes > BATCH_BYTES) {
51225
+ await api.writeFiles.mutate({
51226
+ files: { writes: batch },
51227
+ id
51228
+ });
51229
+ batch = [];
51230
+ batchBytes = envelope;
51231
+ }
51232
+ batch.push(write);
51233
+ batchBytes += bytes;
51234
+ }
51235
+ if (batch.length) await api.writeFiles.mutate({
51236
+ files: { writes: batch },
51237
+ id
51238
+ });
51239
+ };
51240
+ const listLocal = (root, dir = root) => fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
51241
+ if (entry.name.startsWith(".")) return [];
51242
+ const full = path.join(dir, entry.name);
51243
+ if (entry.isDirectory()) return listLocal(root, full);
51244
+ return entry.isFile() ? [path.relative(root, full).split(path.sep).join("/")] : [];
51245
+ });
51246
+ const pushArtboardDir = async (api, id, dir, options) => {
51247
+ const remote = new Map((await api.listFiles.query({ id })).map((file) => [file.path, file.hash]));
51248
+ const result = {
51249
+ deleted: [],
51250
+ skipped: [],
51251
+ unchanged: [],
51252
+ uploaded: []
51253
+ };
51254
+ const local = /* @__PURE__ */ new Set();
51255
+ const changed = [];
51256
+ for (const relative of listLocal(dir).sort()) {
51257
+ const normalized = normalizeArtboardFilePath(relative);
51258
+ if (!normalized) {
51259
+ result.skipped.push(relative);
51260
+ continue;
51261
+ }
51262
+ local.add(normalized);
51263
+ const file = toLocalArtboardFile(normalized, fs.readFileSync(path.join(dir, relative)));
51264
+ if (remote.get(normalized) === file.hash) {
51265
+ result.unchanged.push(normalized);
51266
+ continue;
51267
+ }
51268
+ changed.push(file);
51269
+ result.uploaded.push(normalized);
51270
+ }
51271
+ await writeArtboardFiles(api, id, changed);
51272
+ if (options.prune) {
51273
+ const missing = [...remote.keys()].filter((file) => !local.has(file));
51274
+ if (missing.length) {
51275
+ await api.writeFiles.mutate({
51276
+ files: { deletes: missing },
51277
+ id
51278
+ });
51279
+ result.deleted = missing;
51280
+ }
51281
+ }
51282
+ return result;
51283
+ };
51284
+
51285
+ //#endregion
51286
+ //#region src/commands/artboardSkillContent.ts
51287
+ 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.";
51288
+ const artboardSkillBody = `# Requirement artboard
51289
+
51290
+ 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.
51291
+
51292
+ ## 1. Check first
51293
+
51294
+ - \`LOBEHUB_TOPIC_ID\` is set: this session runs inside a LobeHub conversation.
51295
+ - \`lh artboard --help\` prints the artboard commands.
51296
+
51297
+ 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\`.
51298
+
51299
+ ## 2. Read before you draw
51300
+
51301
+ 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.
51302
+
51303
+ ## 3. Lay it out
51304
+
51305
+ 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.
51306
+
51307
+ **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:
51308
+
51309
+ 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.
51310
+ 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.
51311
+ 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.
51312
+
51313
+ - a page cannot fetch or open network connections; https images, fonts, styles and scripts load;
51314
+ - to change a screen, write its file again: every board showing it updates and comments on it are marked outdated;
51315
+ - \`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;
51316
+ - a screenshot of the current product can be an image board: write it under \`shots/\` and point a board at it.
51317
+
51318
+ A board of type "decision" needs no source.
51319
+
51320
+ 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.
51321
+
51322
+ **Layout.**
51323
+
51324
+ - An artboard has pages; each page has its own coordinates. Use a second page when the choices would crowd the flow.
51325
+ - Group the boards: one journey group for the flow the user will accept, and separate groups for options and references.
51326
+ - 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.
51327
+ - Where the flow branches, add a decision board, give each edge leaving it a condition, and mark the fallback branch as the default.
51328
+ - 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.
51329
+ - 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.
51330
+ - 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.
51331
+
51332
+ **Choices.** Every decision you are not sure of becomes a round:
51333
+
51334
+ - 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;
51335
+ - one options group holds the options of exactly one round;
51336
+ - the user submits every open round at once, so open only the rounds you want answered now.
51337
+
51338
+ **Comments and questions.** The user comments on boards, groups and pages. Answer them on the artboard, not only in chat:
51339
+
51340
+ - \`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;
51341
+ - \`lh artboard reply <commentId> <text>\` answers a thread, and \`lh artboard resolve <commentId>\` closes it once what it asks for is done;
51342
+ - 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.
51343
+
51344
+ ## 4. Hand over
51345
+
51346
+ 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.
51347
+
51348
+ ## 5. After the user submits
51349
+
51350
+ The picks and the user's new comments arrive as one message in this conversation. Then:
51351
+
51352
+ 1. \`lh artboard read <id>\` to see each round's chosen board; a round the user left unpicked takes your recommendation.
51353
+ 2. \`lh artboard comments <id>\` for the threads and their ids; the user's answers to your questions are there too.
51354
+ 3. Apply the picks and what the comments ask for in one \`lh artboard update\`.
51355
+ 4. Reply in each thread with what you changed, then resolve the threads that are done and the questions that are answered.
51356
+ 5. Open the next rounds if something is still undecided; otherwise say the requirement is settled and what was decided.
51357
+
51358
+ ## 6. After the user finalizes
51359
+
51360
+ 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:
51361
+
51362
+ 1. Build the journey in this repository.
51363
+ 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.
51364
+ 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.
51365
+
51366
+ ## Editing rules
51367
+
51368
+ - \`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.
51369
+ - Every op in one update applies, or none does.
51370
+ - 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.
51371
+ - After the artboard is finalized, the journey group's boards, edges and checks are locked; other groups can still change.
51372
+ `;
51373
+
51374
+ //#endregion
51375
+ //#region src/commands/artboardSkill.ts
51376
+ const ARTBOARD_SKILL_ID = "lobehub-artboard";
51377
+ const VERSION_LINE = /^\s+version:\s*["']?(\d+)\.(\d+)\.(\d+)/m;
51378
+ const renderSkill = (version) => [
51379
+ "---",
51380
+ `name: ${ARTBOARD_SKILL_ID}`,
51381
+ `description: ${JSON.stringify(artboardSkillDescription)}`,
51382
+ "metadata:",
51383
+ ` version: ${JSON.stringify(version)}`,
51384
+ "---",
51385
+ "",
51386
+ artboardSkillBody
51387
+ ].join("\n");
51388
+ const versionParts = (text) => {
51389
+ const match = /^(\d+)\.(\d+)\.(\d+)/.exec(text);
51390
+ return match ? match.slice(1).map(Number) : void 0;
51391
+ };
51392
+ const installedVersion = (skillFile) => {
51393
+ if (!existsSync(skillFile)) return void 0;
51394
+ const match = VERSION_LINE.exec(readFileSync(skillFile, "utf8"));
51395
+ return match ? match.slice(1, 4).join(".") : void 0;
51396
+ };
51397
+ const isNewer = (installed, current) => {
51398
+ const a = installed && versionParts(installed);
51399
+ const b = versionParts(current);
51400
+ if (!a || !b) return false;
51401
+ for (let index = 0; index < 3; index += 1) if (a[index] !== b[index]) return a[index] > b[index];
51402
+ return false;
51403
+ };
51404
+ const listFiles = (directory) => {
51405
+ if (!existsSync(directory)) return [];
51406
+ return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
51407
+ const entryPath = path.join(directory, entry.name);
51408
+ return entry.isDirectory() ? listFiles(entryPath) : [entryPath];
51409
+ });
51410
+ };
51411
+ const printLinks = (links) => {
51412
+ const arrow = import_picocolors.default.dim(" ↳");
51413
+ 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)}`);
51414
+ else if (link.kind === "already") console.log(`${arrow} ${import_picocolors.default.dim(`${link.link} already linked`)}`);
51415
+ else if (link.kind === "skipped") console.log(`${arrow} ${import_picocolors.default.yellow(`skipped ${link.link}: ${link.reason}`)}`);
51416
+ else console.log(`${arrow} ${import_picocolors.default.dim("no harness dirs detected — agents that read .agents/skills pick it up automatically")}`);
51417
+ };
51418
+ const initAction = (options) => {
51419
+ const baseDir = options.dir ? path.resolve(options.dir) : process.cwd();
51420
+ const skillDir = path.join(baseDir, AGENTS_SKILLS_DIR, ARTBOARD_SKILL_ID);
51421
+ const skillFile = path.join(skillDir, "SKILL.md");
51422
+ 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`);
51423
+ const installed = installedVersion(skillFile);
51424
+ if (isNewer(installed, cliVersion)) {
51425
+ const result = {
51426
+ dir: skillDir,
51427
+ installedVersion: installed,
51428
+ links: [],
51429
+ removed: [],
51430
+ skill: ARTBOARD_SKILL_ID,
51431
+ status: "newer-installed",
51432
+ version: cliVersion,
51433
+ written: []
51434
+ };
51435
+ if (options.json) return outputJson(result);
51436
+ console.log(`${import_picocolors.default.yellow("!")} ${ARTBOARD_SKILL_ID} v${installed} is already installed and this lh is v${cliVersion}; nothing changed`);
51437
+ return;
51438
+ }
51439
+ const removed = listFiles(skillDir).filter((file) => file !== skillFile).map((file) => {
51440
+ rmSync(file, { force: true });
51441
+ return path.relative(skillDir, file).split(path.sep).join("/");
51442
+ });
51443
+ mkdirSync(skillDir, { recursive: true });
51444
+ writeFileSync(skillFile, renderSkill(cliVersion), "utf8");
51445
+ const links = linkHarnessSkills(baseDir, ARTBOARD_SKILL_ID);
51446
+ const result = {
51447
+ dir: skillDir,
51448
+ installedVersion: installed,
51449
+ links,
51450
+ removed,
51451
+ skill: ARTBOARD_SKILL_ID,
51452
+ status: "installed",
51453
+ version: cliVersion,
51454
+ written: ["SKILL.md"]
51455
+ };
51456
+ if (options.json) return outputJson(result);
51457
+ 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)}`);
51458
+ console.log(` written: SKILL.md${removed.length ? ` · removed: ${removed.join(", ")}` : ""}`);
51459
+ printLinks(links);
51460
+ console.log(import_picocolors.default.dim(" Commit these files so agents working in this repository load the skill."));
51461
+ };
51462
+ const registerArtboardSkillCommand = (artboard) => {
51463
+ 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);
51464
+ };
51465
+
51466
+ //#endregion
51467
+ //#region src/commands/artboard.ts
51468
+ init_src$2();
51469
+ const resultLine = (artboard) => formatArtboardResultLine({
51470
+ boardCount: artboard.content.boards.length,
51471
+ groupCount: artboard.content.groups.length,
51472
+ id: artboard.id,
51473
+ revision: artboard.revision
51474
+ });
51475
+ const parseOps = (value) => {
51476
+ if (value === void 0) return void 0;
51477
+ const text = value.startsWith("@") ? fs.readFileSync(value.slice(1), "utf8") : value;
51478
+ const ops = JSON.parse(text);
51479
+ if (!Array.isArray(ops)) throw new Error("--ops must be a JSON array of ops");
51480
+ return ops;
51481
+ };
51482
+ const parseFiles = (value) => {
51483
+ if (value === void 0) return void 0;
51484
+ const text = value.startsWith("@") ? fs.readFileSync(value.slice(1), "utf8") : value;
51485
+ const files = JSON.parse(text);
51486
+ if (!files || typeof files !== "object" || Array.isArray(files)) throw new Error("--files must be a JSON object of writes, edits and deletes");
51487
+ return files;
51488
+ };
51489
+ const FILES_HELP = "File changes applied before the ops: {\"writes\":[{\"path\",\"content\"}],\"edits\":[{\"path\",\"oldText\",\"newText\"}],\"deletes\":[path]} as JSON, or @file.json";
51490
+ const positiveInteger = (value) => {
51491
+ const result = Number(value);
51492
+ if (!Number.isSafeInteger(result) || result < 1) throw new Error("Expected a positive integer");
51493
+ return result;
51494
+ };
51495
+ const topicId = () => process.env.LOBEHUB_TOPIC_ID || void 0;
51496
+ const registerArtboardCommand = (program) => {
51497
+ const artboard = program.command("artboard").description("Lay out a requirement on a project artboard (same ops as the builtin-artboard tool)");
51498
+ 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) => {
51499
+ if (!options.task && !topicId()) throw new Error("Pass --task: this shell has no LOBEHUB_TOPIC_ID to find the project");
51500
+ const result = await (await getTrpcClient()).artboard.create.mutate({
51501
+ description: options.description,
51502
+ files: parseFiles(options.files),
51503
+ ops: parseOps(options.ops),
51504
+ taskId: options.task,
51505
+ title: options.title,
51506
+ topicId: topicId()
51507
+ });
51508
+ if (options.json) return outputJson(result);
51509
+ console.log(resultLine(result.artboard));
51510
+ });
51511
+ 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) => {
51512
+ if (options.files === void 0 && options.ops === void 0) throw new Error("Pass --ops, --files or both");
51513
+ const result = await (await getTrpcClient()).artboard.update.mutate({
51514
+ files: parseFiles(options.files),
51515
+ id,
51516
+ ops: parseOps(options.ops),
51517
+ revision: options.revision
51518
+ });
51519
+ if (options.json) return outputJson(result);
51520
+ console.log(resultLine(result.artboard));
51521
+ });
51522
+ artboard.command("read <id>").description("Print the artboard and its revision").option("--json", "Print structured JSON").action(async (id, options) => {
51523
+ const result = await (await getTrpcClient()).artboard.read.query({ id });
51524
+ if (options.json) return outputJson(result);
51525
+ console.log(resultLine(result.artboard));
51526
+ console.log(JSON.stringify(result.artboard.content, null, 2));
51527
+ });
51528
+ 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) => {
51529
+ const result = await pushArtboardDir((await getTrpcClient()).artboard, id, dir, { prune: options.prune });
51530
+ if (options.json) return outputJson(result);
51531
+ console.log(`pushed ${result.uploaded.length} · unchanged ${result.unchanged.length} · deleted ${result.deleted.length}`);
51532
+ for (const skipped of result.skipped) console.log(`skipped ${skipped}: not a file a board can serve`);
51533
+ });
51534
+ const files = artboard.command("files").description("List, read, write and remove artboard files");
51535
+ files.command("list <id>").description("List the files of the artboard").option("--json", "Print structured JSON").action(async (id, options) => {
51536
+ const list = await (await getTrpcClient()).artboard.listFiles.query({ id });
51537
+ if (options.json) return outputJson(list);
51538
+ for (const file of list) console.log(`${file.path} ${file.size} B`);
51539
+ });
51540
+ files.command("read <id> <path>").description("Print one text file of the artboard").action(async (id, path) => {
51541
+ const file = await (await getTrpcClient()).artboard.readFile.query({
51542
+ id,
51543
+ path
51544
+ });
51545
+ if (file.content === void 0) throw new Error(`${file.path} is binary`);
51546
+ process.stdout.write(file.content);
51547
+ });
51548
+ 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) => {
51549
+ const normalized = normalizeArtboardFilePath(path);
51550
+ if (!normalized) throw new Error(`${path} is not a file a board can serve`);
51551
+ const bytes = options.from ? fs.readFileSync(options.from) : await buffer(process.stdin);
51552
+ await writeArtboardFiles((await getTrpcClient()).artboard, id, [toLocalArtboardFile(normalized, bytes)]);
51553
+ console.log(`wrote ${normalized} ${bytes.byteLength} B`);
51554
+ });
51555
+ 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) => {
51556
+ await (await getTrpcClient()).artboard.writeFiles.mutate({
51557
+ files: { deletes: paths },
51558
+ id
51559
+ });
51560
+ for (const path of paths) console.log(`deleted ${path}`);
51561
+ });
51562
+ 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) => {
51563
+ const boards = await (await getTrpcClient()).artboard.list.query({
51564
+ taskId: options.task,
51565
+ topicId: topicId()
51566
+ });
51567
+ if (options.json) return outputJson(boards);
51568
+ for (const board of boards) console.log(`${board.id} ${board.title} ${board.phase} revision ${board.revision}`);
51569
+ });
51570
+ registerArtboardCommentCommands(artboard);
51571
+ registerArtboardOpsCommand(artboard);
51572
+ registerArtboardSkillCommand(artboard);
51573
+ };
51574
+
50783
51575
  //#endregion
50784
51576
  //#region ../../packages/html-artifact/src/fileExtension.ts
50785
51577
  const getFileExtension = (filename) => {
@@ -56659,6 +57451,10 @@ const bindingSchema = object$1({
56659
57451
  workId: string().min(1)
56660
57452
  }).optional()
56661
57453
  }).optional(),
57454
+ pendingCanvasSave: object$1({
57455
+ fingerprint: string().regex(/^[\da-f]{64}$/),
57456
+ requestId: uuid()
57457
+ }).optional(),
56662
57458
  pendingCreateFingerprint: string().min(1).optional(),
56663
57459
  pendingCreateKey: string().min(1).optional(),
56664
57460
  pendingType: _enum(["canvas", "html"]).optional()
@@ -56670,7 +57466,7 @@ const bindingSchema = object$1({
56670
57466
  });
56671
57467
  const manifestSchema = object$1({
56672
57468
  artifacts: record(string(), bindingSchema),
56673
- version: literal(1)
57469
+ version: literal$1(1)
56674
57470
  }).passthrough();
56675
57471
  const emptyManifest = () => ({
56676
57472
  artifacts: {},
@@ -56871,6 +57667,55 @@ const publishCanvasArtifact = async (client, params) => {
56871
57667
  subdomainLabel: published.subdomainLabel
56872
57668
  };
56873
57669
  };
57670
+ const saveFingerprint = (html, title, createNew) => createHash("sha256").update(JSON.stringify([
57671
+ "save",
57672
+ html,
57673
+ title,
57674
+ createNew
57675
+ ])).digest("hex");
57676
+ const saveCanvasArtifact = async (client, params) => {
57677
+ const { binding, html, manifest, title } = params;
57678
+ if (binding.pendingCanvas) throw new Error("A Canvas publication is pending; retry lh artifact publish with the original input first");
57679
+ if (binding.pendingCreateKey && binding.pendingType !== "canvas") throw new Error("Complete the pending HTML publication before saving a Canvas");
57680
+ const context = await client.canvas.getPublishContext.query();
57681
+ const scope = JSON.stringify([
57682
+ resolveServerUrl(),
57683
+ context.userId,
57684
+ context.workspaceId
57685
+ ]);
57686
+ if (binding.scope && binding.scope !== scope) throw new Error("This artifact is bound to a different server, account or workspace");
57687
+ const createNew = !!params.new;
57688
+ const canvasId = createNew ? void 0 : binding.canvasId;
57689
+ const current = canvasId ? await client.canvas.getVersion.query({ canvasId }) : null;
57690
+ if (canvasId && !current) throw new Error("The bound Canvas is unavailable to this account; save it with --new");
57691
+ const fingerprint = saveFingerprint(html, title, createNew);
57692
+ const requestId = binding.pendingCanvasSave?.fingerprint === fingerprint ? binding.pendingCanvasSave.requestId : createIdempotencyKey();
57693
+ writeBinding(manifest, {
57694
+ ...binding,
57695
+ pendingCanvasSave: {
57696
+ fingerprint,
57697
+ requestId
57698
+ }
57699
+ });
57700
+ const saved = await client.canvas.save.mutate({
57701
+ canvasId,
57702
+ expectedVersion: current?.version ?? 0,
57703
+ html,
57704
+ requestId,
57705
+ title
57706
+ });
57707
+ const { pendingCanvasSave: _pending, ...settled } = binding;
57708
+ writeBinding(manifest, {
57709
+ ...settled,
57710
+ ...createNew && { deploymentId: void 0 },
57711
+ canvasId: saved.canvasId,
57712
+ scope,
57713
+ type: "canvas",
57714
+ version: saved.version,
57715
+ workId: saved.workId
57716
+ });
57717
+ return saved;
57718
+ };
56874
57719
 
56875
57720
  //#endregion
56876
57721
  //#region src/commands/artifact.ts
@@ -56924,6 +57769,42 @@ function registerArtifactCommand(program) {
56924
57769
  }
56925
57770
  console.log(output.content);
56926
57771
  });
57772
+ 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) => {
57773
+ const entryPath = path.resolve(file);
57774
+ const rootDirectory = path.resolve(options.root ?? process.cwd());
57775
+ if (!entryPath.startsWith(`${rootDirectory}${path.sep}`) && entryPath !== rootDirectory) {
57776
+ fail$4(`${file} is outside ${rootDirectory}. Pass --root to widen the saved directory.`);
57777
+ return;
57778
+ }
57779
+ const entry = await readLocalHtmlAsset(entryPath);
57780
+ if (!entry.ok || entry.text === void 0) {
57781
+ fail$4(`Cannot read ${file}`);
57782
+ return;
57783
+ }
57784
+ const manifest = resolveManifest(entryPath, rootDirectory);
57785
+ const binding = readBinding(manifest);
57786
+ if (!options.new && binding.deploymentId && (binding.type ?? "html") !== "canvas") {
57787
+ fail$4("This file is bound to an HTML artifact; pass --new to save it as a Canvas.");
57788
+ return;
57789
+ }
57790
+ try {
57791
+ const saved = await saveCanvasArtifact(await getTrpcClient(), {
57792
+ binding,
57793
+ html: entry.text,
57794
+ manifest,
57795
+ new: options.new,
57796
+ title: options.title || extractHtmlTitle(entry.text) || path.basename(entryPath, path.extname(entryPath))
57797
+ });
57798
+ if (options.json !== void 0) outputJson(saved, typeof options.json === "string" ? options.json : void 0);
57799
+ else console.log(`${import_picocolors.default.green("✓")} Saved Canvas ${saved.canvasId} (version ${saved.version})`);
57800
+ } catch (error) {
57801
+ if (options.json !== void 0) outputJson({
57802
+ error: formatError(error),
57803
+ success: false
57804
+ });
57805
+ fail$4(formatError(error));
57806
+ }
57807
+ });
56927
57808
  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) => {
56928
57809
  const entryPath = path.resolve(file);
56929
57810
  const rootDirectory = path.resolve(options.root ?? process.cwd());
@@ -60771,7 +61652,7 @@ const LOBEHUB_CLI_GUIDE_CONTEXT = "lobehub-cli-guide";
60771
61652
  * agent keeps in context, so it names the LobeHub-shaped requests and, just as
60772
61653
  * deliberately, says what is not one.
60773
61654
  */
60774
- 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.";
61655
+ 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.";
60775
61656
  const lobeHubCliGuideBody = [
60776
61657
  "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`.",
60777
61658
  "",
@@ -60781,7 +61662,7 @@ const lobeHubCliGuideBody = [
60781
61662
  "- **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.",
60782
61663
  "- **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 @lobehub/cli@latest dlx lh …` (or `npx -y -p @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.",
60783
61664
  "- **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.",
60784
- "- **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.",
61665
+ "- **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.",
60785
61666
  "- **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.",
60786
61667
  "- **If a command fails with an authentication or permission error**, tell the user what you were trying to do — do not work around it.",
60787
61668
  "- **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."
@@ -63242,7 +64123,7 @@ init_zod$1();
63242
64123
  const questionSchema = object$1({
63243
64124
  header: string().max(200),
63244
64125
  id: string().min(1),
63245
- isSecret: literal(false),
64126
+ isSecret: literal$1(false),
63246
64127
  options: array(object$1({
63247
64128
  description: string().max(1e3),
63248
64129
  label: string().min(1).max(200)
@@ -63290,13 +64171,13 @@ const codexUserInputResponse = (request, answer) => {
63290
64171
  init_zod$1();
63291
64172
  const nonBlank = string().refine((value) => value.trim().length > 0);
63292
64173
  const notificationSchema = object$1({ item: object$1({
63293
- delivery: literal("async"),
64174
+ delivery: literal$1("async"),
63294
64175
  id: nonBlank,
63295
64176
  questions: array(object$1({
63296
64177
  options: array(nonBlank).nullish(),
63297
64178
  title: nonBlank
63298
64179
  })).min(1),
63299
- type: literal("agentMessage")
64180
+ type: literal$1("agentMessage")
63300
64181
  }) });
63301
64182
  const readCodexAsyncQuestion = (params) => {
63302
64183
  const item = notificationSchema.safeParse(params).data?.item;
@@ -98646,14 +99527,14 @@ var require_stream$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
98646
99527
  //#endregion
98647
99528
  //#region node_modules/.pnpm/safe-buffer@5.1.2/node_modules/safe-buffer/index.js
98648
99529
  var require_safe_buffer$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
98649
- var buffer$1 = __require("buffer");
98650
- var Buffer = buffer$1.Buffer;
99530
+ var buffer$2 = __require("buffer");
99531
+ var Buffer = buffer$2.Buffer;
98651
99532
  function copyProps(src, dst) {
98652
99533
  for (var key in src) dst[key] = src[key];
98653
99534
  }
98654
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer$1;
99535
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer$2;
98655
99536
  else {
98656
- copyProps(buffer$1, exports);
99537
+ copyProps(buffer$2, exports);
98657
99538
  exports.Buffer = SafeBuffer;
98658
99539
  }
98659
99540
  function SafeBuffer(arg, encodingOrOffset, length) {
@@ -98678,7 +99559,7 @@ var require_safe_buffer$1 = /* @__PURE__ */ __commonJSMin$2(((exports, module) =
98678
99559
  };
98679
99560
  SafeBuffer.allocUnsafeSlow = function(size) {
98680
99561
  if (typeof size !== "number") throw new TypeError("Argument must be a number");
98681
- return buffer$1.SlowBuffer(size);
99562
+ return buffer$2.SlowBuffer(size);
98682
99563
  };
98683
99564
  }));
98684
99565
 
@@ -260886,14 +261767,14 @@ var require__stream_duplex = /* @__PURE__ */ __commonJSMin$2(((exports, module)
260886
261767
  //#region node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js
260887
261768
  var require_safe_buffer = /* @__PURE__ */ __commonJSMin$2(((exports, module) => {
260888
261769
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
260889
- var buffer = __require("buffer");
260890
- var Buffer = buffer.Buffer;
261770
+ var buffer$1 = __require("buffer");
261771
+ var Buffer = buffer$1.Buffer;
260891
261772
  function copyProps(src, dst) {
260892
261773
  for (var key in src) dst[key] = src[key];
260893
261774
  }
260894
- if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
261775
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer$1;
260895
261776
  else {
260896
- copyProps(buffer, exports);
261777
+ copyProps(buffer$1, exports);
260897
261778
  exports.Buffer = SafeBuffer;
260898
261779
  }
260899
261780
  function SafeBuffer(arg, encodingOrOffset, length) {
@@ -260919,7 +261800,7 @@ var require_safe_buffer = /* @__PURE__ */ __commonJSMin$2(((exports, module) =>
260919
261800
  };
260920
261801
  SafeBuffer.allocUnsafeSlow = function(size) {
260921
261802
  if (typeof size !== "number") throw new TypeError("Argument must be a number");
260922
- return buffer.SlowBuffer(size);
261803
+ return buffer$1.SlowBuffer(size);
260923
261804
  };
260924
261805
  }));
260925
261806
 
@@ -308759,21 +309640,21 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308759
309640
  ResultSchema = looseObject({ _meta: ResultMetaObjectSchema.optional() });
308760
309641
  RequestIdSchema = union([string(), number$1().int()]);
308761
309642
  JSONRPCRequestSchema = object$1({
308762
- jsonrpc: literal("2.0"),
309643
+ jsonrpc: literal$1("2.0"),
308763
309644
  id: RequestIdSchema,
308764
309645
  ...RequestSchema.shape
308765
309646
  }).strict();
308766
309647
  JSONRPCNotificationSchema = object$1({
308767
- jsonrpc: literal("2.0"),
309648
+ jsonrpc: literal$1("2.0"),
308768
309649
  ...NotificationSchema.shape
308769
309650
  }).strict();
308770
309651
  JSONRPCResultResponseSchema = object$1({
308771
- jsonrpc: literal("2.0"),
309652
+ jsonrpc: literal$1("2.0"),
308772
309653
  id: RequestIdSchema,
308773
309654
  result: ResultSchema
308774
309655
  }).strict();
308775
309656
  JSONRPCErrorResponseSchema = object$1({
308776
- jsonrpc: literal("2.0"),
309657
+ jsonrpc: literal$1("2.0"),
308777
309658
  id: RequestIdSchema.optional(),
308778
309659
  error: object$1({
308779
309660
  code: number$1().int(),
@@ -308794,7 +309675,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308794
309675
  reason: string().optional()
308795
309676
  });
308796
309677
  CancelledNotificationSchema = NotificationSchema.extend({
308797
- method: literal("notifications/cancelled"),
309678
+ method: literal$1("notifications/cancelled"),
308798
309679
  params: CancelledNotificationParamsSchema
308799
309680
  });
308800
309681
  IconSchema = object$1({
@@ -308853,7 +309734,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308853
309734
  clientInfo: ImplementationSchema
308854
309735
  });
308855
309736
  InitializeRequestSchema = RequestSchema.extend({
308856
- method: literal("initialize"),
309737
+ method: literal$1("initialize"),
308857
309738
  params: InitializeRequestParamsSchema
308858
309739
  });
308859
309740
  ServerCapabilitiesSchema = object$1({
@@ -308876,11 +309757,11 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308876
309757
  instructions: string().optional()
308877
309758
  });
308878
309759
  InitializedNotificationSchema = NotificationSchema.extend({
308879
- method: literal("notifications/initialized"),
309760
+ method: literal$1("notifications/initialized"),
308880
309761
  params: NotificationsParamsSchema.optional()
308881
309762
  });
308882
309763
  DiscoverRequestSchema = RequestSchema.extend({
308883
- method: literal("server/discover"),
309764
+ method: literal$1("server/discover"),
308884
309765
  params: BaseRequestParamsSchema.optional()
308885
309766
  });
308886
309767
  DiscoverResultSchema = ResultSchema.extend({
@@ -308889,7 +309770,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308889
309770
  instructions: string().optional()
308890
309771
  });
308891
309772
  PingRequestSchema = RequestSchema.extend({
308892
- method: literal("ping"),
309773
+ method: literal$1("ping"),
308893
309774
  params: BaseRequestParamsSchema.optional()
308894
309775
  });
308895
309776
  ProgressSchema = object$1({
@@ -308903,7 +309784,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308903
309784
  progressToken: ProgressTokenSchema
308904
309785
  });
308905
309786
  ProgressNotificationSchema = NotificationSchema.extend({
308906
- method: literal("notifications/progress"),
309787
+ method: literal$1("notifications/progress"),
308907
309788
  params: ProgressNotificationParamsSchema
308908
309789
  });
308909
309790
  PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({ cursor: CursorSchema.optional() });
@@ -308949,29 +309830,29 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308949
309830
  annotations: AnnotationsSchema.optional(),
308950
309831
  _meta: optional(looseObject({}))
308951
309832
  });
308952
- ListResourcesRequestSchema = PaginatedRequestSchema.extend({ method: literal("resources/list") });
309833
+ ListResourcesRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("resources/list") });
308953
309834
  ListResourcesResultSchema = PaginatedResultSchema.extend({ resources: array(ResourceSchema) });
308954
- ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ method: literal("resources/templates/list") });
309835
+ ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("resources/templates/list") });
308955
309836
  ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({ resourceTemplates: array(ResourceTemplateSchema) });
308956
309837
  ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({ uri: string() });
308957
309838
  ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
308958
309839
  ReadResourceRequestSchema = RequestSchema.extend({
308959
- method: literal("resources/read"),
309840
+ method: literal$1("resources/read"),
308960
309841
  params: ReadResourceRequestParamsSchema
308961
309842
  });
308962
309843
  ReadResourceResultSchema = ResultSchema.extend({ contents: array(union([TextResourceContentsSchema, BlobResourceContentsSchema])) });
308963
309844
  ResourceListChangedNotificationSchema = NotificationSchema.extend({
308964
- method: literal("notifications/resources/list_changed"),
309845
+ method: literal$1("notifications/resources/list_changed"),
308965
309846
  params: NotificationsParamsSchema.optional()
308966
309847
  });
308967
309848
  SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
308968
309849
  SubscribeRequestSchema = RequestSchema.extend({
308969
- method: literal("resources/subscribe"),
309850
+ method: literal$1("resources/subscribe"),
308970
309851
  params: SubscribeRequestParamsSchema
308971
309852
  });
308972
309853
  UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
308973
309854
  UnsubscribeRequestSchema = RequestSchema.extend({
308974
- method: literal("resources/unsubscribe"),
309855
+ method: literal$1("resources/unsubscribe"),
308975
309856
  params: UnsubscribeRequestParamsSchema
308976
309857
  });
308977
309858
  SubscriptionFilterSchema = object$1({
@@ -308982,19 +309863,19 @@ var init_schemas_DscsoNZN = __esmMin((() => {
308982
309863
  });
308983
309864
  SubscriptionsListenRequestParamsSchema = BaseRequestParamsSchema.extend({ notifications: SubscriptionFilterSchema });
308984
309865
  SubscriptionsListenRequestSchema = RequestSchema.extend({
308985
- method: literal("subscriptions/listen"),
309866
+ method: literal$1("subscriptions/listen"),
308986
309867
  params: SubscriptionsListenRequestParamsSchema
308987
309868
  });
308988
309869
  SubscriptionsAcknowledgedNotificationParamsSchema = NotificationsParamsSchema.extend({ notifications: SubscriptionFilterSchema });
308989
309870
  SubscriptionsAcknowledgedNotificationSchema = NotificationSchema.extend({
308990
- method: literal("notifications/subscriptions/acknowledged"),
309871
+ method: literal$1("notifications/subscriptions/acknowledged"),
308991
309872
  params: SubscriptionsAcknowledgedNotificationParamsSchema
308992
309873
  });
308993
309874
  SubscriptionsListenResultMetaSchema = ResultMetaObjectSchema.extend({ [SUBSCRIPTION_ID_META_KEY]: RequestIdSchema });
308994
309875
  SubscriptionsListenResultSchema = ResultSchema.extend({ _meta: SubscriptionsListenResultMetaSchema });
308995
309876
  ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({ uri: string() });
308996
309877
  ResourceUpdatedNotificationSchema = NotificationSchema.extend({
308997
- method: literal("notifications/resources/updated"),
309878
+ method: literal$1("notifications/resources/updated"),
308998
309879
  params: ResourceUpdatedNotificationParamsSchema
308999
309880
  });
309000
309881
  PromptArgumentSchema = object$1({
@@ -309009,50 +309890,50 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309009
309890
  arguments: optional(array(PromptArgumentSchema)),
309010
309891
  _meta: optional(looseObject({}))
309011
309892
  });
309012
- ListPromptsRequestSchema = PaginatedRequestSchema.extend({ method: literal("prompts/list") });
309893
+ ListPromptsRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("prompts/list") });
309013
309894
  ListPromptsResultSchema = PaginatedResultSchema.extend({ prompts: array(PromptSchema) });
309014
309895
  GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
309015
309896
  name: string(),
309016
309897
  arguments: record(string(), string()).optional()
309017
309898
  });
309018
309899
  GetPromptRequestSchema = RequestSchema.extend({
309019
- method: literal("prompts/get"),
309900
+ method: literal$1("prompts/get"),
309020
309901
  params: GetPromptRequestParamsSchema
309021
309902
  });
309022
309903
  TextContentSchema = object$1({
309023
- type: literal("text"),
309904
+ type: literal$1("text"),
309024
309905
  text: string(),
309025
309906
  annotations: AnnotationsSchema.optional(),
309026
309907
  _meta: record(string(), unknown()).optional()
309027
309908
  });
309028
309909
  ImageContentSchema = object$1({
309029
- type: literal("image"),
309910
+ type: literal$1("image"),
309030
309911
  data: Base64Schema,
309031
309912
  mimeType: string(),
309032
309913
  annotations: AnnotationsSchema.optional(),
309033
309914
  _meta: record(string(), unknown()).optional()
309034
309915
  });
309035
309916
  AudioContentSchema = object$1({
309036
- type: literal("audio"),
309917
+ type: literal$1("audio"),
309037
309918
  data: Base64Schema,
309038
309919
  mimeType: string(),
309039
309920
  annotations: AnnotationsSchema.optional(),
309040
309921
  _meta: record(string(), unknown()).optional()
309041
309922
  });
309042
309923
  ToolUseContentSchema = object$1({
309043
- type: literal("tool_use"),
309924
+ type: literal$1("tool_use"),
309044
309925
  name: string(),
309045
309926
  id: string(),
309046
309927
  input: record(string(), unknown()),
309047
309928
  _meta: record(string(), unknown()).optional()
309048
309929
  });
309049
309930
  EmbeddedResourceSchema = object$1({
309050
- type: literal("resource"),
309931
+ type: literal$1("resource"),
309051
309932
  resource: union([TextResourceContentsSchema, BlobResourceContentsSchema]),
309052
309933
  annotations: AnnotationsSchema.optional(),
309053
309934
  _meta: record(string(), unknown()).optional()
309054
309935
  });
309055
- ResourceLinkSchema = ResourceSchema.extend({ type: literal("resource_link") });
309936
+ ResourceLinkSchema = ResourceSchema.extend({ type: literal$1("resource_link") });
309056
309937
  ContentBlockSchema = union([
309057
309938
  TextContentSchema,
309058
309939
  ImageContentSchema,
@@ -309069,7 +309950,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309069
309950
  messages: array(PromptMessageSchema)
309070
309951
  });
309071
309952
  PromptListChangedNotificationSchema = NotificationSchema.extend({
309072
- method: literal("notifications/prompts/list_changed"),
309953
+ method: literal$1("notifications/prompts/list_changed"),
309073
309954
  params: NotificationsParamsSchema.optional()
309074
309955
  });
309075
309956
  ToolAnnotationsSchema = object$1({
@@ -309089,7 +309970,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309089
309970
  ...IconsSchema.shape,
309090
309971
  description: string().optional(),
309091
309972
  inputSchema: object$1({
309092
- type: literal("object"),
309973
+ type: literal$1("object"),
309093
309974
  properties: record(string(), JSONValueSchema).optional(),
309094
309975
  required: array(string()).optional()
309095
309976
  }).catchall(unknown()),
@@ -309098,7 +309979,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309098
309979
  execution: ToolExecutionSchema.optional(),
309099
309980
  _meta: record(string(), unknown()).optional()
309100
309981
  });
309101
- ListToolsRequestSchema = PaginatedRequestSchema.extend({ method: literal("tools/list") });
309982
+ ListToolsRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("tools/list") });
309102
309983
  ListToolsResultSchema = PaginatedResultSchema.extend({ tools: array(ToolSchema) });
309103
309984
  CallToolResultSchema = ResultSchema.extend({
309104
309985
  content: array(ContentBlockSchema).default([]),
@@ -309111,11 +309992,11 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309111
309992
  arguments: record(string(), unknown()).optional()
309112
309993
  });
309113
309994
  CallToolRequestSchema = RequestSchema.extend({
309114
- method: literal("tools/call"),
309995
+ method: literal$1("tools/call"),
309115
309996
  params: CallToolRequestParamsSchema
309116
309997
  });
309117
309998
  ToolListChangedNotificationSchema = NotificationSchema.extend({
309118
- method: literal("notifications/tools/list_changed"),
309999
+ method: literal$1("notifications/tools/list_changed"),
309119
310000
  params: NotificationsParamsSchema.optional()
309120
310001
  });
309121
310002
  ListChangedOptionsBaseSchema = object$1({
@@ -309134,7 +310015,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309134
310015
  ]);
309135
310016
  SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({ level: LoggingLevelSchema });
309136
310017
  SetLevelRequestSchema = RequestSchema.extend({
309137
- method: literal("logging/setLevel"),
310018
+ method: literal$1("logging/setLevel"),
309138
310019
  params: SetLevelRequestParamsSchema
309139
310020
  });
309140
310021
  LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
@@ -309143,7 +310024,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309143
310024
  data: unknown()
309144
310025
  });
309145
310026
  LoggingMessageNotificationSchema = NotificationSchema.extend({
309146
- method: literal("notifications/message"),
310027
+ method: literal$1("notifications/message"),
309147
310028
  params: LoggingMessageNotificationParamsSchema
309148
310029
  });
309149
310030
  ModelHintSchema = object$1({ name: string().optional() });
@@ -309159,7 +310040,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309159
310040
  "none"
309160
310041
  ]).optional() });
309161
310042
  ToolResultContentSchema = object$1({
309162
- type: literal("tool_result"),
310043
+ type: literal$1("tool_result"),
309163
310044
  toolUseId: string().describe("The unique identifier for the corresponding tool call."),
309164
310045
  content: array(ContentBlockSchema),
309165
310046
  structuredContent: unknown().optional(),
@@ -309200,7 +310081,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309200
310081
  toolChoice: ToolChoiceSchema.optional()
309201
310082
  });
309202
310083
  CreateMessageRequestSchema = RequestSchema.extend({
309203
- method: literal("sampling/createMessage"),
310084
+ method: literal$1("sampling/createMessage"),
309204
310085
  params: CreateMessageRequestParamsSchema
309205
310086
  });
309206
310087
  CreateMessageResultSchema = ResultSchema.extend({
@@ -309225,13 +310106,13 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309225
310106
  content: union([SamplingMessageContentBlockSchema, array(SamplingMessageContentBlockSchema)])
309226
310107
  });
309227
310108
  BooleanSchemaSchema = object$1({
309228
- type: literal("boolean"),
310109
+ type: literal$1("boolean"),
309229
310110
  title: string().optional(),
309230
310111
  description: string().optional(),
309231
310112
  default: boolean().optional()
309232
310113
  });
309233
310114
  StringSchemaSchema = object$1({
309234
- type: literal("string"),
310115
+ type: literal$1("string"),
309235
310116
  title: string().optional(),
309236
310117
  description: string().optional(),
309237
310118
  minLength: number$1().optional(),
@@ -309253,14 +310134,14 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309253
310134
  default: number$1().optional()
309254
310135
  });
309255
310136
  UntitledSingleSelectEnumSchemaSchema = object$1({
309256
- type: literal("string"),
310137
+ type: literal$1("string"),
309257
310138
  title: string().optional(),
309258
310139
  description: string().optional(),
309259
310140
  enum: array(string()),
309260
310141
  default: string().optional()
309261
310142
  });
309262
310143
  TitledSingleSelectEnumSchemaSchema = object$1({
309263
- type: literal("string"),
310144
+ type: literal$1("string"),
309264
310145
  title: string().optional(),
309265
310146
  description: string().optional(),
309266
310147
  oneOf: array(object$1({
@@ -309270,7 +310151,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309270
310151
  default: string().optional()
309271
310152
  });
309272
310153
  LegacyTitledEnumSchemaSchema = object$1({
309273
- type: literal("string"),
310154
+ type: literal$1("string"),
309274
310155
  title: string().optional(),
309275
310156
  description: string().optional(),
309276
310157
  enum: array(string()),
@@ -309279,19 +310160,19 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309279
310160
  });
309280
310161
  SingleSelectEnumSchemaSchema = union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
309281
310162
  UntitledMultiSelectEnumSchemaSchema = object$1({
309282
- type: literal("array"),
310163
+ type: literal$1("array"),
309283
310164
  title: string().optional(),
309284
310165
  description: string().optional(),
309285
310166
  minItems: number$1().optional(),
309286
310167
  maxItems: number$1().optional(),
309287
310168
  items: object$1({
309288
- type: literal("string"),
310169
+ type: literal$1("string"),
309289
310170
  enum: array(string())
309290
310171
  }),
309291
310172
  default: array(string()).optional()
309292
310173
  });
309293
310174
  TitledMultiSelectEnumSchemaSchema = object$1({
309294
- type: literal("array"),
310175
+ type: literal$1("array"),
309295
310176
  title: string().optional(),
309296
310177
  description: string().optional(),
309297
310178
  minItems: number$1().optional(),
@@ -309315,28 +310196,28 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309315
310196
  NumberSchemaSchema
309316
310197
  ]);
309317
310198
  ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
309318
- mode: literal("form").optional(),
310199
+ mode: literal$1("form").optional(),
309319
310200
  message: string(),
309320
310201
  requestedSchema: object$1({
309321
- type: literal("object"),
310202
+ type: literal$1("object"),
309322
310203
  properties: record(string(), PrimitiveSchemaDefinitionSchema),
309323
310204
  required: array(string()).optional()
309324
310205
  }).catchall(unknown())
309325
310206
  });
309326
310207
  ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
309327
- mode: literal("url"),
310208
+ mode: literal$1("url"),
309328
310209
  message: string(),
309329
310210
  elicitationId: string(),
309330
310211
  url: string().url()
309331
310212
  });
309332
310213
  ElicitRequestParamsSchema = union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
309333
310214
  ElicitRequestSchema = RequestSchema.extend({
309334
- method: literal("elicitation/create"),
310215
+ method: literal$1("elicitation/create"),
309335
310216
  params: ElicitRequestParamsSchema
309336
310217
  });
309337
310218
  ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({ elicitationId: string() });
309338
310219
  ElicitationCompleteNotificationSchema = NotificationSchema.extend({
309339
- method: literal("notifications/elicitation/complete"),
310220
+ method: literal$1("notifications/elicitation/complete"),
309340
310221
  params: ElicitationCompleteNotificationParamsSchema
309341
310222
  });
309342
310223
  ElicitResultSchema = ResultSchema.extend({
@@ -309353,11 +310234,11 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309353
310234
  ])).optional())
309354
310235
  });
309355
310236
  ResourceTemplateReferenceSchema = object$1({
309356
- type: literal("ref/resource"),
310237
+ type: literal$1("ref/resource"),
309357
310238
  uri: string()
309358
310239
  });
309359
310240
  PromptReferenceSchema = object$1({
309360
- type: literal("ref/prompt"),
310241
+ type: literal$1("ref/prompt"),
309361
310242
  name: string()
309362
310243
  });
309363
310244
  CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
@@ -309369,7 +310250,7 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309369
310250
  context: object$1({ arguments: record(string(), string()).optional() }).optional()
309370
310251
  });
309371
310252
  CompleteRequestSchema = RequestSchema.extend({
309372
- method: literal("completion/complete"),
310253
+ method: literal$1("completion/complete"),
309373
310254
  params: CompleteRequestParamsSchema
309374
310255
  });
309375
310256
  CompleteResultSchema = ResultSchema.extend({ completion: looseObject({
@@ -309383,12 +310264,12 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309383
310264
  _meta: record(string(), unknown()).optional()
309384
310265
  });
309385
310266
  ListRootsRequestSchema = RequestSchema.extend({
309386
- method: literal("roots/list"),
310267
+ method: literal$1("roots/list"),
309387
310268
  params: BaseRequestParamsSchema.optional()
309388
310269
  });
309389
310270
  ListRootsResultSchema = ResultSchema.extend({ roots: array(RootSchema) });
309390
310271
  RootsListChangedNotificationSchema = NotificationSchema.extend({
309391
- method: literal("notifications/roots/list_changed"),
310272
+ method: literal$1("notifications/roots/list_changed"),
309392
310273
  params: NotificationsParamsSchema.optional()
309393
310274
  });
309394
310275
  TaskCreationParamsSchema = looseObject({
@@ -309414,23 +310295,23 @@ var init_schemas_DscsoNZN = __esmMin((() => {
309414
310295
  CreateTaskResultSchema = ResultSchema.extend({ task: TaskSchema });
309415
310296
  TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
309416
310297
  TaskStatusNotificationSchema = NotificationSchema.extend({
309417
- method: literal("notifications/tasks/status"),
310298
+ method: literal$1("notifications/tasks/status"),
309418
310299
  params: TaskStatusNotificationParamsSchema
309419
310300
  });
309420
310301
  GetTaskRequestSchema = RequestSchema.extend({
309421
- method: literal("tasks/get"),
310302
+ method: literal$1("tasks/get"),
309422
310303
  params: BaseRequestParamsSchema.extend({ taskId: string() })
309423
310304
  });
309424
310305
  GetTaskResultSchema = ResultSchema.merge(TaskSchema);
309425
310306
  GetTaskPayloadRequestSchema = RequestSchema.extend({
309426
- method: literal("tasks/result"),
310307
+ method: literal$1("tasks/result"),
309427
310308
  params: BaseRequestParamsSchema.extend({ taskId: string() })
309428
310309
  });
309429
310310
  GetTaskPayloadResultSchema = ResultSchema.loose();
309430
- ListTasksRequestSchema = PaginatedRequestSchema.extend({ method: literal("tasks/list") });
310311
+ ListTasksRequestSchema = PaginatedRequestSchema.extend({ method: literal$1("tasks/list") });
309431
310312
  ListTasksResultSchema = PaginatedResultSchema.extend({ tasks: array(TaskSchema) });
309432
310313
  CancelTaskRequestSchema = RequestSchema.extend({
309433
- method: literal("tasks/cancel"),
310314
+ method: literal$1("tasks/cancel"),
309434
310315
  params: BaseRequestParamsSchema.extend({ taskId: string() })
309435
310316
  });
309436
310317
  CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
@@ -309607,7 +310488,7 @@ var init_auth_UMQCo_ad = __esmMin((() => {
309607
310488
  issuer: string().optional().catch(void 0)
309608
310489
  }).strip();
309609
310490
  IdJagTokenExchangeResponseSchema = object$1({
309610
- issued_token_type: literal("urn:ietf:params:oauth:token-type:id-jag"),
310491
+ issued_token_type: literal$1("urn:ietf:params:oauth:token-type:id-jag"),
309611
310492
  access_token: string(),
309612
310493
  token_type: string().optional(),
309613
310494
  expires_in: number$1().optional(),
@@ -309618,7 +310499,7 @@ var init_auth_UMQCo_ad = __esmMin((() => {
309618
310499
  error_description: string().optional(),
309619
310500
  error_uri: string().optional()
309620
310501
  });
309621
- OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literal("").transform(() => void 0));
310502
+ OptionalSafeUrlSchema = SafeUrlSchema.optional().or(literal$1("").transform(() => void 0));
309622
310503
  OAuthClientMetadataSchema = object$1({
309623
310504
  redirect_uris: array(SafeUrlSchema),
309624
310505
  token_endpoint_auth_method: string().optional(),
@@ -309891,7 +310772,7 @@ function build$1$1() {
309891
310772
  * A client MUST NOT attempt to cancel its {@linkcode InitializeRequest | initialize} request.
309892
310773
  */
309893
310774
  const CancelledNotificationSchema$1 = NotificationSchema$1.extend({
309894
- method: literal("notifications/cancelled"),
310775
+ method: literal$1("notifications/cancelled"),
309895
310776
  params: CancelledNotificationParamsSchema$1
309896
310777
  });
309897
310778
  /**
@@ -309979,7 +310860,7 @@ function build$1$1() {
309979
310860
  * This request is sent from the client to the server when it first connects, asking it to begin initialization.
309980
310861
  */
309981
310862
  const InitializeRequestSchema$1 = RequestSchema$1.extend({
309982
- method: literal("initialize"),
310863
+ method: literal$1("initialize"),
309983
310864
  params: InitializeRequestParamsSchema$1
309984
310865
  });
309985
310866
  /**
@@ -310011,14 +310892,14 @@ function build$1$1() {
310011
310892
  * This notification is sent from the client to the server after initialization has finished.
310012
310893
  */
310013
310894
  const InitializedNotificationSchema$1 = NotificationSchema$1.extend({
310014
- method: literal("notifications/initialized"),
310895
+ method: literal$1("notifications/initialized"),
310015
310896
  params: NotificationsParamsSchema$1.optional()
310016
310897
  });
310017
310898
  /**
310018
310899
  * 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.
310019
310900
  */
310020
310901
  const PingRequestSchema$1 = RequestSchema$1.extend({
310021
- method: literal("ping"),
310902
+ method: literal$1("ping"),
310022
310903
  params: BaseRequestParamsSchema$1.optional()
310023
310904
  });
310024
310905
  const ProgressSchema$1 = object$1({
@@ -310037,7 +310918,7 @@ function build$1$1() {
310037
310918
  * @category notifications/progress
310038
310919
  */
310039
310920
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
310040
- method: literal("notifications/progress"),
310921
+ method: literal$1("notifications/progress"),
310041
310922
  params: ProgressNotificationParamsSchema$1
310042
310923
  });
310043
310924
  const PaginatedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ cursor: CursorSchema$1.optional() });
@@ -310106,7 +310987,7 @@ function build$1$1() {
310106
310987
  /**
310107
310988
  * Sent from the client to request a list of resources the server has.
310108
310989
  */
310109
- const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/list") });
310990
+ const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/list") });
310110
310991
  /**
310111
310992
  * The server's response to a {@linkcode ListResourcesRequest | resources/list} request from the client.
310112
310993
  */
@@ -310114,7 +310995,7 @@ function build$1$1() {
310114
310995
  /**
310115
310996
  * Sent from the client to request a list of resource templates the server has.
310116
310997
  */
310117
- const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/templates/list") });
310998
+ const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/templates/list") });
310118
310999
  /**
310119
311000
  * The server's response to a {@linkcode ListResourceTemplatesRequest | resources/templates/list} request from the client.
310120
311001
  */
@@ -310128,7 +311009,7 @@ function build$1$1() {
310128
311009
  * Sent from the client to the server, to read a specific resource URI.
310129
311010
  */
310130
311011
  const ReadResourceRequestSchema$1 = RequestSchema$1.extend({
310131
- method: literal("resources/read"),
311012
+ method: literal$1("resources/read"),
310132
311013
  params: ReadResourceRequestParamsSchema$1
310133
311014
  });
310134
311015
  /**
@@ -310139,7 +311020,7 @@ function build$1$1() {
310139
311020
  * 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.
310140
311021
  */
310141
311022
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310142
- method: literal("notifications/resources/list_changed"),
311023
+ method: literal$1("notifications/resources/list_changed"),
310143
311024
  params: NotificationsParamsSchema$1.optional()
310144
311025
  });
310145
311026
  const SubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -310147,7 +311028,7 @@ function build$1$1() {
310147
311028
  * Sent from the client to request `resources/updated` notifications from the server whenever a particular resource changes.
310148
311029
  */
310149
311030
  const SubscribeRequestSchema$1 = RequestSchema$1.extend({
310150
- method: literal("resources/subscribe"),
311031
+ method: literal$1("resources/subscribe"),
310151
311032
  params: SubscribeRequestParamsSchema$1
310152
311033
  });
310153
311034
  const UnsubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -310155,7 +311036,7 @@ function build$1$1() {
310155
311036
  * 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.
310156
311037
  */
310157
311038
  const UnsubscribeRequestSchema$1 = RequestSchema$1.extend({
310158
- method: literal("resources/unsubscribe"),
311039
+ method: literal$1("resources/unsubscribe"),
310159
311040
  params: UnsubscribeRequestParamsSchema$1
310160
311041
  });
310161
311042
  /**
@@ -310166,7 +311047,7 @@ function build$1$1() {
310166
311047
  * 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.
310167
311048
  */
310168
311049
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
310169
- method: literal("notifications/resources/updated"),
311050
+ method: literal$1("notifications/resources/updated"),
310170
311051
  params: ResourceUpdatedNotificationParamsSchema$1
310171
311052
  });
310172
311053
  /**
@@ -310190,7 +311071,7 @@ function build$1$1() {
310190
311071
  /**
310191
311072
  * Sent from the client to request a list of prompts and prompt templates the server has.
310192
311073
  */
310193
- const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("prompts/list") });
311074
+ const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("prompts/list") });
310194
311075
  /**
310195
311076
  * The server's response to a {@linkcode ListPromptsRequest | prompts/list} request from the client.
310196
311077
  */
@@ -310206,14 +311087,14 @@ function build$1$1() {
310206
311087
  * Used by the client to get a prompt provided by the server.
310207
311088
  */
310208
311089
  const GetPromptRequestSchema$1 = RequestSchema$1.extend({
310209
- method: literal("prompts/get"),
311090
+ method: literal$1("prompts/get"),
310210
311091
  params: GetPromptRequestParamsSchema$1
310211
311092
  });
310212
311093
  /**
310213
311094
  * Text provided to or from an LLM.
310214
311095
  */
310215
311096
  const TextContentSchema$1 = object$1({
310216
- type: literal("text"),
311097
+ type: literal$1("text"),
310217
311098
  text: string(),
310218
311099
  annotations: AnnotationsSchema$1.optional(),
310219
311100
  _meta: record(string(), unknown()).optional()
@@ -310222,7 +311103,7 @@ function build$1$1() {
310222
311103
  * An image provided to or from an LLM.
310223
311104
  */
310224
311105
  const ImageContentSchema$1 = object$1({
310225
- type: literal("image"),
311106
+ type: literal$1("image"),
310226
311107
  data: Base64Schema,
310227
311108
  mimeType: string(),
310228
311109
  annotations: AnnotationsSchema$1.optional(),
@@ -310232,7 +311113,7 @@ function build$1$1() {
310232
311113
  * Audio content provided to or from an LLM.
310233
311114
  */
310234
311115
  const AudioContentSchema$1 = object$1({
310235
- type: literal("audio"),
311116
+ type: literal$1("audio"),
310236
311117
  data: Base64Schema,
310237
311118
  mimeType: string(),
310238
311119
  annotations: AnnotationsSchema$1.optional(),
@@ -310247,7 +311128,7 @@ function build$1$1() {
310247
311128
  * provider APIs directly.
310248
311129
  */
310249
311130
  const ToolUseContentSchema$1 = object$1({
310250
- type: literal("tool_use"),
311131
+ type: literal$1("tool_use"),
310251
311132
  name: string(),
310252
311133
  id: string(),
310253
311134
  input: record(string(), unknown()),
@@ -310257,7 +311138,7 @@ function build$1$1() {
310257
311138
  * The contents of a resource, embedded into a prompt or tool call result.
310258
311139
  */
310259
311140
  const EmbeddedResourceSchema$1 = object$1({
310260
- type: literal("resource"),
311141
+ type: literal$1("resource"),
310261
311142
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
310262
311143
  annotations: AnnotationsSchema$1.optional(),
310263
311144
  _meta: record(string(), unknown()).optional()
@@ -310267,7 +311148,7 @@ function build$1$1() {
310267
311148
  *
310268
311149
  * Note: resource links returned by tools are not guaranteed to appear in the results of {@linkcode ListResourcesRequest | resources/list} requests.
310269
311150
  */
310270
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
311151
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
310271
311152
  /**
310272
311153
  * A content block that can be used in prompts and tool results.
310273
311154
  */
@@ -310296,7 +311177,7 @@ function build$1$1() {
310296
311177
  * 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.
310297
311178
  */
310298
311179
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310299
- method: literal("notifications/prompts/list_changed"),
311180
+ method: literal$1("notifications/prompts/list_changed"),
310300
311181
  params: NotificationsParamsSchema$1.optional()
310301
311182
  });
310302
311183
  /**
@@ -310332,12 +311213,12 @@ function build$1$1() {
310332
311213
  ...IconsSchema$1.shape,
310333
311214
  description: string().optional(),
310334
311215
  inputSchema: object$1({
310335
- type: literal("object"),
311216
+ type: literal$1("object"),
310336
311217
  properties: record(string(), JSONValueSchema$1).optional(),
310337
311218
  required: array(string()).optional()
310338
311219
  }).catchall(unknown()),
310339
311220
  outputSchema: object$1({
310340
- type: literal("object"),
311221
+ type: literal$1("object"),
310341
311222
  properties: record(string(), JSONValueSchema$1).optional(),
310342
311223
  required: array(string()).optional()
310343
311224
  }).catchall(unknown()).optional(),
@@ -310348,7 +311229,7 @@ function build$1$1() {
310348
311229
  /**
310349
311230
  * Sent from the client to request a list of tools the server has.
310350
311231
  */
310351
- const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tools/list") });
311232
+ const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tools/list") });
310352
311233
  /**
310353
311234
  * The server's response to a {@linkcode ListToolsRequest | tools/list} request from the client.
310354
311235
  */
@@ -310372,14 +311253,14 @@ function build$1$1() {
310372
311253
  * Used by the client to invoke a tool provided by the server.
310373
311254
  */
310374
311255
  const CallToolRequestSchema$1 = RequestSchema$1.extend({
310375
- method: literal("tools/call"),
311256
+ method: literal$1("tools/call"),
310376
311257
  params: CallToolRequestParamsSchema$1
310377
311258
  });
310378
311259
  /**
310379
311260
  * 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.
310380
311261
  */
310381
311262
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310382
- method: literal("notifications/tools/list_changed"),
311263
+ method: literal$1("notifications/tools/list_changed"),
310383
311264
  params: NotificationsParamsSchema$1.optional()
310384
311265
  });
310385
311266
  /**
@@ -310415,7 +311296,7 @@ function build$1$1() {
310415
311296
  * (STDIO servers) or OpenTelemetry.
310416
311297
  */
310417
311298
  const SetLevelRequestSchema$1 = RequestSchema$1.extend({
310418
- method: literal("logging/setLevel"),
311299
+ method: literal$1("logging/setLevel"),
310419
311300
  params: SetLevelRequestParamsSchema$1
310420
311301
  });
310421
311302
  /**
@@ -310438,7 +311319,7 @@ function build$1$1() {
310438
311319
  * (STDIO servers) or OpenTelemetry.
310439
311320
  */
310440
311321
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
310441
- method: literal("notifications/message"),
311322
+ method: literal$1("notifications/message"),
310442
311323
  params: LoggingMessageNotificationParamsSchema$1
310443
311324
  });
310444
311325
  /**
@@ -310483,7 +311364,7 @@ function build$1$1() {
310483
311364
  * provider APIs directly.
310484
311365
  */
310485
311366
  const ToolResultContentSchema$1 = object$1({
310486
- type: literal("tool_result"),
311367
+ type: literal$1("tool_result"),
310487
311368
  toolUseId: string().describe("The unique identifier for the corresponding tool call."),
310488
311369
  content: array(ContentBlockSchema$1),
310489
311370
  structuredContent: object$1({}).loose().optional(),
@@ -310561,7 +311442,7 @@ function build$1$1() {
310561
311442
  * provider APIs directly.
310562
311443
  */
310563
311444
  const CreateMessageRequestSchema$1 = RequestSchema$1.extend({
310564
- method: literal("sampling/createMessage"),
311445
+ method: literal$1("sampling/createMessage"),
310565
311446
  params: CreateMessageRequestParamsSchema$1
310566
311447
  });
310567
311448
  /**
@@ -310606,7 +311487,7 @@ function build$1$1() {
310606
311487
  * Primitive schema definition for boolean fields.
310607
311488
  */
310608
311489
  const BooleanSchemaSchema$1 = object$1({
310609
- type: literal("boolean"),
311490
+ type: literal$1("boolean"),
310610
311491
  title: string().optional(),
310611
311492
  description: string().optional(),
310612
311493
  default: boolean().optional()
@@ -310615,7 +311496,7 @@ function build$1$1() {
310615
311496
  * Primitive schema definition for string fields.
310616
311497
  */
310617
311498
  const StringSchemaSchema$1 = object$1({
310618
- type: literal("string"),
311499
+ type: literal$1("string"),
310619
311500
  title: string().optional(),
310620
311501
  description: string().optional(),
310621
311502
  minLength: number$1().optional(),
@@ -310643,7 +311524,7 @@ function build$1$1() {
310643
311524
  * Schema for single-selection enumeration without display titles for options.
310644
311525
  */
310645
311526
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
310646
- type: literal("string"),
311527
+ type: literal$1("string"),
310647
311528
  title: string().optional(),
310648
311529
  description: string().optional(),
310649
311530
  enum: array(string()),
@@ -310653,7 +311534,7 @@ function build$1$1() {
310653
311534
  * Schema for single-selection enumeration with display titles for each option.
310654
311535
  */
310655
311536
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
310656
- type: literal("string"),
311537
+ type: literal$1("string"),
310657
311538
  title: string().optional(),
310658
311539
  description: string().optional(),
310659
311540
  oneOf: array(object$1({
@@ -310667,7 +311548,7 @@ function build$1$1() {
310667
311548
  * This interface will be removed in a future version.
310668
311549
  */
310669
311550
  const LegacyTitledEnumSchemaSchema$1 = object$1({
310670
- type: literal("string"),
311551
+ type: literal$1("string"),
310671
311552
  title: string().optional(),
310672
311553
  description: string().optional(),
310673
311554
  enum: array(string()),
@@ -310679,13 +311560,13 @@ function build$1$1() {
310679
311560
  * Schema for multiple-selection enumeration without display titles for options.
310680
311561
  */
310681
311562
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
310682
- type: literal("array"),
311563
+ type: literal$1("array"),
310683
311564
  title: string().optional(),
310684
311565
  description: string().optional(),
310685
311566
  minItems: number$1().optional(),
310686
311567
  maxItems: number$1().optional(),
310687
311568
  items: object$1({
310688
- type: literal("string"),
311569
+ type: literal$1("string"),
310689
311570
  enum: array(string())
310690
311571
  }),
310691
311572
  default: array(string()).optional()
@@ -310694,7 +311575,7 @@ function build$1$1() {
310694
311575
  * Schema for multiple-selection enumeration with display titles for each option.
310695
311576
  */
310696
311577
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
310697
- type: literal("array"),
311578
+ type: literal$1("array"),
310698
311579
  title: string().optional(),
310699
311580
  description: string().optional(),
310700
311581
  minItems: number$1().optional(),
@@ -310730,10 +311611,10 @@ function build$1$1() {
310730
311611
  * Parameters for an `elicitation/create` request for form-based elicitation.
310731
311612
  */
310732
311613
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
310733
- mode: literal("form").optional(),
311614
+ mode: literal$1("form").optional(),
310734
311615
  message: string(),
310735
311616
  requestedSchema: object$1({
310736
- type: literal("object"),
311617
+ type: literal$1("object"),
310737
311618
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
310738
311619
  required: array(string()).optional()
310739
311620
  }).catchall(unknown())
@@ -310742,7 +311623,7 @@ function build$1$1() {
310742
311623
  * Parameters for an {@linkcode ElicitRequest | elicitation/create} request for URL-based elicitation.
310743
311624
  */
310744
311625
  const ElicitRequestURLParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
310745
- mode: literal("url"),
311626
+ mode: literal$1("url"),
310746
311627
  message: string(),
310747
311628
  elicitationId: string(),
310748
311629
  url: string().url()
@@ -310757,7 +311638,7 @@ function build$1$1() {
310757
311638
  * or navigate to a URL (URL mode).
310758
311639
  */
310759
311640
  const ElicitRequestSchema$1 = RequestSchema$1.extend({
310760
- method: literal("elicitation/create"),
311641
+ method: literal$1("elicitation/create"),
310761
311642
  params: ElicitRequestParamsSchema$1
310762
311643
  });
310763
311644
  /**
@@ -310772,7 +311653,7 @@ function build$1$1() {
310772
311653
  * @category notifications/elicitation/complete
310773
311654
  */
310774
311655
  const ElicitationCompleteNotificationSchema$1 = NotificationSchema$1.extend({
310775
- method: literal("notifications/elicitation/complete"),
311656
+ method: literal$1("notifications/elicitation/complete"),
310776
311657
  params: ElicitationCompleteNotificationParamsSchema$1
310777
311658
  });
310778
311659
  /**
@@ -310795,14 +311676,14 @@ function build$1$1() {
310795
311676
  * A reference to a resource or resource template definition.
310796
311677
  */
310797
311678
  const ResourceTemplateReferenceSchema$1 = object$1({
310798
- type: literal("ref/resource"),
311679
+ type: literal$1("ref/resource"),
310799
311680
  uri: string()
310800
311681
  });
310801
311682
  /**
310802
311683
  * Identifies a prompt.
310803
311684
  */
310804
311685
  const PromptReferenceSchema$1 = object$1({
310805
- type: literal("ref/prompt"),
311686
+ type: literal$1("ref/prompt"),
310806
311687
  name: string()
310807
311688
  });
310808
311689
  /**
@@ -310820,7 +311701,7 @@ function build$1$1() {
310820
311701
  * A request from the client to the server, to ask for completion options.
310821
311702
  */
310822
311703
  const CompleteRequestSchema$1 = RequestSchema$1.extend({
310823
- method: literal("completion/complete"),
311704
+ method: literal$1("completion/complete"),
310824
311705
  params: CompleteRequestParamsSchema$1
310825
311706
  });
310826
311707
  /**
@@ -310851,7 +311732,7 @@ function build$1$1() {
310851
311732
  * tool parameters, resource URIs, or configuration.
310852
311733
  */
310853
311734
  const ListRootsRequestSchema$1 = RequestSchema$1.extend({
310854
- method: literal("roots/list"),
311735
+ method: literal$1("roots/list"),
310855
311736
  params: BaseRequestParamsSchema$1.optional()
310856
311737
  });
310857
311738
  /**
@@ -310870,7 +311751,7 @@ function build$1$1() {
310870
311751
  * tool parameters, resource URIs, or configuration.
310871
311752
  */
310872
311753
  const RootsListChangedNotificationSchema$1 = NotificationSchema$1.extend({
310873
- method: literal("notifications/roots/list_changed"),
311754
+ method: literal$1("notifications/roots/list_changed"),
310874
311755
  params: NotificationsParamsSchema$1.optional()
310875
311756
  });
310876
311757
  /**
@@ -310926,7 +311807,7 @@ function build$1$1() {
310926
311807
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310927
311808
  */
310928
311809
  const TaskStatusNotificationSchema$1 = NotificationSchema$1.extend({
310929
- method: literal("notifications/tasks/status"),
311810
+ method: literal$1("notifications/tasks/status"),
310930
311811
  params: TaskStatusNotificationParamsSchema$1
310931
311812
  });
310932
311813
  /**
@@ -310935,7 +311816,7 @@ function build$1$1() {
310935
311816
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310936
311817
  */
310937
311818
  const GetTaskRequestSchema$1 = RequestSchema$1.extend({
310938
- method: literal("tasks/get"),
311819
+ method: literal$1("tasks/get"),
310939
311820
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
310940
311821
  });
310941
311822
  /**
@@ -310950,7 +311831,7 @@ function build$1$1() {
310950
311831
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310951
311832
  */
310952
311833
  const GetTaskPayloadRequestSchema$1 = RequestSchema$1.extend({
310953
- method: literal("tasks/result"),
311834
+ method: literal$1("tasks/result"),
310954
311835
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
310955
311836
  });
310956
311837
  /**
@@ -310967,7 +311848,7 @@ function build$1$1() {
310967
311848
  *
310968
311849
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310969
311850
  */
310970
- const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tasks/list") });
311851
+ const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tasks/list") });
310971
311852
  /**
310972
311853
  * The response to a {@linkcode ListTasksRequest | tasks/list} request.
310973
311854
  *
@@ -310980,7 +311861,7 @@ function build$1$1() {
310980
311861
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
310981
311862
  */
310982
311863
  const CancelTaskRequestSchema$1 = RequestSchema$1.extend({
310983
- method: literal("tasks/cancel"),
311864
+ method: literal$1("tasks/cancel"),
310984
311865
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
310985
311866
  });
310986
311867
  return {
@@ -311598,7 +312479,7 @@ function build$2() {
311598
312479
  progressToken: ProgressTokenSchema$1
311599
312480
  });
311600
312481
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
311601
- method: literal("notifications/progress"),
312482
+ method: literal$1("notifications/progress"),
311602
312483
  params: ProgressNotificationParamsSchema$1
311603
312484
  });
311604
312485
  const LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({
@@ -311607,7 +312488,7 @@ function build$2() {
311607
312488
  data: unknown()
311608
312489
  });
311609
312490
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
311610
- method: literal("notifications/message"),
312491
+ method: literal$1("notifications/message"),
311611
312492
  params: LoggingMessageNotificationParamsSchema$1
311612
312493
  });
311613
312494
  const ResourceContentsSchema$1 = object$1({
@@ -311642,12 +312523,12 @@ function build$2() {
311642
312523
  _meta: optional(looseObject({}))
311643
312524
  });
311644
312525
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
311645
- method: literal("notifications/resources/list_changed"),
312526
+ method: literal$1("notifications/resources/list_changed"),
311646
312527
  params: NotificationsParamsSchema$1.optional()
311647
312528
  });
311648
312529
  const ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: string() });
311649
312530
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
311650
- method: literal("notifications/resources/updated"),
312531
+ method: literal$1("notifications/resources/updated"),
311651
312532
  params: ResourceUpdatedNotificationParamsSchema$1
311652
312533
  });
311653
312534
  const PromptArgumentSchema$1 = object$1({
@@ -311663,43 +312544,43 @@ function build$2() {
311663
312544
  _meta: optional(looseObject({}))
311664
312545
  });
311665
312546
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
311666
- method: literal("notifications/prompts/list_changed"),
312547
+ method: literal$1("notifications/prompts/list_changed"),
311667
312548
  params: NotificationsParamsSchema$1.optional()
311668
312549
  });
311669
312550
  const TextContentSchema$1 = object$1({
311670
- type: literal("text"),
312551
+ type: literal$1("text"),
311671
312552
  text: string(),
311672
312553
  annotations: AnnotationsSchema$1.optional(),
311673
312554
  _meta: record(string(), unknown()).optional()
311674
312555
  });
311675
312556
  const ImageContentSchema$1 = object$1({
311676
- type: literal("image"),
312557
+ type: literal$1("image"),
311677
312558
  data: Base64Schema,
311678
312559
  mimeType: string(),
311679
312560
  annotations: AnnotationsSchema$1.optional(),
311680
312561
  _meta: record(string(), unknown()).optional()
311681
312562
  });
311682
312563
  const AudioContentSchema$1 = object$1({
311683
- type: literal("audio"),
312564
+ type: literal$1("audio"),
311684
312565
  data: Base64Schema,
311685
312566
  mimeType: string(),
311686
312567
  annotations: AnnotationsSchema$1.optional(),
311687
312568
  _meta: record(string(), unknown()).optional()
311688
312569
  });
311689
312570
  const ToolUseContentSchema$1 = object$1({
311690
- type: literal("tool_use"),
312571
+ type: literal$1("tool_use"),
311691
312572
  name: string(),
311692
312573
  id: string(),
311693
312574
  input: record(string(), unknown()),
311694
312575
  _meta: record(string(), unknown()).optional()
311695
312576
  });
311696
312577
  const EmbeddedResourceSchema$1 = object$1({
311697
- type: literal("resource"),
312578
+ type: literal$1("resource"),
311698
312579
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
311699
312580
  annotations: AnnotationsSchema$1.optional(),
311700
312581
  _meta: record(string(), unknown()).optional()
311701
312582
  });
311702
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
312583
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
311703
312584
  const ContentBlockSchema$1 = union([
311704
312585
  TextContentSchema$1,
311705
312586
  ImageContentSchema$1,
@@ -311719,7 +312600,7 @@ function build$2() {
311719
312600
  openWorldHint: boolean().optional()
311720
312601
  });
311721
312602
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
311722
- method: literal("notifications/tools/list_changed"),
312603
+ method: literal$1("notifications/tools/list_changed"),
311723
312604
  params: NotificationsParamsSchema$1.optional()
311724
312605
  });
311725
312606
  const ModelHintSchema$1 = object$1({ name: string().optional() });
@@ -311735,13 +312616,13 @@ function build$2() {
311735
312616
  "none"
311736
312617
  ]).optional() });
311737
312618
  const BooleanSchemaSchema$1 = object$1({
311738
- type: literal("boolean"),
312619
+ type: literal$1("boolean"),
311739
312620
  title: string().optional(),
311740
312621
  description: string().optional(),
311741
312622
  default: boolean().optional()
311742
312623
  });
311743
312624
  const StringSchemaSchema$1 = object$1({
311744
- type: literal("string"),
312625
+ type: literal$1("string"),
311745
312626
  title: string().optional(),
311746
312627
  description: string().optional(),
311747
312628
  minLength: number$1().optional(),
@@ -311763,14 +312644,14 @@ function build$2() {
311763
312644
  default: number$1().optional()
311764
312645
  });
311765
312646
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
311766
- type: literal("string"),
312647
+ type: literal$1("string"),
311767
312648
  title: string().optional(),
311768
312649
  description: string().optional(),
311769
312650
  enum: array(string()),
311770
312651
  default: string().optional()
311771
312652
  });
311772
312653
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
311773
- type: literal("string"),
312654
+ type: literal$1("string"),
311774
312655
  title: string().optional(),
311775
312656
  description: string().optional(),
311776
312657
  oneOf: array(object$1({
@@ -311780,7 +312661,7 @@ function build$2() {
311780
312661
  default: string().optional()
311781
312662
  });
311782
312663
  const LegacyTitledEnumSchemaSchema$1 = object$1({
311783
- type: literal("string"),
312664
+ type: literal$1("string"),
311784
312665
  title: string().optional(),
311785
312666
  description: string().optional(),
311786
312667
  enum: array(string()),
@@ -311789,19 +312670,19 @@ function build$2() {
311789
312670
  });
311790
312671
  const SingleSelectEnumSchemaSchema$1 = union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);
311791
312672
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
311792
- type: literal("array"),
312673
+ type: literal$1("array"),
311793
312674
  title: string().optional(),
311794
312675
  description: string().optional(),
311795
312676
  minItems: number$1().optional(),
311796
312677
  maxItems: number$1().optional(),
311797
312678
  items: object$1({
311798
- type: literal("string"),
312679
+ type: literal$1("string"),
311799
312680
  enum: array(string())
311800
312681
  }),
311801
312682
  default: array(string()).optional()
311802
312683
  });
311803
312684
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
311804
- type: literal("array"),
312685
+ type: literal$1("array"),
311805
312686
  title: string().optional(),
311806
312687
  description: string().optional(),
311807
312688
  minItems: number$1().optional(),
@@ -311825,20 +312706,20 @@ function build$2() {
311825
312706
  NumberSchemaSchema$1
311826
312707
  ]);
311827
312708
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
311828
- mode: literal("form").optional(),
312709
+ mode: literal$1("form").optional(),
311829
312710
  message: string(),
311830
312711
  requestedSchema: object$1({
311831
- type: literal("object"),
312712
+ type: literal$1("object"),
311832
312713
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
311833
312714
  required: array(string()).optional()
311834
312715
  }).catchall(unknown())
311835
312716
  });
311836
312717
  const ResourceTemplateReferenceSchema$1 = object$1({
311837
- type: literal("ref/resource"),
312718
+ type: literal$1("ref/resource"),
311838
312719
  uri: string()
311839
312720
  });
311840
312721
  const PromptReferenceSchema$1 = object$1({
311841
- type: literal("ref/prompt"),
312722
+ type: literal$1("ref/prompt"),
311842
312723
  name: string()
311843
312724
  });
311844
312725
  const RootSchema$1 = object$1({
@@ -311889,7 +312770,7 @@ function build$2() {
311889
312770
  description: string().optional(),
311890
312771
  inputSchema: looseObject({
311891
312772
  $schema: string().optional(),
311892
- type: literal("object")
312773
+ type: literal$1("object")
311893
312774
  }),
311894
312775
  outputSchema: looseObject({ $schema: string().optional() }).optional(),
311895
312776
  annotations: ToolAnnotationsSchema$1.optional(),
@@ -311897,7 +312778,7 @@ function build$2() {
311897
312778
  });
311898
312779
  /** 2026-era ToolResultContent (anchor-exact: `structuredContent?: unknown`). */
311899
312780
  const ToolResultContentSchema$1 = object$1({
311900
- type: literal("tool_result"),
312781
+ type: literal$1("tool_result"),
311901
312782
  toolUseId: string(),
311902
312783
  content: array(ContentBlockSchema$1),
311903
312784
  structuredContent: unknown().optional(),
@@ -312010,7 +312891,7 @@ function build$2() {
312010
312891
  });
312011
312892
  /** 2026-era embedded sampling request (de-JSON-RPC'd). */
312012
312893
  const CreateMessageRequestSchema$1 = object$1({
312013
- method: literal("sampling/createMessage"),
312894
+ method: literal$1("sampling/createMessage"),
312014
312895
  params: CreateMessageRequestParamsSchema$1
312015
312896
  });
312016
312897
  /**
@@ -312019,7 +312900,7 @@ function build$2() {
312019
312900
  * the anchor declares a bare optional `_meta` on `params`.
312020
312901
  */
312021
312902
  const ListRootsRequestSchema$1 = object$1({
312022
- method: literal("roots/list"),
312903
+ method: literal$1("roots/list"),
312023
312904
  params: object$1({ _meta: record(string(), unknown()).optional() }).optional()
312024
312905
  });
312025
312906
  /** 2026-era embedded sampling response (anchor-exact: extends the forked SamplingMessage). */
@@ -312051,7 +312932,7 @@ function build$2() {
312051
312932
  * frozen 2025-11-25 revision.
312052
312933
  */
312053
312934
  const ElicitRequestURLParamsSchema$1 = object$1({
312054
- mode: literal("url"),
312935
+ mode: literal$1("url"),
312055
312936
  message: string(),
312056
312937
  url: string().url()
312057
312938
  });
@@ -312059,7 +312940,7 @@ function build$2() {
312059
312940
  const ElicitRequestParamsSchema$1 = union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);
312060
312941
  /** 2026-era embedded elicitation request (de-JSON-RPC'd; see the URL-mode fork above). */
312061
312942
  const ElicitRequestSchema$1 = object$1({
312062
- method: literal("elicitation/create"),
312943
+ method: literal$1("elicitation/create"),
312063
312944
  params: ElicitRequestParamsSchema$1
312064
312945
  });
312065
312946
  /** A single embedded input request (one of the three demoted server→client requests). */
@@ -312101,7 +312982,7 @@ function build$2() {
312101
312982
  const DispatchRequestMetaSchema = looseObject({ progressToken: ProgressTokenSchema$1.optional() });
312102
312983
  function wireRequest(method, paramsShape) {
312103
312984
  return object$1({
312104
- method: literal(method),
312985
+ method: literal$1(method),
312105
312986
  params: object$1({
312106
312987
  _meta: RequestMetaEnvelopeSchema,
312107
312988
  ...paramsShape
@@ -312110,7 +312991,7 @@ function build$2() {
312110
312991
  }
312111
312992
  function dispatchRequest(method, paramsShape) {
312112
312993
  return object$1({
312113
- method: literal(method),
312994
+ method: literal$1(method),
312114
312995
  params: object$1({
312115
312996
  _meta: DispatchRequestMetaSchema.optional(),
312116
312997
  ...paramsShape
@@ -312258,7 +313139,7 @@ function build$2() {
312258
313139
  const NotificationMetaSchema = looseObject({ "io.modelcontextprotocol/subscriptionId": RequestIdSchema$1.optional() });
312259
313140
  /** Anchor SubscriptionsAcknowledgedNotification (2026-only). */
312260
313141
  const SubscriptionsAcknowledgedNotificationSchema$1 = object$1({
312261
- method: literal("notifications/subscriptions/acknowledged"),
313142
+ method: literal$1("notifications/subscriptions/acknowledged"),
312262
313143
  params: object$1({
312263
313144
  _meta: NotificationMetaSchema.optional(),
312264
313145
  notifications: SubscriptionFilterSchema$1
@@ -312278,7 +313159,7 @@ function build$2() {
312278
313159
  });
312279
313160
  /** 2026-era `notifications/cancelled` (see the params fork above). */
312280
313161
  const CancelledNotificationSchema$1 = object$1({
312281
- method: literal("notifications/cancelled"),
313162
+ method: literal$1("notifications/cancelled"),
312282
313163
  params: CancelledNotificationParamsSchema$1
312283
313164
  });
312284
313165
  const notificationSchemas2026 = {
@@ -312292,7 +313173,7 @@ function build$2() {
312292
313173
  "notifications/subscriptions/acknowledged": SubscriptionsAcknowledgedNotificationSchema$1
312293
313174
  };
312294
313175
  const wireResultResponse = (result) => object$1({
312295
- jsonrpc: literal("2.0"),
313176
+ jsonrpc: literal$1("2.0"),
312296
313177
  id: union([string(), number$1().int()]),
312297
313178
  result
312298
313179
  }).strict();
@@ -312575,15 +313456,15 @@ function inputSchemaMaps$1() {
312575
313456
  maps$2 = {
312576
313457
  request: {
312577
313458
  "elicitation/create": object$1({
312578
- method: literal("elicitation/create"),
313459
+ method: literal$1("elicitation/create"),
312579
313460
  params: s.ElicitRequestParamsSchema
312580
313461
  }),
312581
313462
  "sampling/createMessage": object$1({
312582
- method: literal("sampling/createMessage"),
313463
+ method: literal$1("sampling/createMessage"),
312583
313464
  params: s.CreateMessageRequestParamsSchema
312584
313465
  }),
312585
313466
  "roots/list": object$1({
312586
- method: literal("roots/list"),
313467
+ method: literal$1("roots/list"),
312587
313468
  params: looseObject({}).optional()
312588
313469
  })
312589
313470
  },
@@ -564035,7 +564916,7 @@ function build$1() {
564035
564916
  * A client MUST NOT attempt to cancel its {@linkcode InitializeRequest | initialize} request.
564036
564917
  */
564037
564918
  const CancelledNotificationSchema$1 = NotificationSchema$1.extend({
564038
- method: literal("notifications/cancelled"),
564919
+ method: literal$1("notifications/cancelled"),
564039
564920
  params: CancelledNotificationParamsSchema$1
564040
564921
  });
564041
564922
  /**
@@ -564123,7 +565004,7 @@ function build$1() {
564123
565004
  * This request is sent from the client to the server when it first connects, asking it to begin initialization.
564124
565005
  */
564125
565006
  const InitializeRequestSchema$1 = RequestSchema$1.extend({
564126
- method: literal("initialize"),
565007
+ method: literal$1("initialize"),
564127
565008
  params: InitializeRequestParamsSchema$1
564128
565009
  });
564129
565010
  /**
@@ -564155,14 +565036,14 @@ function build$1() {
564155
565036
  * This notification is sent from the client to the server after initialization has finished.
564156
565037
  */
564157
565038
  const InitializedNotificationSchema$1 = NotificationSchema$1.extend({
564158
- method: literal("notifications/initialized"),
565039
+ method: literal$1("notifications/initialized"),
564159
565040
  params: NotificationsParamsSchema$1.optional()
564160
565041
  });
564161
565042
  /**
564162
565043
  * 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.
564163
565044
  */
564164
565045
  const PingRequestSchema$1 = RequestSchema$1.extend({
564165
- method: literal("ping"),
565046
+ method: literal$1("ping"),
564166
565047
  params: BaseRequestParamsSchema$1.optional()
564167
565048
  });
564168
565049
  const ProgressSchema$1 = object$1({
@@ -564181,7 +565062,7 @@ function build$1() {
564181
565062
  * @category notifications/progress
564182
565063
  */
564183
565064
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
564184
- method: literal("notifications/progress"),
565065
+ method: literal$1("notifications/progress"),
564185
565066
  params: ProgressNotificationParamsSchema$1
564186
565067
  });
564187
565068
  const PaginatedRequestParamsSchema$1 = BaseRequestParamsSchema$1.extend({ cursor: CursorSchema$1.optional() });
@@ -564250,7 +565131,7 @@ function build$1() {
564250
565131
  /**
564251
565132
  * Sent from the client to request a list of resources the server has.
564252
565133
  */
564253
- const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/list") });
565134
+ const ListResourcesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/list") });
564254
565135
  /**
564255
565136
  * The server's response to a {@linkcode ListResourcesRequest | resources/list} request from the client.
564256
565137
  */
@@ -564258,7 +565139,7 @@ function build$1() {
564258
565139
  /**
564259
565140
  * Sent from the client to request a list of resource templates the server has.
564260
565141
  */
564261
- const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("resources/templates/list") });
565142
+ const ListResourceTemplatesRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("resources/templates/list") });
564262
565143
  /**
564263
565144
  * The server's response to a {@linkcode ListResourceTemplatesRequest | resources/templates/list} request from the client.
564264
565145
  */
@@ -564272,7 +565153,7 @@ function build$1() {
564272
565153
  * Sent from the client to the server, to read a specific resource URI.
564273
565154
  */
564274
565155
  const ReadResourceRequestSchema$1 = RequestSchema$1.extend({
564275
- method: literal("resources/read"),
565156
+ method: literal$1("resources/read"),
564276
565157
  params: ReadResourceRequestParamsSchema$1
564277
565158
  });
564278
565159
  /**
@@ -564283,7 +565164,7 @@ function build$1() {
564283
565164
  * 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.
564284
565165
  */
564285
565166
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
564286
- method: literal("notifications/resources/list_changed"),
565167
+ method: literal$1("notifications/resources/list_changed"),
564287
565168
  params: NotificationsParamsSchema$1.optional()
564288
565169
  });
564289
565170
  const SubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -564291,7 +565172,7 @@ function build$1() {
564291
565172
  * Sent from the client to request `resources/updated` notifications from the server whenever a particular resource changes.
564292
565173
  */
564293
565174
  const SubscribeRequestSchema$1 = RequestSchema$1.extend({
564294
- method: literal("resources/subscribe"),
565175
+ method: literal$1("resources/subscribe"),
564295
565176
  params: SubscribeRequestParamsSchema$1
564296
565177
  });
564297
565178
  const UnsubscribeRequestParamsSchema$1 = ResourceRequestParamsSchema$1;
@@ -564299,7 +565180,7 @@ function build$1() {
564299
565180
  * 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.
564300
565181
  */
564301
565182
  const UnsubscribeRequestSchema$1 = RequestSchema$1.extend({
564302
- method: literal("resources/unsubscribe"),
565183
+ method: literal$1("resources/unsubscribe"),
564303
565184
  params: UnsubscribeRequestParamsSchema$1
564304
565185
  });
564305
565186
  /**
@@ -564310,7 +565191,7 @@ function build$1() {
564310
565191
  * 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.
564311
565192
  */
564312
565193
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
564313
- method: literal("notifications/resources/updated"),
565194
+ method: literal$1("notifications/resources/updated"),
564314
565195
  params: ResourceUpdatedNotificationParamsSchema$1
564315
565196
  });
564316
565197
  /**
@@ -564334,7 +565215,7 @@ function build$1() {
564334
565215
  /**
564335
565216
  * Sent from the client to request a list of prompts and prompt templates the server has.
564336
565217
  */
564337
- const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("prompts/list") });
565218
+ const ListPromptsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("prompts/list") });
564338
565219
  /**
564339
565220
  * The server's response to a {@linkcode ListPromptsRequest | prompts/list} request from the client.
564340
565221
  */
@@ -564350,14 +565231,14 @@ function build$1() {
564350
565231
  * Used by the client to get a prompt provided by the server.
564351
565232
  */
564352
565233
  const GetPromptRequestSchema$1 = RequestSchema$1.extend({
564353
- method: literal("prompts/get"),
565234
+ method: literal$1("prompts/get"),
564354
565235
  params: GetPromptRequestParamsSchema$1
564355
565236
  });
564356
565237
  /**
564357
565238
  * Text provided to or from an LLM.
564358
565239
  */
564359
565240
  const TextContentSchema$1 = object$1({
564360
- type: literal("text"),
565241
+ type: literal$1("text"),
564361
565242
  text: string(),
564362
565243
  annotations: AnnotationsSchema$1.optional(),
564363
565244
  _meta: record(string(), unknown()).optional()
@@ -564366,7 +565247,7 @@ function build$1() {
564366
565247
  * An image provided to or from an LLM.
564367
565248
  */
564368
565249
  const ImageContentSchema$1 = object$1({
564369
- type: literal("image"),
565250
+ type: literal$1("image"),
564370
565251
  data: Base64Schema,
564371
565252
  mimeType: string(),
564372
565253
  annotations: AnnotationsSchema$1.optional(),
@@ -564376,7 +565257,7 @@ function build$1() {
564376
565257
  * Audio content provided to or from an LLM.
564377
565258
  */
564378
565259
  const AudioContentSchema$1 = object$1({
564379
- type: literal("audio"),
565260
+ type: literal$1("audio"),
564380
565261
  data: Base64Schema,
564381
565262
  mimeType: string(),
564382
565263
  annotations: AnnotationsSchema$1.optional(),
@@ -564391,7 +565272,7 @@ function build$1() {
564391
565272
  * provider APIs directly.
564392
565273
  */
564393
565274
  const ToolUseContentSchema$1 = object$1({
564394
- type: literal("tool_use"),
565275
+ type: literal$1("tool_use"),
564395
565276
  name: string(),
564396
565277
  id: string(),
564397
565278
  input: record(string(), unknown()),
@@ -564401,7 +565282,7 @@ function build$1() {
564401
565282
  * The contents of a resource, embedded into a prompt or tool call result.
564402
565283
  */
564403
565284
  const EmbeddedResourceSchema$1 = object$1({
564404
- type: literal("resource"),
565285
+ type: literal$1("resource"),
564405
565286
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
564406
565287
  annotations: AnnotationsSchema$1.optional(),
564407
565288
  _meta: record(string(), unknown()).optional()
@@ -564411,7 +565292,7 @@ function build$1() {
564411
565292
  *
564412
565293
  * Note: resource links returned by tools are not guaranteed to appear in the results of {@linkcode ListResourcesRequest | resources/list} requests.
564413
565294
  */
564414
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
565295
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
564415
565296
  /**
564416
565297
  * A content block that can be used in prompts and tool results.
564417
565298
  */
@@ -564440,7 +565321,7 @@ function build$1() {
564440
565321
  * 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.
564441
565322
  */
564442
565323
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
564443
- method: literal("notifications/prompts/list_changed"),
565324
+ method: literal$1("notifications/prompts/list_changed"),
564444
565325
  params: NotificationsParamsSchema$1.optional()
564445
565326
  });
564446
565327
  /**
@@ -564476,12 +565357,12 @@ function build$1() {
564476
565357
  ...IconsSchema$1.shape,
564477
565358
  description: string().optional(),
564478
565359
  inputSchema: object$1({
564479
- type: literal("object"),
565360
+ type: literal$1("object"),
564480
565361
  properties: record(string(), JSONValueSchema$1).optional(),
564481
565362
  required: array(string()).optional()
564482
565363
  }).catchall(unknown()),
564483
565364
  outputSchema: object$1({
564484
- type: literal("object"),
565365
+ type: literal$1("object"),
564485
565366
  properties: record(string(), JSONValueSchema$1).optional(),
564486
565367
  required: array(string()).optional()
564487
565368
  }).catchall(unknown()).optional(),
@@ -564492,7 +565373,7 @@ function build$1() {
564492
565373
  /**
564493
565374
  * Sent from the client to request a list of tools the server has.
564494
565375
  */
564495
- const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tools/list") });
565376
+ const ListToolsRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tools/list") });
564496
565377
  /**
564497
565378
  * The server's response to a {@linkcode ListToolsRequest | tools/list} request from the client.
564498
565379
  */
@@ -564516,14 +565397,14 @@ function build$1() {
564516
565397
  * Used by the client to invoke a tool provided by the server.
564517
565398
  */
564518
565399
  const CallToolRequestSchema$1 = RequestSchema$1.extend({
564519
- method: literal("tools/call"),
565400
+ method: literal$1("tools/call"),
564520
565401
  params: CallToolRequestParamsSchema$1
564521
565402
  });
564522
565403
  /**
564523
565404
  * 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.
564524
565405
  */
564525
565406
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
564526
- method: literal("notifications/tools/list_changed"),
565407
+ method: literal$1("notifications/tools/list_changed"),
564527
565408
  params: NotificationsParamsSchema$1.optional()
564528
565409
  });
564529
565410
  /**
@@ -564559,7 +565440,7 @@ function build$1() {
564559
565440
  * (STDIO servers) or OpenTelemetry.
564560
565441
  */
564561
565442
  const SetLevelRequestSchema$1 = RequestSchema$1.extend({
564562
- method: literal("logging/setLevel"),
565443
+ method: literal$1("logging/setLevel"),
564563
565444
  params: SetLevelRequestParamsSchema$1
564564
565445
  });
564565
565446
  /**
@@ -564582,7 +565463,7 @@ function build$1() {
564582
565463
  * (STDIO servers) or OpenTelemetry.
564583
565464
  */
564584
565465
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
564585
- method: literal("notifications/message"),
565466
+ method: literal$1("notifications/message"),
564586
565467
  params: LoggingMessageNotificationParamsSchema$1
564587
565468
  });
564588
565469
  /**
@@ -564627,7 +565508,7 @@ function build$1() {
564627
565508
  * provider APIs directly.
564628
565509
  */
564629
565510
  const ToolResultContentSchema$1 = object$1({
564630
- type: literal("tool_result"),
565511
+ type: literal$1("tool_result"),
564631
565512
  toolUseId: string().describe("The unique identifier for the corresponding tool call."),
564632
565513
  content: array(ContentBlockSchema$1),
564633
565514
  structuredContent: object$1({}).loose().optional(),
@@ -564705,7 +565586,7 @@ function build$1() {
564705
565586
  * provider APIs directly.
564706
565587
  */
564707
565588
  const CreateMessageRequestSchema$1 = RequestSchema$1.extend({
564708
- method: literal("sampling/createMessage"),
565589
+ method: literal$1("sampling/createMessage"),
564709
565590
  params: CreateMessageRequestParamsSchema$1
564710
565591
  });
564711
565592
  /**
@@ -564750,7 +565631,7 @@ function build$1() {
564750
565631
  * Primitive schema definition for boolean fields.
564751
565632
  */
564752
565633
  const BooleanSchemaSchema$1 = object$1({
564753
- type: literal("boolean"),
565634
+ type: literal$1("boolean"),
564754
565635
  title: string().optional(),
564755
565636
  description: string().optional(),
564756
565637
  default: boolean().optional()
@@ -564759,7 +565640,7 @@ function build$1() {
564759
565640
  * Primitive schema definition for string fields.
564760
565641
  */
564761
565642
  const StringSchemaSchema$1 = object$1({
564762
- type: literal("string"),
565643
+ type: literal$1("string"),
564763
565644
  title: string().optional(),
564764
565645
  description: string().optional(),
564765
565646
  minLength: number$1().optional(),
@@ -564787,7 +565668,7 @@ function build$1() {
564787
565668
  * Schema for single-selection enumeration without display titles for options.
564788
565669
  */
564789
565670
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
564790
- type: literal("string"),
565671
+ type: literal$1("string"),
564791
565672
  title: string().optional(),
564792
565673
  description: string().optional(),
564793
565674
  enum: array(string()),
@@ -564797,7 +565678,7 @@ function build$1() {
564797
565678
  * Schema for single-selection enumeration with display titles for each option.
564798
565679
  */
564799
565680
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
564800
- type: literal("string"),
565681
+ type: literal$1("string"),
564801
565682
  title: string().optional(),
564802
565683
  description: string().optional(),
564803
565684
  oneOf: array(object$1({
@@ -564811,7 +565692,7 @@ function build$1() {
564811
565692
  * This interface will be removed in a future version.
564812
565693
  */
564813
565694
  const LegacyTitledEnumSchemaSchema$1 = object$1({
564814
- type: literal("string"),
565695
+ type: literal$1("string"),
564815
565696
  title: string().optional(),
564816
565697
  description: string().optional(),
564817
565698
  enum: array(string()),
@@ -564823,13 +565704,13 @@ function build$1() {
564823
565704
  * Schema for multiple-selection enumeration without display titles for options.
564824
565705
  */
564825
565706
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
564826
- type: literal("array"),
565707
+ type: literal$1("array"),
564827
565708
  title: string().optional(),
564828
565709
  description: string().optional(),
564829
565710
  minItems: number$1().optional(),
564830
565711
  maxItems: number$1().optional(),
564831
565712
  items: object$1({
564832
- type: literal("string"),
565713
+ type: literal$1("string"),
564833
565714
  enum: array(string())
564834
565715
  }),
564835
565716
  default: array(string()).optional()
@@ -564838,7 +565719,7 @@ function build$1() {
564838
565719
  * Schema for multiple-selection enumeration with display titles for each option.
564839
565720
  */
564840
565721
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
564841
- type: literal("array"),
565722
+ type: literal$1("array"),
564842
565723
  title: string().optional(),
564843
565724
  description: string().optional(),
564844
565725
  minItems: number$1().optional(),
@@ -564874,10 +565755,10 @@ function build$1() {
564874
565755
  * Parameters for an `elicitation/create` request for form-based elicitation.
564875
565756
  */
564876
565757
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
564877
- mode: literal("form").optional(),
565758
+ mode: literal$1("form").optional(),
564878
565759
  message: string(),
564879
565760
  requestedSchema: object$1({
564880
- type: literal("object"),
565761
+ type: literal$1("object"),
564881
565762
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
564882
565763
  required: array(string()).optional()
564883
565764
  }).catchall(unknown())
@@ -564886,7 +565767,7 @@ function build$1() {
564886
565767
  * Parameters for an {@linkcode ElicitRequest | elicitation/create} request for URL-based elicitation.
564887
565768
  */
564888
565769
  const ElicitRequestURLParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
564889
- mode: literal("url"),
565770
+ mode: literal$1("url"),
564890
565771
  message: string(),
564891
565772
  elicitationId: string(),
564892
565773
  url: string().url()
@@ -564901,7 +565782,7 @@ function build$1() {
564901
565782
  * or navigate to a URL (URL mode).
564902
565783
  */
564903
565784
  const ElicitRequestSchema$1 = RequestSchema$1.extend({
564904
- method: literal("elicitation/create"),
565785
+ method: literal$1("elicitation/create"),
564905
565786
  params: ElicitRequestParamsSchema$1
564906
565787
  });
564907
565788
  /**
@@ -564916,7 +565797,7 @@ function build$1() {
564916
565797
  * @category notifications/elicitation/complete
564917
565798
  */
564918
565799
  const ElicitationCompleteNotificationSchema$1 = NotificationSchema$1.extend({
564919
- method: literal("notifications/elicitation/complete"),
565800
+ method: literal$1("notifications/elicitation/complete"),
564920
565801
  params: ElicitationCompleteNotificationParamsSchema$1
564921
565802
  });
564922
565803
  /**
@@ -564939,14 +565820,14 @@ function build$1() {
564939
565820
  * A reference to a resource or resource template definition.
564940
565821
  */
564941
565822
  const ResourceTemplateReferenceSchema$1 = object$1({
564942
- type: literal("ref/resource"),
565823
+ type: literal$1("ref/resource"),
564943
565824
  uri: string()
564944
565825
  });
564945
565826
  /**
564946
565827
  * Identifies a prompt.
564947
565828
  */
564948
565829
  const PromptReferenceSchema$1 = object$1({
564949
- type: literal("ref/prompt"),
565830
+ type: literal$1("ref/prompt"),
564950
565831
  name: string()
564951
565832
  });
564952
565833
  /**
@@ -564964,7 +565845,7 @@ function build$1() {
564964
565845
  * A request from the client to the server, to ask for completion options.
564965
565846
  */
564966
565847
  const CompleteRequestSchema$1 = RequestSchema$1.extend({
564967
- method: literal("completion/complete"),
565848
+ method: literal$1("completion/complete"),
564968
565849
  params: CompleteRequestParamsSchema$1
564969
565850
  });
564970
565851
  /**
@@ -564995,7 +565876,7 @@ function build$1() {
564995
565876
  * tool parameters, resource URIs, or configuration.
564996
565877
  */
564997
565878
  const ListRootsRequestSchema$1 = RequestSchema$1.extend({
564998
- method: literal("roots/list"),
565879
+ method: literal$1("roots/list"),
564999
565880
  params: BaseRequestParamsSchema$1.optional()
565000
565881
  });
565001
565882
  /**
@@ -565014,7 +565895,7 @@ function build$1() {
565014
565895
  * tool parameters, resource URIs, or configuration.
565015
565896
  */
565016
565897
  const RootsListChangedNotificationSchema$1 = NotificationSchema$1.extend({
565017
- method: literal("notifications/roots/list_changed"),
565898
+ method: literal$1("notifications/roots/list_changed"),
565018
565899
  params: NotificationsParamsSchema$1.optional()
565019
565900
  });
565020
565901
  /**
@@ -565070,7 +565951,7 @@ function build$1() {
565070
565951
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565071
565952
  */
565072
565953
  const TaskStatusNotificationSchema$1 = NotificationSchema$1.extend({
565073
- method: literal("notifications/tasks/status"),
565954
+ method: literal$1("notifications/tasks/status"),
565074
565955
  params: TaskStatusNotificationParamsSchema$1
565075
565956
  });
565076
565957
  /**
@@ -565079,7 +565960,7 @@ function build$1() {
565079
565960
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565080
565961
  */
565081
565962
  const GetTaskRequestSchema$1 = RequestSchema$1.extend({
565082
- method: literal("tasks/get"),
565963
+ method: literal$1("tasks/get"),
565083
565964
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
565084
565965
  });
565085
565966
  /**
@@ -565094,7 +565975,7 @@ function build$1() {
565094
565975
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565095
565976
  */
565096
565977
  const GetTaskPayloadRequestSchema$1 = RequestSchema$1.extend({
565097
- method: literal("tasks/result"),
565978
+ method: literal$1("tasks/result"),
565098
565979
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
565099
565980
  });
565100
565981
  /**
@@ -565111,7 +565992,7 @@ function build$1() {
565111
565992
  *
565112
565993
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565113
565994
  */
565114
- const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal("tasks/list") });
565995
+ const ListTasksRequestSchema$1 = PaginatedRequestSchema$1.extend({ method: literal$1("tasks/list") });
565115
565996
  /**
565116
565997
  * The response to a {@linkcode ListTasksRequest | tasks/list} request.
565117
565998
  *
@@ -565124,7 +566005,7 @@ function build$1() {
565124
566005
  * @deprecated 2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
565125
566006
  */
565126
566007
  const CancelTaskRequestSchema$1 = RequestSchema$1.extend({
565127
- method: literal("tasks/cancel"),
566008
+ method: literal$1("tasks/cancel"),
565128
566009
  params: BaseRequestParamsSchema$1.extend({ taskId: string() })
565129
566010
  });
565130
566011
  return {
@@ -565878,7 +566759,7 @@ function build() {
565878
566759
  progressToken: ProgressTokenSchema$1
565879
566760
  });
565880
566761
  const ProgressNotificationSchema$1 = NotificationSchema$1.extend({
565881
- method: literal("notifications/progress"),
566762
+ method: literal$1("notifications/progress"),
565882
566763
  params: ProgressNotificationParamsSchema$1
565883
566764
  });
565884
566765
  const LoggingMessageNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({
@@ -565887,7 +566768,7 @@ function build() {
565887
566768
  data: unknown()
565888
566769
  });
565889
566770
  const LoggingMessageNotificationSchema$1 = NotificationSchema$1.extend({
565890
- method: literal("notifications/message"),
566771
+ method: literal$1("notifications/message"),
565891
566772
  params: LoggingMessageNotificationParamsSchema$1
565892
566773
  });
565893
566774
  const ResourceContentsSchema$1 = object$1({
@@ -565922,12 +566803,12 @@ function build() {
565922
566803
  _meta: optional(looseObject({}))
565923
566804
  });
565924
566805
  const ResourceListChangedNotificationSchema$1 = NotificationSchema$1.extend({
565925
- method: literal("notifications/resources/list_changed"),
566806
+ method: literal$1("notifications/resources/list_changed"),
565926
566807
  params: NotificationsParamsSchema$1.optional()
565927
566808
  });
565928
566809
  const ResourceUpdatedNotificationParamsSchema$1 = NotificationsParamsSchema$1.extend({ uri: string() });
565929
566810
  const ResourceUpdatedNotificationSchema$1 = NotificationSchema$1.extend({
565930
- method: literal("notifications/resources/updated"),
566811
+ method: literal$1("notifications/resources/updated"),
565931
566812
  params: ResourceUpdatedNotificationParamsSchema$1
565932
566813
  });
565933
566814
  const PromptArgumentSchema$1 = object$1({
@@ -565943,43 +566824,43 @@ function build() {
565943
566824
  _meta: optional(looseObject({}))
565944
566825
  });
565945
566826
  const PromptListChangedNotificationSchema$1 = NotificationSchema$1.extend({
565946
- method: literal("notifications/prompts/list_changed"),
566827
+ method: literal$1("notifications/prompts/list_changed"),
565947
566828
  params: NotificationsParamsSchema$1.optional()
565948
566829
  });
565949
566830
  const TextContentSchema$1 = object$1({
565950
- type: literal("text"),
566831
+ type: literal$1("text"),
565951
566832
  text: string(),
565952
566833
  annotations: AnnotationsSchema$1.optional(),
565953
566834
  _meta: record(string(), unknown()).optional()
565954
566835
  });
565955
566836
  const ImageContentSchema$1 = object$1({
565956
- type: literal("image"),
566837
+ type: literal$1("image"),
565957
566838
  data: Base64Schema,
565958
566839
  mimeType: string(),
565959
566840
  annotations: AnnotationsSchema$1.optional(),
565960
566841
  _meta: record(string(), unknown()).optional()
565961
566842
  });
565962
566843
  const AudioContentSchema$1 = object$1({
565963
- type: literal("audio"),
566844
+ type: literal$1("audio"),
565964
566845
  data: Base64Schema,
565965
566846
  mimeType: string(),
565966
566847
  annotations: AnnotationsSchema$1.optional(),
565967
566848
  _meta: record(string(), unknown()).optional()
565968
566849
  });
565969
566850
  const ToolUseContentSchema$1 = object$1({
565970
- type: literal("tool_use"),
566851
+ type: literal$1("tool_use"),
565971
566852
  name: string(),
565972
566853
  id: string(),
565973
566854
  input: record(string(), unknown()),
565974
566855
  _meta: record(string(), unknown()).optional()
565975
566856
  });
565976
566857
  const EmbeddedResourceSchema$1 = object$1({
565977
- type: literal("resource"),
566858
+ type: literal$1("resource"),
565978
566859
  resource: union([TextResourceContentsSchema$1, BlobResourceContentsSchema$1]),
565979
566860
  annotations: AnnotationsSchema$1.optional(),
565980
566861
  _meta: record(string(), unknown()).optional()
565981
566862
  });
565982
- const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal("resource_link") });
566863
+ const ResourceLinkSchema$1 = ResourceSchema$1.extend({ type: literal$1("resource_link") });
565983
566864
  const ContentBlockSchema$1 = union([
565984
566865
  TextContentSchema$1,
565985
566866
  ImageContentSchema$1,
@@ -565999,7 +566880,7 @@ function build() {
565999
566880
  openWorldHint: boolean().optional()
566000
566881
  });
566001
566882
  const ToolListChangedNotificationSchema$1 = NotificationSchema$1.extend({
566002
- method: literal("notifications/tools/list_changed"),
566883
+ method: literal$1("notifications/tools/list_changed"),
566003
566884
  params: NotificationsParamsSchema$1.optional()
566004
566885
  });
566005
566886
  const ModelHintSchema$1 = object$1({ name: string().optional() });
@@ -566015,13 +566896,13 @@ function build() {
566015
566896
  "none"
566016
566897
  ]).optional() });
566017
566898
  const BooleanSchemaSchema$1 = object$1({
566018
- type: literal("boolean"),
566899
+ type: literal$1("boolean"),
566019
566900
  title: string().optional(),
566020
566901
  description: string().optional(),
566021
566902
  default: boolean().optional()
566022
566903
  });
566023
566904
  const StringSchemaSchema$1 = object$1({
566024
- type: literal("string"),
566905
+ type: literal$1("string"),
566025
566906
  title: string().optional(),
566026
566907
  description: string().optional(),
566027
566908
  minLength: number$1().optional(),
@@ -566043,14 +566924,14 @@ function build() {
566043
566924
  default: number$1().optional()
566044
566925
  });
566045
566926
  const UntitledSingleSelectEnumSchemaSchema$1 = object$1({
566046
- type: literal("string"),
566927
+ type: literal$1("string"),
566047
566928
  title: string().optional(),
566048
566929
  description: string().optional(),
566049
566930
  enum: array(string()),
566050
566931
  default: string().optional()
566051
566932
  });
566052
566933
  const TitledSingleSelectEnumSchemaSchema$1 = object$1({
566053
- type: literal("string"),
566934
+ type: literal$1("string"),
566054
566935
  title: string().optional(),
566055
566936
  description: string().optional(),
566056
566937
  oneOf: array(object$1({
@@ -566060,7 +566941,7 @@ function build() {
566060
566941
  default: string().optional()
566061
566942
  });
566062
566943
  const LegacyTitledEnumSchemaSchema$1 = object$1({
566063
- type: literal("string"),
566944
+ type: literal$1("string"),
566064
566945
  title: string().optional(),
566065
566946
  description: string().optional(),
566066
566947
  enum: array(string()),
@@ -566069,19 +566950,19 @@ function build() {
566069
566950
  });
566070
566951
  const SingleSelectEnumSchemaSchema$1 = union([UntitledSingleSelectEnumSchemaSchema$1, TitledSingleSelectEnumSchemaSchema$1]);
566071
566952
  const UntitledMultiSelectEnumSchemaSchema$1 = object$1({
566072
- type: literal("array"),
566953
+ type: literal$1("array"),
566073
566954
  title: string().optional(),
566074
566955
  description: string().optional(),
566075
566956
  minItems: number$1().optional(),
566076
566957
  maxItems: number$1().optional(),
566077
566958
  items: object$1({
566078
- type: literal("string"),
566959
+ type: literal$1("string"),
566079
566960
  enum: array(string())
566080
566961
  }),
566081
566962
  default: array(string()).optional()
566082
566963
  });
566083
566964
  const TitledMultiSelectEnumSchemaSchema$1 = object$1({
566084
- type: literal("array"),
566965
+ type: literal$1("array"),
566085
566966
  title: string().optional(),
566086
566967
  description: string().optional(),
566087
566968
  minItems: number$1().optional(),
@@ -566105,20 +566986,20 @@ function build() {
566105
566986
  NumberSchemaSchema$1
566106
566987
  ]);
566107
566988
  const ElicitRequestFormParamsSchema$1 = TaskAugmentedRequestParamsSchema$1.extend({
566108
- mode: literal("form").optional(),
566989
+ mode: literal$1("form").optional(),
566109
566990
  message: string(),
566110
566991
  requestedSchema: object$1({
566111
- type: literal("object"),
566992
+ type: literal$1("object"),
566112
566993
  properties: record(string(), PrimitiveSchemaDefinitionSchema$1),
566113
566994
  required: array(string()).optional()
566114
566995
  }).catchall(unknown())
566115
566996
  });
566116
566997
  const ResourceTemplateReferenceSchema$1 = object$1({
566117
- type: literal("ref/resource"),
566998
+ type: literal$1("ref/resource"),
566118
566999
  uri: string()
566119
567000
  });
566120
567001
  const PromptReferenceSchema$1 = object$1({
566121
- type: literal("ref/prompt"),
567002
+ type: literal$1("ref/prompt"),
566122
567003
  name: string()
566123
567004
  });
566124
567005
  const RootSchema$1 = object$1({
@@ -566169,7 +567050,7 @@ function build() {
566169
567050
  description: string().optional(),
566170
567051
  inputSchema: looseObject({
566171
567052
  $schema: string().optional(),
566172
- type: literal("object")
567053
+ type: literal$1("object")
566173
567054
  }),
566174
567055
  outputSchema: looseObject({ $schema: string().optional() }).optional(),
566175
567056
  annotations: ToolAnnotationsSchema$1.optional(),
@@ -566177,7 +567058,7 @@ function build() {
566177
567058
  });
566178
567059
  /** 2026-era ToolResultContent (anchor-exact: `structuredContent?: unknown`). */
566179
567060
  const ToolResultContentSchema$1 = object$1({
566180
- type: literal("tool_result"),
567061
+ type: literal$1("tool_result"),
566181
567062
  toolUseId: string(),
566182
567063
  content: array(ContentBlockSchema$1),
566183
567064
  structuredContent: unknown().optional(),
@@ -566290,7 +567171,7 @@ function build() {
566290
567171
  });
566291
567172
  /** 2026-era embedded sampling request (de-JSON-RPC'd). */
566292
567173
  const CreateMessageRequestSchema$1 = object$1({
566293
- method: literal("sampling/createMessage"),
567174
+ method: literal$1("sampling/createMessage"),
566294
567175
  params: CreateMessageRequestParamsSchema$1
566295
567176
  });
566296
567177
  /**
@@ -566299,7 +567180,7 @@ function build() {
566299
567180
  * the anchor declares a bare optional `_meta` on `params`.
566300
567181
  */
566301
567182
  const ListRootsRequestSchema$1 = object$1({
566302
- method: literal("roots/list"),
567183
+ method: literal$1("roots/list"),
566303
567184
  params: object$1({ _meta: record(string(), unknown()).optional() }).optional()
566304
567185
  });
566305
567186
  /** 2026-era embedded sampling response (anchor-exact: extends the forked SamplingMessage). */
@@ -566331,7 +567212,7 @@ function build() {
566331
567212
  * frozen 2025-11-25 revision.
566332
567213
  */
566333
567214
  const ElicitRequestURLParamsSchema$1 = object$1({
566334
- mode: literal("url"),
567215
+ mode: literal$1("url"),
566335
567216
  message: string(),
566336
567217
  url: string().url()
566337
567218
  });
@@ -566339,7 +567220,7 @@ function build() {
566339
567220
  const ElicitRequestParamsSchema$1 = union([ElicitRequestFormParamsSchema$1, ElicitRequestURLParamsSchema$1]);
566340
567221
  /** 2026-era embedded elicitation request (de-JSON-RPC'd; see the URL-mode fork above). */
566341
567222
  const ElicitRequestSchema$1 = object$1({
566342
- method: literal("elicitation/create"),
567223
+ method: literal$1("elicitation/create"),
566343
567224
  params: ElicitRequestParamsSchema$1
566344
567225
  });
566345
567226
  /** A single embedded input request (one of the three demoted server→client requests). */
@@ -566381,7 +567262,7 @@ function build() {
566381
567262
  const DispatchRequestMetaSchema = looseObject({ progressToken: ProgressTokenSchema$1.optional() });
566382
567263
  function wireRequest(method, paramsShape) {
566383
567264
  return object$1({
566384
- method: literal(method),
567265
+ method: literal$1(method),
566385
567266
  params: object$1({
566386
567267
  _meta: RequestMetaEnvelopeSchema,
566387
567268
  ...paramsShape
@@ -566390,7 +567271,7 @@ function build() {
566390
567271
  }
566391
567272
  function dispatchRequest(method, paramsShape) {
566392
567273
  return object$1({
566393
- method: literal(method),
567274
+ method: literal$1(method),
566394
567275
  params: object$1({
566395
567276
  _meta: DispatchRequestMetaSchema.optional(),
566396
567277
  ...paramsShape
@@ -566538,7 +567419,7 @@ function build() {
566538
567419
  const NotificationMetaSchema = looseObject({ "io.modelcontextprotocol/subscriptionId": RequestIdSchema$1.optional() });
566539
567420
  /** Anchor SubscriptionsAcknowledgedNotification (2026-only). */
566540
567421
  const SubscriptionsAcknowledgedNotificationSchema$1 = object$1({
566541
- method: literal("notifications/subscriptions/acknowledged"),
567422
+ method: literal$1("notifications/subscriptions/acknowledged"),
566542
567423
  params: object$1({
566543
567424
  _meta: NotificationMetaSchema.optional(),
566544
567425
  notifications: SubscriptionFilterSchema$1
@@ -566558,7 +567439,7 @@ function build() {
566558
567439
  });
566559
567440
  /** 2026-era `notifications/cancelled` (see the params fork above). */
566560
567441
  const CancelledNotificationSchema$1 = object$1({
566561
- method: literal("notifications/cancelled"),
567442
+ method: literal$1("notifications/cancelled"),
566562
567443
  params: CancelledNotificationParamsSchema$1
566563
567444
  });
566564
567445
  const notificationSchemas2026 = {
@@ -566572,7 +567453,7 @@ function build() {
566572
567453
  "notifications/subscriptions/acknowledged": SubscriptionsAcknowledgedNotificationSchema$1
566573
567454
  };
566574
567455
  const wireResultResponse = (result) => object$1({
566575
- jsonrpc: literal("2.0"),
567456
+ jsonrpc: literal$1("2.0"),
566576
567457
  id: union([string(), number$1().int()]),
566577
567458
  result
566578
567459
  }).strict();
@@ -567151,15 +568032,15 @@ function inputSchemaMaps() {
567151
568032
  maps = {
567152
568033
  request: {
567153
568034
  "elicitation/create": object$1({
567154
- method: literal("elicitation/create"),
568035
+ method: literal$1("elicitation/create"),
567155
568036
  params: s.ElicitRequestParamsSchema
567156
568037
  }),
567157
568038
  "sampling/createMessage": object$1({
567158
- method: literal("sampling/createMessage"),
568039
+ method: literal$1("sampling/createMessage"),
567159
568040
  params: s.CreateMessageRequestParamsSchema
567160
568041
  }),
567161
568042
  "roots/list": object$1({
567162
- method: literal("roots/list"),
568043
+ method: literal$1("roots/list"),
567163
568044
  params: looseObject({}).optional()
567164
568045
  })
567165
568046
  },
@@ -592317,8 +593198,89 @@ function registerWidgetCommand(program) {
592317
593198
 
592318
593199
  //#endregion
592319
593200
  //#region src/commands/work.ts
593201
+ const requireOperationId = (options) => {
593202
+ const operationId = options.operation ?? process.env.LOBEHUB_OPERATION_ID;
593203
+ 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)");
593204
+ return operationId;
593205
+ };
593206
+ /**
593207
+ * Upload a produced file as the run's own output. The `tool-result` source
593208
+ * keeps it out of the resource library, and is the source an operation token
593209
+ * may write.
593210
+ */
593211
+ const uploadWorkFile = async (client, filePath) => {
593212
+ const absolutePath = path.resolve(filePath);
593213
+ return {
593214
+ absolutePath,
593215
+ fileId: (await uploadLocalFile(client, absolutePath, { source: "tool-result" })).id
593216
+ };
593217
+ };
593218
+ const printWork = (work, options, verb) => {
593219
+ if (options.json) outputJson(work);
593220
+ else console.log(`${verb} Work ${work.id}: ${work.title}`);
593221
+ };
592320
593222
  function registerWorkCommand(program) {
592321
- 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) => {
593223
+ const work = program.command("work").description("Register the files and links this agent produced as Works, or look them up");
593224
+ work.command("create").description([
593225
+ "Register a file or link this agent produced as a Work card under its reply.",
593226
+ "Pass exactly one of --file or --url. Creating the same file path or link again in",
593227
+ "this conversation adds a new version. GitHub and Linear links are registered",
593228
+ "automatically when you create or edit them; do not pass them here."
593229
+ ].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) => {
593230
+ if (Boolean(options.file) === Boolean(options.url)) throw new Error("Pass exactly one of --file or --url");
593231
+ if (options.url && !options.title) throw new Error("--title is required with --url");
593232
+ const operationId = requireOperationId(options);
593233
+ const client = await getTrpcClient();
593234
+ const text = {
593235
+ description: options.description,
593236
+ operationId,
593237
+ title: options.title
593238
+ };
593239
+ let created;
593240
+ if (options.url) created = await client.work.createAgentWork.mutate({
593241
+ ...text,
593242
+ title: options.title,
593243
+ type: "link",
593244
+ url: options.url
593245
+ });
593246
+ else {
593247
+ const { absolutePath, fileId } = await uploadWorkFile(client, options.file);
593248
+ created = await client.work.createAgentWork.mutate({
593249
+ ...text,
593250
+ fileId,
593251
+ filePath: absolutePath,
593252
+ type: "file"
593253
+ });
593254
+ }
593255
+ printWork(created, options, "Created");
593256
+ });
593257
+ work.command("update").argument("<work-id>", "Id of a Work this agent created with lh work create").description([
593258
+ "Add a version to a Work this agent created. Options left out keep their values.",
593259
+ "A link Work keeps its URL; register a new link with lh work create --url.",
593260
+ "Works registered automatically (GitHub, Linear, scanned files) cannot be updated."
593261
+ ].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) => {
593262
+ if (!options.file && !options.title && options.description === void 0) throw new Error("Pass at least one of --file, --title or --description");
593263
+ const operationId = requireOperationId(options);
593264
+ const client = await getTrpcClient();
593265
+ const fileId = options.file ? (await uploadWorkFile(client, options.file)).fileId : void 0;
593266
+ printWork(await client.work.updateAgentWork.mutate({
593267
+ description: options.description,
593268
+ fileId,
593269
+ operationId,
593270
+ title: options.title,
593271
+ workId
593272
+ }), options, "Updated");
593273
+ });
593274
+ 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) => {
593275
+ const operationId = requireOperationId(options);
593276
+ const deleted = await (await getTrpcClient()).work.deleteAgentWork.mutate({
593277
+ operationId,
593278
+ workId
593279
+ });
593280
+ if (options.json) outputJson(deleted);
593281
+ else console.log(`Deleted Work ${deleted.id}${deleted.title ? `: ${deleted.title}` : ""}`);
593282
+ });
593283
+ 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) => {
592322
593284
  const client = await getTrpcClient();
592323
593285
  const { data } = await client.work.lookupPullRequest.query({ url });
592324
593286
  if (data.length === 0) {
@@ -592813,6 +593775,7 @@ function createProgram() {
592813
593775
  registerAgentGroupCommand(program);
592814
593776
  registerAgentSignalCommand(program);
592815
593777
  registerBotCommand(program);
593778
+ registerArtboardCommand(program);
592816
593779
  registerChannelCommand(program);
592817
593780
  registerGenerateCommand(program);
592818
593781
  registerGoalCommand$1(program);