@moxt-ai/mobius 0.0.41 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/acp/activity.d.ts.map +1 -1
  2. package/dist/acp/activity.js +52 -8
  3. package/dist/acp/activity.js.map +1 -1
  4. package/dist/acp/session-manager.d.ts +4 -3
  5. package/dist/acp/session-manager.d.ts.map +1 -1
  6. package/dist/acp/session-manager.js +26 -2
  7. package/dist/acp/session-manager.js.map +1 -1
  8. package/dist/agent-catalog/discover-local-agents.d.ts +0 -1
  9. package/dist/agent-catalog/discover-local-agents.d.ts.map +1 -1
  10. package/dist/agent-catalog/discover-local-agents.js +0 -1
  11. package/dist/agent-catalog/discover-local-agents.js.map +1 -1
  12. package/dist/artifacts/runtime-artifact-uploader.d.ts +2 -2
  13. package/dist/artifacts/runtime-artifact-uploader.d.ts.map +1 -1
  14. package/dist/artifacts/runtime-artifact-uploader.js +3 -3
  15. package/dist/artifacts/runtime-artifact-uploader.js.map +1 -1
  16. package/dist/authorization/local-artifact.d.ts +6 -0
  17. package/dist/authorization/local-artifact.d.ts.map +1 -0
  18. package/dist/authorization/local-artifact.js +2 -0
  19. package/dist/authorization/local-artifact.js.map +1 -0
  20. package/dist/authorization/local-video.d.ts +11 -0
  21. package/dist/authorization/local-video.d.ts.map +1 -0
  22. package/dist/authorization/local-video.js +48 -0
  23. package/dist/authorization/local-video.js.map +1 -0
  24. package/dist/cli.js +151 -25
  25. package/dist/cli.js.map +4 -4
  26. package/dist/index.js +152 -26
  27. package/dist/index.js.map +4 -4
  28. package/dist/run-daemon.js +2 -2
  29. package/dist/run-daemon.js.map +1 -1
  30. package/dist/runtime.d.ts.map +1 -1
  31. package/dist/runtime.js +152 -26
  32. package/dist/runtime.js.map +4 -4
  33. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-video.d.ts","sourceRoot":"","sources":["../../src/authorization/local-video.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMzD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE5D,qBAAa,UAAW,YAAW,aAAa;IAC5C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,KAAK,EAAE,UAAU,EAIxE;IAED,QAAQ,CAAC,MAAM,QAAO,MAAM,CAA+C;CAC9E;AAmBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,SAAU,GAAG,UAAU,GAAG,IAAI,CAgBzG"}
