@anna-ai/cli 0.1.38 → 0.1.40
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/{apps-cut-CL_hUGOQ.js → apps-cut-CK5eBabo.js} +3 -3
- package/dist/{apps-discard-BIGqZP7r.js → apps-discard-BpkNZTjG.js} +3 -3
- package/dist/{apps-push-Dt2_vIyy.js → apps-push-XmXxOTDb.js} +3 -3
- package/dist/bridge-BsQ-pos9.js +3 -0
- package/dist/{bridge-Bmqz4Epc.js → bridge-CpntGdy3.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/dashboard.html +25 -4
- package/dist/dev-CnZO3d6s.js +4 -0
- package/dist/{dev-DS6aeIPc.js → dev-CseybCH2.js} +2 -2
- package/dist/{doctor-BwLnSHRh.js → doctor-7XhZ7A4o.js} +1 -1
- package/dist/{executa-dev-pn0ReLIm.js → executa-dev-AODQxG02.js} +1 -1
- package/dist/executa-install-B-mkxkKd.js +7 -0
- package/dist/{executa-install-BHNV-syh.js → executa-install-IP1xB9nw.js} +1 -1
- package/dist/{server-B6H088Zq.js → server-DqTkDxEM.js} +59 -3
- package/dist/{working-orchestration-CfloQqNq.js → working-orchestration-YUC3pKQx.js} +1 -1
- package/package.json +3 -3
- package/dist/bridge-gwH-2kZD.js +0 -3
- package/dist/dev-C4h-bivx.js +0 -4
- package/dist/executa-install-p85nICZq.js +0 -7
|
@@ -10,10 +10,10 @@ import "./executas-CvQY_w2U.js";
|
|
|
10
10
|
import "./executa-publish-DueD_0hh.js";
|
|
11
11
|
import "./binary-upload-CKMU5Rfw.js";
|
|
12
12
|
import { uploadExecutaBinaries } from "./executa-upload-binaries-DURJTXRI.js";
|
|
13
|
-
import "./dev-
|
|
14
|
-
import "./executa-install-
|
|
13
|
+
import "./dev-CseybCH2.js";
|
|
14
|
+
import "./executa-install-IP1xB9nw.js";
|
|
15
15
|
import "./app-cache-Cr3tKbux.js";
|
|
16
|
-
import { resolveAppBySlugOrCache } from "./working-orchestration-
|
|
16
|
+
import { resolveAppBySlugOrCache } from "./working-orchestration-YUC3pKQx.js";
|
|
17
17
|
import { resolve } from "node:path";
|
|
18
18
|
import { existsSync } from "node:fs";
|
|
19
19
|
import { bold, cyan, dim, green, yellow } from "kleur/colors";
|
|
@@ -10,10 +10,10 @@ import "./executas-CvQY_w2U.js";
|
|
|
10
10
|
import "./executa-publish-DueD_0hh.js";
|
|
11
11
|
import "./binary-upload-CKMU5Rfw.js";
|
|
12
12
|
import "./executa-upload-binaries-DURJTXRI.js";
|
|
13
|
-
import "./dev-
|
|
14
|
-
import "./executa-install-
|
|
13
|
+
import "./dev-CseybCH2.js";
|
|
14
|
+
import "./executa-install-IP1xB9nw.js";
|
|
15
15
|
import "./app-cache-Cr3tKbux.js";
|
|
16
|
-
import { resolveAppBySlugOrCache } from "./working-orchestration-
|
|
16
|
+
import { resolveAppBySlugOrCache } from "./working-orchestration-YUC3pKQx.js";
|
|
17
17
|
import { dim, green, yellow } from "kleur/colors";
|
|
18
18
|
|
|
19
19
|
//#region src/commands/apps-discard.ts
|
|
@@ -10,10 +10,10 @@ import "./executas-CvQY_w2U.js";
|
|
|
10
10
|
import { bumpVersion, bundleHash, manifestHash, rewriteVersion } from "./executa-publish-DueD_0hh.js";
|
|
11
11
|
import "./binary-upload-CKMU5Rfw.js";
|
|
12
12
|
import "./executa-upload-binaries-DURJTXRI.js";
|
|
13
|
-
import "./dev-
|
|
14
|
-
import "./executa-install-
|
|
13
|
+
import "./dev-CseybCH2.js";
|
|
14
|
+
import "./executa-install-IP1xB9nw.js";
|
|
15
15
|
import "./app-cache-Cr3tKbux.js";
|
|
16
|
-
import { installLocalBundledShims, resolveAppIdentity, resolveBundledExecutas } from "./working-orchestration-
|
|
16
|
+
import { installLocalBundledShims, resolveAppIdentity, resolveBundledExecutas } from "./working-orchestration-YUC3pKQx.js";
|
|
17
17
|
import { syncAppListingMeta } from "./listing-meta-CtVtyaWu.js";
|
|
18
18
|
import { isExistingDir, uploadWorkingBundle } from "./app-bundle-upload-B6TJeyOq.js";
|
|
19
19
|
import { resolve } from "node:path";
|
|
@@ -9,7 +9,7 @@ import { createInterface } from "node:readline";
|
|
|
9
9
|
* `uvx <pkg>@<version>` so end users always run the dispatcher version
|
|
10
10
|
* the CLI was tested against.
|
|
11
11
|
*/
|
|
12
|
-
const PINNED_RUNTIME_VERSION = "0.2.
|
|
12
|
+
const PINNED_RUNTIME_VERSION = "0.2.0a17";
|
|
13
13
|
/**
|
|
14
14
|
* Throwable from a {@link RequestHandler} to send a structured JSON-RPC
|
|
15
15
|
* error back to the python bridge with a stable string ``code`` (e.g.
|
package/dist/cli.js
CHANGED
|
@@ -474,7 +474,7 @@ program.command("validate").description("Run schema + ACL checks on a manifest+b
|
|
|
474
474
|
process.exit(code);
|
|
475
475
|
});
|
|
476
476
|
program.command("dev").description("Run a local harness (in-process dispatcher + iframe + SSE relay)").option("--manifest <path>", "manifest.json path", "manifest.json").option("--bundle <dir>", "bundle directory (default: ./bundle)").option("--slug <slug>", "App slug (overrides manifest.slug/name)").option("--view <name>", "View name to open (default: manifest default)").option("--matrix-nexus-root <path>", "matrix-nexus checkout (auto-detected if omitted; can also use $ANNA_NEXUS_ROOT)").option("--port <number>", "HTTP port", "5180").option("--user-id <id>", "Harness user_id", "1").option("--cwd <dir>", "Project root (default: cwd)").option("--no-watch", "Disable bundle file watcher (default: enabled)").option("--executa <spec>", "Explicit executa registration; repeatable. Spec: comma-separated key=value (dir=<path>[,tool_id=<id>][,type=python|node|go|binary][,command=\"<argv>\"]). When only `dir=` is given, the executa is auto-detected from executa.json / pyproject.toml / package.json / go.mod. Overrides directory auto-discovery under <manifest-dir>/executas/.", (val, prev) => prev ? [...prev, val] : [val]).option("--no-llm", "Disable LLM bridge (anna.llm/agent return llm_disabled)").option("--mock-llm <fixture>", "Serve canned LLM responses from a JSONL fixture").option("--llm-account <host>", "Saved account host to use (default: current)").option("--llm-app-slug <slug>", "Override the manifest slug used to register / look up the dev AnnaApp (default: manifest.slug)").option("--storage <mode>", "Storage backend: \"legacy\" (in-memory runtime_state, default) or \"aps\" (real nexus APS via /api/v1/storage/* — requires `anna-app login`).", "legacy").action(async (opts) => {
|
|
477
|
-
const { runDev, parseExecutaSpec } = await import("./dev-
|
|
477
|
+
const { runDev, parseExecutaSpec } = await import("./dev-CnZO3d6s.js");
|
|
478
478
|
const cwd = opts.cwd ?? process.cwd();
|
|
479
479
|
let executas;
|
|
480
480
|
if (opts.executa && opts.executa.length > 0) {
|
|
@@ -533,7 +533,7 @@ fixture.command("replay <file>").description("Dry-run replay of a harness record
|
|
|
533
533
|
process.exit(code);
|
|
534
534
|
});
|
|
535
535
|
program.command("doctor").description("Check environment for `anna-app dev` (uv, matrix-nexus, dev key)").option("--matrix-nexus-root <path>", "matrix-nexus checkout (optional)").action(async (opts) => {
|
|
536
|
-
const { runDoctor } = await import("./doctor-
|
|
536
|
+
const { runDoctor } = await import("./doctor-7XhZ7A4o.js");
|
|
537
537
|
const code = await runDoctor({ matrixNexusRoot: opts.matrixNexusRoot });
|
|
538
538
|
process.exit(code);
|
|
539
539
|
});
|
|
@@ -596,7 +596,7 @@ executa.command("register").description("Register a HARNESS AnnaApp(kind=executa
|
|
|
596
596
|
process.exit(code);
|
|
597
597
|
});
|
|
598
598
|
executa.command("install").description("Install a local-dev shim for an Executa under its minted tool_id so the Agent can discover it via 'Rediscover Local' (for distribution_type: local). Resolves the tool_id from .anna/executa.json (written by `executa publish` / `apps push`) unless --tool-id is given.").option("--dir <path>", "Executa project dir (default: CWD)").option("--tool-id <id>", "Install the shim under this exact id (default: minted id from .anna/executa.json, else executa.json tool_id)").option("--bin-dir <path>", "Install dir for the shim (default: ~/.anna/executa/bin)").option("--force", "Overwrite an existing shim of the same name", false).option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
|
|
599
|
-
const { runExecutaInstall } = await import("./executa-install-
|
|
599
|
+
const { runExecutaInstall } = await import("./executa-install-B-mkxkKd.js");
|
|
600
600
|
const code = await runExecutaInstall({
|
|
601
601
|
dir: opts.dir,
|
|
602
602
|
toolId: opts.toolId,
|
|
@@ -607,7 +607,7 @@ executa.command("install").description("Install a local-dev shim for an Executa
|
|
|
607
607
|
process.exit(code);
|
|
608
608
|
});
|
|
609
609
|
executa.command("dev").description("Run one Executa plugin in isolation (REPL or one-shot describe/invoke)").option("--dir <path>", "Executa project dir (default: CWD)").option("--spec <spec>", "Override discovery: comma-separated key=value (tool_id=...,type=...,command=\"...\")").option("--describe", "Print MANIFEST and exit", false).option("--health", "Print health and exit", false).option("--invoke <tool>", "Invoke one tool and exit").option("--args <json>", "JSON object passed as tool arguments", "{}").option("--json", "One-shot: emit compact JSON (no banners)", false).option("--no-sampling", "Hard-disable sampling reverse RPC (returns sampling_disabled)").option("--mock-sampling <fixture>", "Serve canned sampling responses from a JSONL fixture (offline)").option("--sampling-unsupported-format", "Simulate a model without json_schema support — exercises responseFormat onUnsupported branches (-32010 / downgrade)").option("--app-slug <slug>", "Forward sampling to nexus on behalf of this dev AnnaApp slug").option("--sampling-account <host>", "Saved account host for nexus sampling (default: current)").option("--no-agent", "Hard-disable agent reverse RPC (returns agent_not_granted)").option("--mock-agent <fixture>", "Serve canned agent/* responses from a JSONL fixture (offline)").option("--agent-account <host>", "Saved account host for nexus agent (default: --sampling-account or current)").option("--storage <mode>", "Storage backend: off | memory | mock | real (default: memory)").option("--mock-storage <fixture>", "Serve canned storage/* + files/* responses from a JSONL fixture").option("--storage-account <host>", "Saved account host for nexus storage (default: --sampling-account or current)").option("--storage-scopes <list>", "Comma-separated scopes for real storage tokens (default: user,app,tool)").option("--no-image", "Hard-disable image reverse RPC (returns image_not_granted)").option("--mock-image <fixture>", "Serve canned image/generate + image/edit responses from a JSONL fixture").option("--image-account <host>", "Saved account host for nexus image (default: --sampling-account or current)").option("--no-upload", "Hard-disable host/uploadFile reverse RPC (returns upload_not_granted)").option("--mock-upload <fixture>", "Serve canned host/uploadFile responses from a JSONL fixture").option("--upload-account <host>", "Saved account host for nexus uploads (default: --sampling-account or current)").action(async (opts) => {
|
|
610
|
-
const { runExecutaDev } = await import("./executa-dev-
|
|
610
|
+
const { runExecutaDev } = await import("./executa-dev-AODQxG02.js");
|
|
611
611
|
const storageMode = opts.storage === void 0 ? void 0 : (() => {
|
|
612
612
|
const m = opts.storage;
|
|
613
613
|
if (m === "off" || m === "memory" || m === "mock" || m === "real") return m;
|
|
@@ -704,7 +704,7 @@ apps.command("push").description("Upsert the mutable working draft (manifest + b
|
|
|
704
704
|
process.exit(2);
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
|
-
const { runAppsPush } = await import("./apps-push-
|
|
707
|
+
const { runAppsPush } = await import("./apps-push-XmXxOTDb.js");
|
|
708
708
|
process.exit(await runAppsPush({
|
|
709
709
|
cwd: opts.cwd,
|
|
710
710
|
manifest: opts.manifest,
|
|
@@ -724,7 +724,7 @@ apps.command("push").description("Upsert the mutable working draft (manifest + b
|
|
|
724
724
|
}));
|
|
725
725
|
});
|
|
726
726
|
apps.command("cut <version>").description("Snapshot the working draft into an immutable version (freeze deps)").option("--changelog <text>", "Override the working draft changelog for this version").option("--slug <slug>", "App slug (default: resolve from .anna/app.json cache)").option("--cwd <dir>", "Project root for identity cache (default: cwd)").option("--dry-run", "Resolve target but don't cut", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (version, opts) => {
|
|
727
|
-
const { runAppsCut } = await import("./apps-cut-
|
|
727
|
+
const { runAppsCut } = await import("./apps-cut-CK5eBabo.js");
|
|
728
728
|
process.exit(await runAppsCut({
|
|
729
729
|
version,
|
|
730
730
|
changelog: opts.changelog,
|
|
@@ -736,7 +736,7 @@ apps.command("cut <version>").description("Snapshot the working draft into an im
|
|
|
736
736
|
}));
|
|
737
737
|
});
|
|
738
738
|
apps.command("discard").description("Drop the mutable working draft (leaves cut versions intact)").option("--slug <slug>", "App slug (default: resolve from .anna/app.json cache)").option("--cwd <dir>", "Project root for identity cache (default: cwd)").option("--dry-run", "Resolve target but don't discard", false).option("--account <host>", "Saved account host (default: current)").option("--json", "Emit machine-readable JSON", false).action(async (opts) => {
|
|
739
|
-
const { runAppsDiscard } = await import("./apps-discard-
|
|
739
|
+
const { runAppsDiscard } = await import("./apps-discard-BpkNZTjG.js");
|
|
740
740
|
process.exit(await runAppsDiscard({
|
|
741
741
|
slug: opts.slug,
|
|
742
742
|
cwd: opts.cwd,
|
package/dist/dashboard.html
CHANGED
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
<span id="iframe-src">awaiting session…</span>
|
|
182
182
|
<span class="size" id="size"></span>
|
|
183
183
|
</div>
|
|
184
|
-
<iframe id="app" sandbox="allow-scripts allow-same-origin allow-forms allow-popups"></iframe>
|
|
184
|
+
<iframe id="app" sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-downloads"></iframe>
|
|
185
185
|
</div>
|
|
186
186
|
</main>
|
|
187
187
|
<aside>
|
|
@@ -382,15 +382,36 @@
|
|
|
382
382
|
});
|
|
383
383
|
const body = await res.json();
|
|
384
384
|
if (body.ok) {
|
|
385
|
+
let result = body.result;
|
|
386
|
+
// files.download — mirror production anna-app-host-bridge.js:
|
|
387
|
+
// consume the presigned URL at TOP LEVEL (the sandboxed iframe
|
|
388
|
+
// can't reliably save files), then strip it before relaying the
|
|
389
|
+
// result into the iframe so the bearer URL never enters app DOM.
|
|
390
|
+
if (ns === "files" && method === "download" && result && result.get_url) {
|
|
391
|
+
const a = document.createElement("a");
|
|
392
|
+
a.href = result.get_url;
|
|
393
|
+
a.rel = "noopener";
|
|
394
|
+
if (result.filename) a.download = result.filename;
|
|
395
|
+
a.style.display = "none";
|
|
396
|
+
document.body.appendChild(a);
|
|
397
|
+
a.click();
|
|
398
|
+
a.remove();
|
|
399
|
+
const { get_url, ...rest } = result;
|
|
400
|
+
result = { ...rest, ok: true };
|
|
401
|
+
logLine(
|
|
402
|
+
"meta-line",
|
|
403
|
+
`⬇ files.download → browser save (${escapeHtml(String(result.filename ?? "file"))})`,
|
|
404
|
+
);
|
|
405
|
+
}
|
|
385
406
|
iframe.contentWindow.postMessage(
|
|
386
|
-
{ wid: windowUuid, kind: "res", id, result
|
|
407
|
+
{ wid: windowUuid, kind: "res", id, result },
|
|
387
408
|
"*",
|
|
388
409
|
);
|
|
389
410
|
logLine(
|
|
390
411
|
"res-ok",
|
|
391
|
-
`← res ok <span class="pill">${escapeHtml(ns)}.${escapeHtml(method)}</span> ${escapeHtml(JSON.stringify(
|
|
412
|
+
`← res ok <span class="pill">${escapeHtml(ns)}.${escapeHtml(method)}</span> ${escapeHtml(JSON.stringify(result))}`,
|
|
392
413
|
);
|
|
393
|
-
recPush("res", { id, ok: true, result
|
|
414
|
+
recPush("res", { id, ok: true, result });
|
|
394
415
|
} else {
|
|
395
416
|
iframe.contentWindow.postMessage(
|
|
396
417
|
{ wid: windowUuid, kind: "res", id, error: body.error },
|
|
@@ -49,8 +49,8 @@ async function runDev(opts) {
|
|
|
49
49
|
}
|
|
50
50
|
process.env.ANNA_APP_RUNTIME_STORAGE_MODE = "aps";
|
|
51
51
|
}
|
|
52
|
-
const { PythonBridge, PINNED_RUNTIME_VERSION } = await import("./bridge-
|
|
53
|
-
const { HarnessServer } = await import("./server-
|
|
52
|
+
const { PythonBridge, PINNED_RUNTIME_VERSION } = await import("./bridge-BsQ-pos9.js");
|
|
53
|
+
const { HarnessServer } = await import("./server-DqTkDxEM.js");
|
|
54
54
|
const bridge = new PythonBridge({
|
|
55
55
|
mode,
|
|
56
56
|
matrixNexusRoot: matrixNexusRoot ?? void 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findMatrixNexusRoot, nexusSchemaDir } from "./nexus-root-BlPwOusj.js";
|
|
2
|
-
import { PINNED_RUNTIME_VERSION } from "./bridge-
|
|
2
|
+
import { PINNED_RUNTIME_VERSION } from "./bridge-CpntGdy3.js";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { existsSync, statSync } from "node:fs";
|
|
5
5
|
import { spawnSync } from "node:child_process";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./nexus-root-BlPwOusj.js";
|
|
2
|
-
import { parseExecutaSpec } from "./dev-
|
|
2
|
+
import { parseExecutaSpec } from "./dev-CseybCH2.js";
|
|
3
3
|
import { isAbsolute, resolve } from "node:path";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { bold, cyan, dim, green, red, yellow } from "kleur/colors";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readExecutaIdentity } from "./executa-cache-BFoUtb4J.js";
|
|
2
|
-
import { parseExecutaSpec } from "./dev-
|
|
2
|
+
import { parseExecutaSpec } from "./dev-CseybCH2.js";
|
|
3
3
|
import { isAbsolute, join, resolve } from "node:path";
|
|
4
4
|
import { chmodSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { bold, cyan, dim, green, red, yellow } from "kleur/colors";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { canonicalHost, getAccount } from "./credentials-BTv2IfUZ.js";
|
|
2
|
-
import { BridgeRequestError } from "./bridge-
|
|
2
|
+
import { BridgeRequestError } from "./bridge-CpntGdy3.js";
|
|
3
3
|
import { dirname, join, normalize, resolve } from "node:path";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { createReadStream, existsSync, readFileSync, statSync, watch } from "node:fs";
|
|
@@ -78,6 +78,11 @@ const FILES_APP_ROUTES = {
|
|
|
78
78
|
"/files/url",
|
|
79
79
|
"query"
|
|
80
80
|
],
|
|
81
|
+
download: [
|
|
82
|
+
"GET",
|
|
83
|
+
"/files/url",
|
|
84
|
+
"query"
|
|
85
|
+
],
|
|
81
86
|
list: [
|
|
82
87
|
"GET",
|
|
83
88
|
"/files",
|
|
@@ -368,6 +373,10 @@ var LlmBridge = class {
|
|
|
368
373
|
message: "harness started with --no-llm"
|
|
369
374
|
}
|
|
370
375
|
};
|
|
376
|
+
if (args.ns === "agent" && args.method === "session.catalog") return {
|
|
377
|
+
ok: true,
|
|
378
|
+
result: this.localSessionCatalog()
|
|
379
|
+
};
|
|
371
380
|
if (this.opts.mode === "mock") return this.dispatchMock(args);
|
|
372
381
|
try {
|
|
373
382
|
return await this.dispatchReal(args);
|
|
@@ -381,6 +390,35 @@ var LlmBridge = class {
|
|
|
381
390
|
};
|
|
382
391
|
}
|
|
383
392
|
}
|
|
393
|
+
/**
|
|
394
|
+
* Local answer for `agent.session.catalog` (both mock and real modes).
|
|
395
|
+
*
|
|
396
|
+
* Keep the registry list in sync with matrix-nexus
|
|
397
|
+
* `src/services/app_tool_registry.py` (drift-checked there against the
|
|
398
|
+
* platform-tools Reference section). The harness is permissive by
|
|
399
|
+
* design — `declared_in_manifest` / `user_granted` are always true
|
|
400
|
+
* because `anna-app dev` registers the full dev grant bundle.
|
|
401
|
+
*/
|
|
402
|
+
localSessionCatalog() {
|
|
403
|
+
const registry = [{
|
|
404
|
+
name: "web_search",
|
|
405
|
+
description: "Search the public web (or news) and return concise, provider-agnostic snippets.",
|
|
406
|
+
dev_safe: true
|
|
407
|
+
}];
|
|
408
|
+
const names = registry.map((t) => t.name);
|
|
409
|
+
return {
|
|
410
|
+
platform_tools: registry.map((t) => ({
|
|
411
|
+
...t,
|
|
412
|
+
declared_in_manifest: true,
|
|
413
|
+
user_granted: true,
|
|
414
|
+
eligible: true
|
|
415
|
+
})),
|
|
416
|
+
inherit_host_tools_granted: true,
|
|
417
|
+
manifest_declared: names,
|
|
418
|
+
user_granted: names,
|
|
419
|
+
_dev_note: "local harness catalog — permissive dev grants; production eligibility reflects your manifest ui.host_api.agent.tools and the user's Permissions modal (blocked_by: manifest|user_grant)"
|
|
420
|
+
};
|
|
421
|
+
}
|
|
384
422
|
async dispatchMock(args) {
|
|
385
423
|
const content = String(args.args?.content ?? args.args?.messages ?? "");
|
|
386
424
|
const entry = this.mocks.find((m) => m.ns === args.ns && m.method === args.method && (!m.match?.contentIncludes || content.includes(m.match.contentIncludes))) ?? this.mocks.find((m) => m.ns === args.ns && m.method === args.method);
|
|
@@ -801,10 +839,21 @@ var LlmBridge = class {
|
|
|
801
839
|
a.size_bytes = a.size;
|
|
802
840
|
delete a.size;
|
|
803
841
|
}
|
|
842
|
+
let downloadFilename;
|
|
843
|
+
if (args.method === "download") {
|
|
844
|
+
const rawName = typeof a.filename === "string" && a.filename ? a.filename : String(a.path ?? "").split("/").pop() || "download";
|
|
845
|
+
downloadFilename = rawName;
|
|
846
|
+
const asciiSafe = rawName.replace(/["\\\r\n]/g, "_");
|
|
847
|
+
a.disposition = `attachment; filename="${asciiSafe}"; filename*=UTF-8''${encodeURIComponent(rawName)}`;
|
|
848
|
+
if (a.ttl === void 0 && a.ttl_seconds !== void 0) a.ttl = a.ttl_seconds;
|
|
849
|
+
delete a.ttl_seconds;
|
|
850
|
+
delete a.filename;
|
|
851
|
+
}
|
|
804
852
|
const base = `${canonicalHost(this.account().host)}/api/v1/storage`;
|
|
805
853
|
const [httpMethod, subPath, payloadKind] = froute;
|
|
806
854
|
const url = new URL(`${base}${subPath}`);
|
|
807
|
-
|
|
855
|
+
const reqScope = typeof a.scope === "string" && VALID_STORAGE_SCOPES.has(a.scope) ? a.scope : "app";
|
|
856
|
+
url.searchParams.set("scope", reqScope);
|
|
808
857
|
let jsonBody;
|
|
809
858
|
if (payloadKind === "query") for (const [k, v] of Object.entries(a)) {
|
|
810
859
|
if (k === "scope" || v === void 0 || v === null) continue;
|
|
@@ -834,9 +883,11 @@ var LlmBridge = class {
|
|
|
834
883
|
ok: true,
|
|
835
884
|
result: { deleted: true }
|
|
836
885
|
};
|
|
886
|
+
const fresult = await res.json();
|
|
887
|
+
if (args.method === "download" && downloadFilename !== void 0) fresult.filename = fresult.filename ?? downloadFilename;
|
|
837
888
|
return {
|
|
838
889
|
ok: true,
|
|
839
|
-
result:
|
|
890
|
+
result: fresult
|
|
840
891
|
};
|
|
841
892
|
}
|
|
842
893
|
}
|
|
@@ -1230,6 +1281,11 @@ var HarnessServer = class {
|
|
|
1230
1281
|
"agent",
|
|
1231
1282
|
"session.list"
|
|
1232
1283
|
],
|
|
1284
|
+
[
|
|
1285
|
+
"host.agent.session.catalog",
|
|
1286
|
+
"agent",
|
|
1287
|
+
"session.catalog"
|
|
1288
|
+
],
|
|
1233
1289
|
[
|
|
1234
1290
|
"host.image.generate",
|
|
1235
1291
|
"image",
|
|
@@ -4,7 +4,7 @@ import { CliError } from "./client-D-_z1ALk.js";
|
|
|
4
4
|
import { parseExecutaIdOverrides, readExecutasLock, substituteBundledRefs, validateBundledHandles, writeBundleToolIdSidecar, writeExecutasLock } from "./bundled-executas-rSIkaA6-.js";
|
|
5
5
|
import { loadExecutaManifest } from "./manifest-CAF3_r1T.js";
|
|
6
6
|
import { runExecutaPublish } from "./executa-publish-DueD_0hh.js";
|
|
7
|
-
import { runExecutaInstall } from "./executa-install-
|
|
7
|
+
import { runExecutaInstall } from "./executa-install-IP1xB9nw.js";
|
|
8
8
|
import { appCacheMatches, readAppIdentity, writeAppIdentity } from "./app-cache-Cr3tKbux.js";
|
|
9
9
|
import { join, resolve } from "node:path";
|
|
10
10
|
import { dim, green, yellow } from "kleur/colors";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anna-ai/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"description": "Anna App developer CLI: scaffold, validate, harness (Phase 2 MVP: init + validate).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"prepublishOnly": "pnpm lint && pnpm test && pnpm build && node scripts/check-runtime-pin.mjs && node scripts/check-sdk-pin.mjs"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@anna-ai/app-runtime": "^0.
|
|
37
|
-
"@anna-ai/app-schema": "^0.
|
|
36
|
+
"@anna-ai/app-runtime": "^0.14.0",
|
|
37
|
+
"@anna-ai/app-schema": "^0.18.0",
|
|
38
38
|
"ajv": "^8.17.1",
|
|
39
39
|
"ajv-formats": "^3.0.1",
|
|
40
40
|
"commander": "^12.1.0",
|
package/dist/bridge-gwH-2kZD.js
DELETED
package/dist/dev-C4h-bivx.js
DELETED