@lichao0223/lobehub-cli 0.0.97 → 0.0.98

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