@@ -0,0 +1,48 @@
1
+ import { basename } from "node:path";
2
+ const MAX_INLINE_VIDEO_BYTES = 3_000_000;
3
+ const MP4_FILE_TYPE = new TextEncoder().encode("ftyp");
4
+ const WEBM_SIGNATURE = Uint8Array.of(0x1a, 0x45, 0xdf, 0xa3);
5
+ export class LocalVideo {
6
+ bytes;
7
+ mimeType;
8
+ name;
9
+ constructor(name, mimeType, bytes) {
10
+ this.bytes = bytes;
11
+ this.mimeType = mimeType;
12
+ this.name = name;
13
+ }
14
+ base64 = () => Buffer.from(this.bytes).toString("base64");
15
+ }
16
+ function startsWith(bytes, signature, offset = 0) {
17
+ if (bytes.byteLength < offset + signature.byteLength) {
18
+ return false;
19
+ }
20
+ return signature.every((value, index) => bytes[offset + index] === value);
21
+ }
22
+ function sniffVideoMime(bytes) {
23
+ if (startsWith(bytes, MP4_FILE_TYPE, 4)) {
24
+ return "video/mp4";
25
+ }
26
+ if (startsWith(bytes, WEBM_SIGNATURE)) {
27
+ return "video/webm";
28
+ }
29
+ return null;
30
+ }
31
+ export function readInlineVideo(data, declaredMimeType, name = "Video") {
32
+ if (data.length === 0 || data.length > Math.ceil(MAX_INLINE_VIDEO_BYTES / 3) * 4 || data.length % 4 !== 0) {
33
+ return null;
34
+ }
35
+ if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(data)) {
36
+ return null;
37
+ }
38
+ const bytes = new Uint8Array(Buffer.from(data, "base64"));
39
+ if (bytes.byteLength < 1 || bytes.byteLength > MAX_INLINE_VIDEO_BYTES) {
40
+ return null;
41
+ }
42
+ const mimeType = sniffVideoMime(bytes);
43
+ if (mimeType === null || mimeType !== declaredMimeType) {
44
+ return null;
45
+ }
46
+ return new LocalVideo(basename(name) || "Video", mimeType, bytes);
47
+ }
48
+ //# sourceMappingURL=local-video.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-video.js","sourceRoot":"","sources":["../../src/authorization/local-video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,sBAAsB,GAAG,SAAS,CAAC;AACzC,MAAM,aAAa,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACvD,MAAM,cAAc,GAAG,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAI7D,MAAM,OAAO,UAAU;IACV,KAAK,CAAa;IAClB,QAAQ,CAAqB;IAC7B,IAAI,CAAS;IAEtB,YAAY,IAAY,EAAE,QAA4B,EAAE,KAAiB;QACrE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAEQ,MAAM,GAAG,GAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;CAC9E;AAED,SAAS,UAAU,CAAC,KAAiB,EAAE,SAAqB,EAAE,MAAM,GAAG,CAAC;IACpE,IAAI,KAAK,CAAC,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,cAAc,CAAC,KAAiB;IACrC,IAAI,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC;QACtC,OAAO,WAAW,CAAC;IACvB,CAAC;IACD,IAAI,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC;QACpC,OAAO,YAAY,CAAC;IACxB,CAAC;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,gBAAwB,EAAE,IAAI,GAAG,OAAO;IAClF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,sBAAsB,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACxG,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,kEAAkE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACjF,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC1D,IAAI,KAAK,CAAC,UAAU,GAAG,CAAC,IAAI,KAAK,CAAC,UAAU,GAAG,sBAAsB,EAAE,CAAC;QACpE,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,gBAAgB,EAAE,CAAC;QACrD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC"}
package/dist/cli.js CHANGED
@@ -11,7 +11,7 @@ import { mkdir as mkdir5 } from "node:fs/promises";
11
11
  // package.json
12
12
  var package_default = {
13
13
  name: "@moxt-ai/mobius",
14
- version: "0.0.41",
14
+ version: "0.0.42",
15
15
  description: "Mobius CLI for pairing and running local AI agent services.",
16
16
  type: "module",
17
17
  bin: {
@@ -22933,7 +22933,7 @@ var displayContentSchema = external_exports.strictObject({
22933
22933
  path: external_exports.string().max(2048),
22934
22934
  terminalId: external_exports.string().max(255),
22935
22935
  text: LONG_TEXT,
22936
- type: external_exports.enum(["diff", "image", "resource", "resource_link", "terminal", "text"]),
22936
+ type: external_exports.enum(["diff", "image", "resource", "resource_link", "terminal", "text", "video"]),
22937
22937
  uri: external_exports.string().max(4096)
22938
22938
  }).readonly();
22939
22939
  var recordedDisplayContentSchema = external_exports.strictObject({
@@ -22946,7 +22946,7 @@ var recordedDisplayContentSchema = external_exports.strictObject({
22946
22946
  path: external_exports.string().max(2048),
22947
22947
  terminalId: external_exports.string().max(255),
22948
22948
  text: external_exports.string().max(4e6),
22949
- type: external_exports.enum(["diff", "image", "resource", "resource_link", "terminal", "text"]),
22949
+ type: external_exports.enum(["diff", "image", "resource", "resource_link", "terminal", "text", "video"]),
22950
22950
  uri: external_exports.string().max(4096)
22951
22951
  }).readonly();
22952
22952
  var promptImageSchema = external_exports.strictObject({
@@ -22993,8 +22993,17 @@ var sessionPrepareCommandSchema = external_exports.strictObject({
22993
22993
  }).readonly().optional(),
22994
22994
  kind: external_exports.literal(SESSION_PREPARE_KIND),
22995
22995
  requestId: IDENTIFIER,
22996
+ sessionState: external_exports.literal("provisioned").optional(),
22996
22997
  /** @deprecated Reserved for the legacy Bot Agent-configuration endpoint. */
22997
22998
  transient: external_exports.boolean().optional()
22999
+ }).superRefine((command, context) => {
23000
+ if (command.transient === true && command.sessionState === "provisioned") {
23001
+ context.addIssue({
23002
+ code: "custom",
23003
+ message: "A transient Session cannot already be provisioned",
23004
+ path: ["sessionState"]
23005
+ });
23006
+ }
22998
23007
  }).readonly();
22999
23008
  var runtimeTimingsSchema = external_exports.array(
23000
23009
  external_exports.strictObject({
@@ -24933,7 +24942,7 @@ var AuditStore = class {
24933
24942
 
24934
24943
  // src/run-daemon.ts
24935
24944
  import { randomUUID as randomUUID6 } from "node:crypto";
24936
- import { basename as basename5, join as join17 } from "node:path";
24945
+ import { basename as basename6, join as join17 } from "node:path";
24937
24946
  import { styleText } from "node:util";
24938
24947
  import { fetch as fetch7, WebSocket as WebSocket2 } from "undici";
24939
24948
 
@@ -25096,6 +25105,55 @@ async function readAuthorizedRaster(uri, roots, signal) {
25096
25105
  return new LocalRasterImage(basename2(target) || "Image", mimeType, bytes);
25097
25106
  }
25098
25107
 
25108
+ // src/authorization/local-video.ts
25109
+ import { basename as basename3 } from "node:path";
25110
+ var MAX_INLINE_VIDEO_BYTES = 3e6;
25111
+ var MP4_FILE_TYPE = new TextEncoder().encode("ftyp");
25112
+ var WEBM_SIGNATURE = Uint8Array.of(26, 69, 223, 163);
25113
+ var LocalVideo = class {
25114
+ bytes;
25115
+ mimeType;
25116
+ name;
25117
+ constructor(name, mimeType, bytes) {
25118
+ this.bytes = bytes;
25119
+ this.mimeType = mimeType;
25120
+ this.name = name;
25121
+ }
25122
+ base64 = () => Buffer.from(this.bytes).toString("base64");
25123
+ };
25124
+ function startsWith2(bytes, signature, offset = 0) {
25125
+ if (bytes.byteLength < offset + signature.byteLength) {
25126
+ return false;
25127
+ }
25128
+ return signature.every((value, index2) => bytes[offset + index2] === value);
25129
+ }
25130
+ function sniffVideoMime(bytes) {
25131
+ if (startsWith2(bytes, MP4_FILE_TYPE, 4)) {
25132
+ return "video/mp4";
25133
+ }
25134
+ if (startsWith2(bytes, WEBM_SIGNATURE)) {
25135
+ return "video/webm";
25136
+ }
25137
+ return null;
25138
+ }
25139
+ function readInlineVideo(data, declaredMimeType, name = "Video") {
25140
+ if (data.length === 0 || data.length > Math.ceil(MAX_INLINE_VIDEO_BYTES / 3) * 4 || data.length % 4 !== 0) {
25141
+ return null;
25142
+ }
25143
+ if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(data)) {
25144
+ return null;
25145
+ }
25146
+ const bytes = new Uint8Array(Buffer.from(data, "base64"));
25147
+ if (bytes.byteLength < 1 || bytes.byteLength > MAX_INLINE_VIDEO_BYTES) {
25148
+ return null;
25149
+ }
25150
+ const mimeType = sniffVideoMime(bytes);
25151
+ if (mimeType === null || mimeType !== declaredMimeType) {
25152
+ return null;
25153
+ }
25154
+ return new LocalVideo(basename3(name) || "Video", mimeType, bytes);
25155
+ }
25156
+
25099
25157
  // src/infra/operation-metrics.ts
25100
25158
  var AccumulatingOperationMetrics = class {
25101
25159
  #durations = /* @__PURE__ */ new Map();
@@ -25353,6 +25411,14 @@ function emptyDisplayContent(type) {
25353
25411
  uri: ""
25354
25412
  };
25355
25413
  }
25414
+ function resourceName(uri) {
25415
+ try {
25416
+ const pathname = new URL(uri).pathname;
25417
+ return decodeURIComponent(pathname.slice(pathname.lastIndexOf("/") + 1));
25418
+ } catch {
25419
+ return "";
25420
+ }
25421
+ }
25356
25422
  function imageDisplayContent(mimeType, name, data, artifactId = "", uri = "") {
25357
25423
  return {
25358
25424
  ...emptyDisplayContent("image"),
@@ -25384,18 +25450,21 @@ function normalizeContentBlock(content3) {
25384
25450
  };
25385
25451
  }
25386
25452
  if (content3.type === "resource") {
25453
+ const type = content3.resource.mimeType?.startsWith("video/") === true ? "video" : "resource";
25387
25454
  if ("text" in content3.resource) {
25388
25455
  return {
25389
- ...emptyDisplayContent("resource"),
25456
+ ...emptyDisplayContent(type),
25390
25457
  mimeType: content3.resource.mimeType ?? "",
25458
+ name: resourceName(content3.resource.uri),
25391
25459
  text: content3.resource.text,
25392
25460
  uri: content3.resource.uri
25393
25461
  };
25394
25462
  }
25395
25463
  return {
25396
- ...emptyDisplayContent("resource"),
25464
+ ...emptyDisplayContent(type),
25397
25465
  data: content3.resource.blob,
25398
25466
  mimeType: content3.resource.mimeType ?? "",
25467
+ name: resourceName(content3.resource.uri),
25399
25468
  uri: content3.resource.uri
25400
25469
  };
25401
25470
  }
@@ -25428,6 +25497,36 @@ async function normalizeToolContent(content3, prepareContent) {
25428
25497
  }
25429
25498
  return normalized;
25430
25499
  }
25500
+ function rawMcpToolContent(rawOutput) {
25501
+ if (!isRecord8(rawOutput)) {
25502
+ return [];
25503
+ }
25504
+ const result = isRecord8(rawOutput["result"]) ? rawOutput["result"] : rawOutput;
25505
+ const content3 = result["content"];
25506
+ if (!Array.isArray(content3)) {
25507
+ return [];
25508
+ }
25509
+ return content3.flatMap((item) => {
25510
+ if (!isRecord8(item) || item["type"] !== "image" || typeof item["data"] !== "string" || typeof item["mimeType"] !== "string") {
25511
+ return [];
25512
+ }
25513
+ const uri = item["uri"];
25514
+ return [
25515
+ {
25516
+ type: "content",
25517
+ content: {
25518
+ type: "image",
25519
+ data: item["data"],
25520
+ mimeType: item["mimeType"],
25521
+ ...typeof uri === "string" ? { uri } : {}
25522
+ }
25523
+ }
25524
+ ];
25525
+ });
25526
+ }
25527
+ function toolContent(content3, rawOutput) {
25528
+ return content3 !== void 0 && content3 !== null && content3.length > 0 ? content3 : rawMcpToolContent(rawOutput);
25529
+ }
25431
25530
  function normalizeLocations(locations) {
25432
25531
  const normalized = [];
25433
25532
  const unique = /* @__PURE__ */ new Set();
@@ -25591,7 +25690,10 @@ var AcpActivityTracker = class {
25591
25690
  const output2 = update.rawOutput === void 0 ? readContentOutput(update.content) : formatUnknown(update.rawOutput);
25592
25691
  const detailInput = update.rawInput === void 0 ? "" : formatUnknownDetail(update.rawInput);
25593
25692
  const detailOutput = update.rawOutput === void 0 ? readContentOutputDetail(update.content) : formatUnknownDetail(update.rawOutput);
25594
- const detailContent = await normalizeToolContent(update.content ?? [], this.#prepareContent);
25693
+ const detailContent = await normalizeToolContent(
25694
+ toolContent(update.content, update.rawOutput),
25695
+ this.#prepareContent
25696
+ );
25595
25697
  await this.#record(
25596
25698
  key,
25597
25699
  new AcpActivity(
@@ -25617,10 +25719,11 @@ var AcpActivityTracker = class {
25617
25719
  const identity2 = this.#identity(key);
25618
25720
  const previousDetail = recordedDetail(previous2);
25619
25721
  const output2 = update.rawOutput !== void 0 ? formatUnknown(update.rawOutput) : update.content !== void 0 && update.content !== null ? readContentOutput(update.content) : previous2?.output ?? "";
25620
- const content3 = update.content === void 0 || update.content === null ? previous2?.content ?? [] : await normalizeToolContent(update.content, this.#prepareContent);
25722
+ const nextContent = toolContent(update.content, update.rawOutput);
25723
+ const content3 = nextContent.length === 0 ? previous2?.content ?? [] : await normalizeToolContent(nextContent, this.#prepareContent);
25621
25724
  const detailInput = update.rawInput === void 0 ? previousDetail?.input ?? previous2?.input ?? "" : formatUnknownDetail(update.rawInput);
25622
25725
  const detailOutput = update.rawOutput !== void 0 ? formatUnknownDetail(update.rawOutput) : update.content !== void 0 && update.content !== null ? readContentOutputDetail(update.content) : previousDetail?.output ?? previous2?.output ?? "";
25623
- const detailContent = update.content === void 0 || update.content === null ? previousDetail?.content ?? previous2?.content ?? [] : content3;
25726
+ const detailContent = nextContent.length === 0 ? previousDetail?.content ?? previous2?.content ?? [] : content3;
25624
25727
  await this.#record(
25625
25728
  key,
25626
25729
  new AcpActivity(
@@ -33590,7 +33693,7 @@ var MAX_PRE_SESSION_UPDATES = 100;
33590
33693
  var MAX_PRE_SESSION_UPDATE_BYTES = 1024 * 1024;
33591
33694
  var SESSION_CONTROL_COMMAND_ID = "session-control";
33592
33695
  var NullAcpSessionObserver = class {
33593
- importLocalImage = (_sessionId, _image, signal) => {
33696
+ importLocalArtifact = (_sessionId, _artifact, signal) => {
33594
33697
  signal.throwIfAborted();
33595
33698
  return Promise.resolve("");
33596
33699
  };
@@ -34357,6 +34460,13 @@ var AcpProcessSession = class _AcpProcessSession {
34357
34460
  return await this.importRaster(raster, signal);
34358
34461
  }
34359
34462
  }
34463
+ if (content3.type === "video" && content3.data.length > 0) {
34464
+ const video = readInlineVideo(content3.data, content3.mimeType, content3.name);
34465
+ if (video === null) {
34466
+ return { ...content3, data: "" };
34467
+ }
34468
+ return await this.importVideo(video, AbortSignal.timeout(2e4));
34469
+ }
34360
34470
  return content3;
34361
34471
  };
34362
34472
  emitAgentContent = async (content3, messageId) => {
@@ -34382,7 +34492,7 @@ var AcpProcessSession = class _AcpProcessSession {
34382
34492
  });
34383
34493
  };
34384
34494
  importRaster = async (raster, signal) => {
34385
- const artifactId = await this.#getObserver().importLocalImage(this.#mobiusSessionId, raster, signal);
34495
+ const artifactId = await this.#getObserver().importLocalArtifact(this.#mobiusSessionId, raster, signal);
34386
34496
  return imageDisplayContent(
34387
34497
  raster.mimeType,
34388
34498
  raster.name,
@@ -34390,6 +34500,22 @@ var AcpProcessSession = class _AcpProcessSession {
34390
34500
  artifactId
34391
34501
  );
34392
34502
  };
34503
+ importVideo = async (video, signal) => {
34504
+ const artifactId = await this.#getObserver().importLocalArtifact(this.#mobiusSessionId, video, signal);
34505
+ return {
34506
+ artifactId,
34507
+ data: artifactId.length > 0 ? "" : video.base64(),
34508
+ mimeType: video.mimeType,
34509
+ name: video.name,
34510
+ newText: "",
34511
+ oldText: "",
34512
+ path: "",
34513
+ terminalId: "",
34514
+ text: "",
34515
+ type: "video",
34516
+ uri: ""
34517
+ };
34518
+ };
34393
34519
  async #initializeAgent(signal) {
34394
34520
  await this.#metrics.measure("agent-initialize", async () => await this.#initializeAgentOperation(signal));
34395
34521
  }
@@ -37209,15 +37335,15 @@ async function putContent(url2, authorization, bytes, signal) {
37209
37335
  signal
37210
37336
  });
37211
37337
  }
37212
- async function uploadRuntimeArtifact(config2, sessionId, image, signal) {
37338
+ async function uploadRuntimeArtifact(config2, sessionId, artifact, signal) {
37213
37339
  signal.throwIfAborted();
37214
37340
  let request;
37215
37341
  try {
37216
37342
  request = new MobiusArtifactUploadRequest(
37217
- image.name,
37218
- image.mimeType,
37219
- image.bytes.byteLength,
37220
- createHash2("sha256").update(image.bytes).digest("hex")
37343
+ artifact.name,
37344
+ artifact.mimeType,
37345
+ artifact.bytes.byteLength,
37346
+ createHash2("sha256").update(artifact.bytes).digest("hex")
37221
37347
  );
37222
37348
  } catch (cause) {
37223
37349
  translateSdkError(cause);
@@ -37256,7 +37382,7 @@ async function uploadRuntimeArtifact(config2, sessionId, image, signal) {
37256
37382
  token
37257
37383
  ),
37258
37384
  authorization,
37259
- image.bytes,
37385
+ artifact.bytes,
37260
37386
  requestSignal
37261
37387
  );
37262
37388
  } catch (cause) {
@@ -37297,7 +37423,7 @@ var LocalAuthorizationError = class extends Error {
37297
37423
  // src/authorization/workspace-directory.ts
37298
37424
  import { readdir as readdir2, realpath as realpath8, stat as stat7 } from "node:fs/promises";
37299
37425
  import { homedir as homedir2 } from "node:os";
37300
- import { basename as basename3, dirname as dirname5, isAbsolute as isAbsolute9, join as join16, normalize as normalize3, relative as relative5 } from "node:path";
37426
+ import { basename as basename4, dirname as dirname5, isAbsolute as isAbsolute9, join as join16, normalize as normalize3, relative as relative5 } from "node:path";
37301
37427
  var WorkspaceDirectoryListing = class {
37302
37428
  directoryId;
37303
37429
  directoryLabel;
@@ -37389,7 +37515,7 @@ var WorkspaceDirectoryService = class {
37389
37515
  return {
37390
37516
  path: path2,
37391
37517
  directoryId: encodePath(path2),
37392
- name: basename3(path2) || path2,
37518
+ name: basename4(path2) || path2,
37393
37519
  label: this.label(path2)
37394
37520
  };
37395
37521
  };
@@ -38256,7 +38382,7 @@ var BotOutboundIpcServer = class {
38256
38382
 
38257
38383
  // src/native-sessions/service.ts
38258
38384
  import { randomUUID as randomUUID4 } from "node:crypto";
38259
- import { basename as basename4 } from "node:path";
38385
+ import { basename as basename5 } from "node:path";
38260
38386
 
38261
38387
  // src/native-sessions/codex-history.ts
38262
38388
  import { spawn as spawn4 } from "node:child_process";
@@ -38765,7 +38891,7 @@ var NativeSessionService = class {
38765
38891
  }
38766
38892
  resolvedPaths.add(path2);
38767
38893
  additionalDirectories.push(path2);
38768
- additionalEntries.push({ directoryId: directoryId2, name: basename4(path2) });
38894
+ additionalEntries.push({ directoryId: directoryId2, name: basename5(path2) });
38769
38895
  }
38770
38896
  const listing = await this.#directories.list(this.#config.bindingId, command.directoryId, signal);
38771
38897
  const opened = await this.#sessions.forkSessionAtTurn(
@@ -40087,9 +40213,9 @@ var DaemonAcpObserver = class {
40087
40213
  this.#config = config2;
40088
40214
  this.#record = record3;
40089
40215
  }
40090
- importLocalImage = async (sessionId, image, signal) => {
40216
+ importLocalArtifact = async (sessionId, artifact, signal) => {
40091
40217
  try {
40092
- return (await uploadRuntimeArtifact(this.#config, sessionId, image, signal)).artifactId;
40218
+ return (await uploadRuntimeArtifact(this.#config, sessionId, artifact, signal)).artifactId;
40093
40219
  } catch (cause) {
40094
40220
  signal.throwIfAborted();
40095
40221
  if (cause instanceof Error && cause.name === "AbortError") {
@@ -40660,7 +40786,7 @@ async function resolveSessionDirectories(directories, bindingId, directoryId2, a
40660
40786
  additionalDirectories.push(directory);
40661
40787
  additionalDirectoryEntries.push({
40662
40788
  directoryId: additionalDirectoryId,
40663
- name: basename5(directory)
40789
+ name: basename6(directory)
40664
40790
  });
40665
40791
  }
40666
40792
  return new ResolvedSessionDirectories(cwd, additionalDirectories, additionalDirectoryEntries);
@@ -42349,7 +42475,7 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer) {
42349
42475
  }
42350
42476
 
42351
42477
  // src/runtime.ts
42352
- var RUNTIME_CREDENTIAL_PATTERN = /^[a-zA-Z0-9_-]{43}$/;
42478
+ var RUNTIME_CREDENTIAL_PATTERN = /^(?:[a-zA-Z0-9_-]{43}|prj_[a-zA-Z0-9_-]{24}_[a-zA-Z0-9_-]{43}|prj_(?:wn|en|sa|we|ee|ap|oc|af|me)_01_[a-zA-Z0-9_-]{24}_[a-zA-Z0-9_-]{43})$/;
42353
42479
  var MobiusRuntimeConfigurationError = class extends Error {
42354
42480
  code = "runtime_configuration_invalid";
42355
42481
  constructor(message, options = {}) {