@inneranimalmedia/agentsam-sdk 2.6.10 → 2.6.11
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/README.md +3 -0
- package/TRADEMARKS.md +22 -0
- package/apps/README.md +3 -0
- package/apps/cad-creator/LICENSE +21 -0
- package/apps/cad-creator/README.md +4 -1
- package/apps/cad-creator/shared/cad/package.json +1 -1
- package/apps/client-cms-editor/LICENSE +21 -0
- package/apps/client-cms-editor/README.md +3 -0
- package/apps/client-cms-editor/backend/package.json +2 -2
- package/apps/client-cms-editor/frontend/package.json +3 -3
- package/apps/client-cms-editor/package-lock.json +43 -43
- package/apps/client-cms-editor/package.json +3 -3
- package/apps/client-cms-editor/reference/harvest/HARVEST_RECEIPT.json +1 -1
- package/apps/client-cms-editor/reference/harvest/README.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/ARCHIVE-INTAKE.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/HARVEST-INDEX.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/TOOLING-LAB.md +1 -1
- package/apps/client-cms-editor/shared/cms/package.json +1 -1
- package/docs/MINI.md +4 -2
- package/docs/REPO_FILE_MAP.txt +0 -1
- package/docs/SOURCE_ARCHITECTURE.md +1 -1
- package/docs/architecture/DUAL_ANALYTICS_PRODUCT.md +140 -0
- package/docs/content-studio/REVISION_GATE_2026-09-27.md +1 -1
- package/docs/engineering/go-portability/01-product-project-deployment-authority.md +69 -0
- package/docs/engineering/provider-internal-renames/01-lane-initialization.md +20 -0
- package/docs/engineering/provider-internal-renames/01a-runtime-environment-contract.md +115 -0
- package/docs/engineering/provider-internal-renames/02-cfoa.md +57 -0
- package/docs/engineering/provider-internal-renames/03-gclioa.md +32 -0
- package/docs/engineering/provider-internal-renames/04-goaude.md +50 -0
- package/docs/engineering/provider-internal-renames/05-gdrv.md +33 -0
- package/docs/engineering/provider-internal-renames/06-verification.md +103 -0
- package/docs/engineering/provider-internal-renames/README.md +77 -0
- package/docs/engineering/provider-internal-renames/runtime-environment-contract.json +220 -0
- package/docs/engineering/test-diagnostics/go-cli-test-hang-20261003.md +49 -0
- package/docs/engineering/test-diagnostics/go-skip-deploy-docker-fix.md +90 -0
- package/docs/knowledge-service-verification.md +3 -3
- package/docs/plans/AGENTSAM-SUSPEND-QUEUE-KNOWLEDGE-RDP-2026-10-03.md +870 -0
- package/docs/plans/LOCAL-STUDIO-GRADUATION-2026-09-26.md +9 -9
- package/docs/plans/MACHINE-FIRST-APPS-TUI-2026-09-24.md +11 -11
- package/docs/plans/RECONCILIATION-2026-09-19.md +6 -6
- package/docs/plans/SAM_WORK_PROTOCOL.md +667 -0
- package/docs/plans/TOMORROW-EXTENSIVE-TODO-2026-09-26.md +2 -2
- package/docs/plans/UNIVERSAL-INGEST-MACHINE-FIRST-2026-09-24.md +3 -3
- package/examples/hyperspace-demo/src/main.tsx +227 -110
- package/migrations/d1/0020_agentsam_receipt_catalog.sql +35 -0
- package/migrations/runtime/0006_agent_run_suspend_activity.sql +53 -0
- package/migrations/runtime/0007_queue_control.sql +40 -0
- package/migrations/runtime/0008_agent_run_dependencies.sql +24 -0
- package/migrations/runtime/0008_analytics_legacy_bootstrap.sql +43 -0
- package/migrations/runtime/0009_analytics_authority.sql +108 -0
- package/package.json +26 -11
- package/packages/agentsam-brand/README.md +3 -0
- package/packages/agentsam-brand/package.json +2 -2
- package/packages/agentsam-contracts/dist/adapter.d.ts +22 -0
- package/packages/agentsam-contracts/dist/adapter.js +0 -0
- package/packages/agentsam-contracts/dist/agent.d.ts +66 -0
- package/packages/agentsam-contracts/dist/agent.js +15 -0
- package/packages/agentsam-contracts/dist/artifacts.d.ts +70 -0
- package/packages/agentsam-contracts/dist/artifacts.js +0 -0
- package/packages/agentsam-contracts/dist/authority.d.ts +21 -0
- package/packages/agentsam-contracts/dist/authority.js +0 -0
- package/packages/agentsam-contracts/dist/context.d.ts +14 -0
- package/packages/agentsam-contracts/dist/context.js +0 -0
- package/packages/agentsam-contracts/dist/errors.d.ts +121 -0
- package/packages/agentsam-contracts/dist/errors.js +5 -0
- package/packages/agentsam-contracts/dist/events.d.ts +53 -0
- package/packages/agentsam-contracts/dist/events.js +0 -0
- package/packages/agentsam-contracts/dist/execution.d.ts +38 -0
- package/packages/agentsam-contracts/dist/execution.js +0 -0
- package/packages/agentsam-contracts/dist/hooks.d.ts +31 -0
- package/packages/agentsam-contracts/dist/hooks.js +0 -0
- package/packages/agentsam-contracts/dist/identity.d.ts +15 -0
- package/packages/agentsam-contracts/dist/identity.js +0 -0
- package/packages/agentsam-contracts/dist/index.d.ts +16 -0
- package/packages/agentsam-contracts/dist/index.js +164 -0
- package/packages/agentsam-contracts/dist/models.d.ts +9 -0
- package/packages/agentsam-contracts/dist/models.js +0 -0
- package/packages/agentsam-contracts/dist/providers.d.ts +27 -0
- package/packages/agentsam-contracts/dist/providers.js +0 -0
- package/packages/agentsam-contracts/dist/repository.d.ts +56 -0
- package/packages/agentsam-contracts/dist/repository.js +15 -0
- package/packages/agentsam-contracts/dist/run.d.ts +113 -0
- package/packages/agentsam-contracts/dist/run.js +132 -0
- package/packages/agentsam-contracts/dist/tools.d.ts +82 -0
- package/packages/agentsam-contracts/dist/tools.js +0 -0
- package/packages/agentsam-contracts/dist/widgets.d.ts +38 -0
- package/packages/agentsam-contracts/dist/widgets.js +0 -0
- package/packages/agentsam-contracts/package.json +9 -1
- package/packages/agentsam-contracts/scripts/build.mjs +1 -1
- package/packages/agentsam-contracts/src/agent.ts +78 -3
- package/packages/agentsam-contracts/src/index.ts +2 -0
- package/packages/agentsam-contracts/src/run.ts +320 -0
- package/packages/agentsam-contracts/src/widgets.ts +58 -0
- package/packages/agentsam-contracts/test/contracts.test.mjs +1 -1
- package/packages/agentsam-contracts/test/run-contract.test.mjs +94 -0
- package/packages/agentsam-errors/package.json +1 -1
- package/packages/agentsam-goap/README.md +3 -0
- package/packages/agentsam-goap/package.json +2 -2
- package/packages/agentsam-hooks/package.json +2 -2
- package/packages/agentsam-hooks/src/adapters/agents.js +48 -22
- package/packages/agentsam-hooks/src/index.d.ts +16 -0
- package/packages/agentsam-knowledge/package.json +1 -1
- package/packages/agentsam-knowledge/src/backends/index.js +1 -1
- package/packages/agentsam-merch/README.md +62 -0
- package/packages/agentsam-merch/bin/agentsam-merch.mjs +16 -0
- package/packages/agentsam-merch/package.json +65 -0
- package/packages/agentsam-merch/profiles/completeful/dtg-back-large.json +42 -0
- package/packages/agentsam-merch/profiles/completeful/laser-engraving.json +39 -0
- package/packages/agentsam-merch/profiles/generic/embroidery-digitization.json +22 -0
- package/packages/agentsam-merch/schemas/collection-candidate.schema.json +66 -0
- package/packages/agentsam-merch/schemas/manufacturing-profile.schema.json +221 -0
- package/packages/agentsam-merch/src/adapters-completeful.js +50 -0
- package/packages/agentsam-merch/src/cli.js +93 -0
- package/packages/agentsam-merch/src/collection-lab.js +60 -0
- package/packages/agentsam-merch/src/compatibility.js +501 -0
- package/packages/agentsam-merch/src/derivatives.js +112 -0
- package/packages/agentsam-merch/src/index.d.ts +316 -0
- package/packages/agentsam-merch/src/index.js +46 -0
- package/packages/agentsam-merch/src/node/index.d.ts +58 -0
- package/packages/agentsam-merch/src/node/index.js +6 -0
- package/packages/agentsam-merch/src/node/raster.js +142 -0
- package/packages/agentsam-merch/src/node/vector.js +239 -0
- package/packages/agentsam-merch/src/product-concepts.js +118 -0
- package/packages/agentsam-merch/src/profile-registry.js +104 -0
- package/packages/agentsam-merch/src/profile.js +158 -0
- package/packages/agentsam-merch/src/transforms.js +215 -0
- package/packages/agentsam-merch/test/merch.test.mjs +332 -0
- package/packages/agentsam-merch/test/node-transforms.test.mjs +149 -0
- package/packages/agentsam-nav/dist/browser.global.js +71 -34
- package/packages/agentsam-nav/dist/browser.js +3179 -781
- package/packages/agentsam-nav/dist/index.js +3171 -773
- package/packages/agentsam-nav/package.json +1 -1
- package/packages/agentsam-queue-control/README.md +4 -1
- package/packages/agentsam-queue-control/package.json +4 -3
- package/packages/agentsam-queue-control/schemas/job-envelope.schema.json +111 -11
- package/packages/agentsam-queue-control/src/adapters/cloudflare.js +34 -6
- package/packages/agentsam-queue-control/src/adapters/memory.js +11 -2
- package/packages/agentsam-queue-control/src/adapters/sqlite.js +259 -0
- package/packages/agentsam-queue-control/src/contracts.js +207 -3
- package/packages/agentsam-queue-control/src/control-plane.js +62 -2
- package/packages/agentsam-queue-control/src/index.js +1 -0
- package/packages/agentsam-queue-control/test/queue-control.test.mjs +310 -0
- package/packages/agentsam-queue-control/test/sqlite-adapter.test.mjs +91 -0
- package/packages/agentsam-rapid-rust/README.md +3 -0
- package/packages/agentsam-repository/README.md +3 -0
- package/packages/agentsam-repository/package.json +1 -1
- package/packages/agentsam-vault/package.json +1 -1
- package/packages/agentsam-workbench/README.md +43 -0
- package/packages/agentsam-workbench/package.json +13 -3
- package/packages/agentsam-workbench/src/agent/AgentConversationSurface.tsx +108 -0
- package/packages/agentsam-workbench/src/agent/AgentPanel.tsx +25 -8
- package/packages/agentsam-workbench/src/agent/AgentRuntimeField.tsx +152 -0
- package/packages/agentsam-workbench/src/agent/Composer.tsx +10 -1
- package/packages/agentsam-workbench/src/agent/RunMode.ts +26 -0
- package/packages/agentsam-workbench/src/agent/Thread.tsx +18 -3
- package/packages/agentsam-workbench/src/agent/index.ts +3 -0
- package/packages/agentsam-workbench/src/index.ts +4 -0
- package/packages/agentsam-workbench/src/manufacturing/PreflightIndicator.tsx +203 -0
- package/packages/agentsam-workbench/src/manufacturing/index.ts +2 -0
- package/packages/agentsam-workbench/src/manufacturing/loading.ts +147 -0
- package/packages/agentsam-workbench/src/widgets/BuiltinWidget.tsx +22 -0
- package/packages/agentsam-workbench/src/widgets/CountdownWidget.tsx +68 -0
- package/packages/agentsam-workbench/src/widgets/WidgetFrame.tsx +56 -0
- package/packages/agentsam-workbench/src/widgets/countdown.ts +25 -0
- package/packages/agentsam-workbench/src/widgets/index.ts +6 -0
- package/packages/agentsam-workbench/src/widgets/registry.ts +13 -0
- package/packages/agentsam-workbench/src/widgets/useCountdown.ts +128 -0
- package/packages/agentsam-workbench/src/widgets/widgets.css +102 -0
- package/packages/connectors/{cloudflare → cfoa}/package.json +3 -3
- package/packages/heuristic-theme/package.json +1 -1
- package/packages/identity/README.md +3 -0
- package/packages/identity/backend/README.md +3 -0
- package/packages/identity/package.json +1 -1
- package/packages/identity/src/frontend/auth-portal/README.md +3 -0
- package/packages/identity/src/index.js +1 -1
- package/packages/identity/src/oauth/README.md +4 -1
- package/packages/identity/src/oauth/credentials.js +1 -1
- package/packages/identity/src/server/worker-router.js +1 -1
- package/packages/identity/tests/google-desktop-identity-login.test.mjs +1 -1
- package/packages/identity/tests/lane1-packed-consumer.test.mjs +1 -1
- package/packages/identity/tests/oauth-presets-accounts-ssot.test.mjs +1 -1
- package/packages/providers/completeful/package.json +1 -1
- package/packages/theme-church-site/package.json +1 -1
- package/packages/theme-companions-site/package.json +1 -1
- package/packages/theme-floors-site/package.json +1 -1
- package/packages/theme-fuelnfree-site/package.json +1 -1
- package/packages/theme-handyman-site/package.json +1 -1
- package/packages/theme-insurance-site/package.json +1 -1
- package/packages/theme-scenes/package.json +1 -1
- package/packages/theme-shinshu-site/package.json +1 -1
- package/packages/work-graph/package.json +1 -1
- package/protocol/models/README.md +3 -0
- package/protocol/receipts/agentsam.receipt.v1.json +95 -0
- package/protocol/theme-refinery/receipts/products-registry-batch-20260924.json +6 -6
- package/protocol/theme-refinery/receipts/theme-harvest-20260924.json +6 -6
- package/skills/README.md +3 -0
- package/src/acp/agent-executor.js +106 -0
- package/src/acp/client.js +316 -0
- package/src/acp/dependencies.js +426 -0
- package/src/acp/http.js +207 -0
- package/src/acp/index.js +22 -0
- package/src/acp/runs.js +125 -0
- package/src/acp/runtime-selection.js +180 -0
- package/src/cli/command-catalog.js +3 -0
- package/src/cli.js +24 -0
- package/src/commands/cloudflare-login.js +1 -1
- package/src/commands/cloudflare.js +2 -2
- package/src/commands/connections.js +1 -1
- package/src/commands/go.js +76 -6
- package/src/commands/merch.js +5 -0
- package/src/commands/mini.js +1 -1
- package/src/commands/receipts.js +140 -0
- package/src/commands/run.js +253 -0
- package/src/go/container.js +1 -1
- package/src/go/contract.js +61 -18
- package/src/go/discover.js +0 -4
- package/src/go/index.js +13 -1
- package/src/go/probe.js +109 -0
- package/src/go/{cloudflare.js → providers/cloudflare.js} +36 -136
- package/src/go/verify.js +1 -1
- package/src/indexing/ingest/inventory.js +1 -1
- package/src/lib/deploy/local-studio.js +2 -2
- package/src/lib/mini/scaffold.js +1 -1
- package/src/lib/whoami-capabilities.js +1 -1
- package/src/local/runtime-store.js +8 -0
- package/src/mcp/cloudflare-bundles.js +1 -1
- package/src/plugins/index.js +1 -0
- package/src/plugins/registry.js +59 -6
- package/src/receipts/contract.js +68 -0
- package/src/receipts/index.js +20 -0
- package/src/receipts/prune.js +64 -0
- package/src/receipts/sinks.js +285 -0
- package/templates/mini/gadget/app.js +15 -40
- package/templates/mini/gadget/index.html +7 -7
- package/templates/mini/shared/style.css +1 -1
- package/packages/agentsam-repository/src/goap.js.bak-20260922011251 +0 -670
- /package/packages/connectors/{cloudflare → cfoa}/OAUTH_STORAGE_AUDIT.md +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/api-client.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/capabilities.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/credential.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/brand-protection.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/keyless.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/pages.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/scanner.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/snippets.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/tag-gateway.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/tags.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/token-validation.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/vectorize.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/workflows.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/index.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/oauth-persist.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/owner.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/permission-options.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/routes.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/scope-catalog.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/vault.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/capabilities.test.mjs +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/connector.test.mjs +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/oauth-persist.test.mjs +0 -0
- /package/packages/identity/src/oauth/{google-desktop-exchange.js → goaude.js} +0 -0
package/src/acp/runs.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { appendAgentRunEvent, createLocalQueueControl } from './dependencies.js';
|
|
3
|
+
|
|
4
|
+
function clean(value) {
|
|
5
|
+
return value == null ? '' : String(value).trim();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function object(value) {
|
|
9
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Create a portable root AgentSam run and schedule it as an agent.run job.
|
|
14
|
+
*
|
|
15
|
+
* This is a control-plane operation only. It does not call a model. A runtime
|
|
16
|
+
* consumer later claims the queued job and performs execution.
|
|
17
|
+
*/
|
|
18
|
+
export async function createRootRun(database, {
|
|
19
|
+
runId = null,
|
|
20
|
+
accountId = null,
|
|
21
|
+
conversationId = null,
|
|
22
|
+
objective = '',
|
|
23
|
+
role = 'lead',
|
|
24
|
+
mode = 'agent',
|
|
25
|
+
modelKey = null,
|
|
26
|
+
reasoningEffort = null,
|
|
27
|
+
serviceTier = null,
|
|
28
|
+
runtimeRequirements = {},
|
|
29
|
+
metadata = {},
|
|
30
|
+
priority = 'normal',
|
|
31
|
+
sourceClient = 'agentsam-acp',
|
|
32
|
+
surface = 'control-plane',
|
|
33
|
+
} = {}) {
|
|
34
|
+
if (!database || typeof database.prepare !== 'function') {
|
|
35
|
+
throw new TypeError('database with prepare() is required');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const id = clean(runId) || `arun_${randomUUID()}`;
|
|
39
|
+
const account = clean(accountId) || 'local';
|
|
40
|
+
const now = Math.floor(Date.now() / 1000);
|
|
41
|
+
const resolvedMode = clean(mode) || 'agent';
|
|
42
|
+
const resolvedRole = clean(role) || 'lead';
|
|
43
|
+
const resolvedObjective = clean(objective);
|
|
44
|
+
const requirements = object(runtimeRequirements);
|
|
45
|
+
const meta = object(metadata);
|
|
46
|
+
|
|
47
|
+
await database.prepare(`
|
|
48
|
+
INSERT INTO agentsam_agent_run (
|
|
49
|
+
id, account_id, conversation_id, source_client, surface, mode, model_key,
|
|
50
|
+
reasoning_effort, requested_service_tier, selected_by, status,
|
|
51
|
+
created_at_unix, updated_at_unix
|
|
52
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 'automatic', 'queued', ?, ?)
|
|
53
|
+
`).bind(
|
|
54
|
+
id,
|
|
55
|
+
account,
|
|
56
|
+
clean(conversationId) || null,
|
|
57
|
+
clean(sourceClient) || 'agentsam-acp',
|
|
58
|
+
clean(surface) || 'control-plane',
|
|
59
|
+
resolvedMode,
|
|
60
|
+
clean(modelKey) || null,
|
|
61
|
+
clean(reasoningEffort) || null,
|
|
62
|
+
clean(serviceTier) || null,
|
|
63
|
+
now,
|
|
64
|
+
now,
|
|
65
|
+
).run();
|
|
66
|
+
|
|
67
|
+
await appendAgentRunEvent(database, {
|
|
68
|
+
runId: id,
|
|
69
|
+
eventType: 'run.created',
|
|
70
|
+
phase: 'boot',
|
|
71
|
+
label: 'Agent run created',
|
|
72
|
+
evidence: {
|
|
73
|
+
objective: resolvedObjective || null,
|
|
74
|
+
role: resolvedRole,
|
|
75
|
+
runtime_requirements: requirements,
|
|
76
|
+
},
|
|
77
|
+
dedupeKey: `root:${id}:created`,
|
|
78
|
+
createdAt: now,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
await appendAgentRunEvent(database, {
|
|
82
|
+
runId: id,
|
|
83
|
+
eventType: 'run.queued',
|
|
84
|
+
phase: 'boot',
|
|
85
|
+
label: 'Agent run queued',
|
|
86
|
+
evidence: { role: resolvedRole },
|
|
87
|
+
dedupeKey: `root:${id}:queued`,
|
|
88
|
+
createdAt: now,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const queueControl = createLocalQueueControl(database);
|
|
92
|
+
const queued = await queueControl.enqueue(
|
|
93
|
+
{
|
|
94
|
+
kind: 'agent.run',
|
|
95
|
+
account_id: account,
|
|
96
|
+
priority,
|
|
97
|
+
payload: {
|
|
98
|
+
run_id: id,
|
|
99
|
+
parent_run_id: null,
|
|
100
|
+
objective: resolvedObjective || null,
|
|
101
|
+
role: resolvedRole,
|
|
102
|
+
runtime_requirements: requirements,
|
|
103
|
+
metadata: meta,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: `job_agent_run_${id}`,
|
|
108
|
+
account_id: account,
|
|
109
|
+
source_run_id: id,
|
|
110
|
+
conversation_id: clean(conversationId) || null,
|
|
111
|
+
idempotency_key: `agent-run:${id}`,
|
|
112
|
+
priority,
|
|
113
|
+
metadata: meta,
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
schema: 'agentsam.run-start.v1',
|
|
119
|
+
run_id: id,
|
|
120
|
+
status: 'queued',
|
|
121
|
+
queue: queued.plan?.physical_queue || null,
|
|
122
|
+
queue_job: queued.job,
|
|
123
|
+
published: queued.published,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { capabilitiesSatisfy, RUNTIME_PROTOCOL_SCHEMA } from '../../packages/runtime-protocol/src/index.js';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_RUNNABLE_STATUSES = Object.freeze(['ready', 'online', 'sleeping']);
|
|
4
|
+
|
|
5
|
+
function clean(value) {
|
|
6
|
+
return value == null ? '' : String(value).trim();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function stringList(value) {
|
|
10
|
+
if (Array.isArray(value)) return value.map(clean).filter(Boolean);
|
|
11
|
+
const one = clean(value);
|
|
12
|
+
return one ? [one] : [];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function normalizeRequiredCapabilities(value = {}) {
|
|
16
|
+
if (Array.isArray(value)) {
|
|
17
|
+
return Object.freeze(Object.fromEntries(value.map(clean).filter(Boolean).map((key) => [key, true])));
|
|
18
|
+
}
|
|
19
|
+
if (!value || typeof value !== 'object') return Object.freeze({});
|
|
20
|
+
return Object.freeze(Object.fromEntries(
|
|
21
|
+
Object.entries(value).map(([key, enabled]) => [clean(key), Boolean(enabled)]).filter(([key]) => key),
|
|
22
|
+
));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function normalizeRuntimeRequirements(value = {}) {
|
|
26
|
+
const input = value && typeof value === 'object' ? value : {};
|
|
27
|
+
const exact = {};
|
|
28
|
+
for (const field of [
|
|
29
|
+
'provider',
|
|
30
|
+
'substrate',
|
|
31
|
+
'provider_product',
|
|
32
|
+
'lifecycle',
|
|
33
|
+
'runtime_adapter',
|
|
34
|
+
'architecture',
|
|
35
|
+
'os',
|
|
36
|
+
'transport',
|
|
37
|
+
'auth_mode',
|
|
38
|
+
]) {
|
|
39
|
+
const resolved = clean(input[field]);
|
|
40
|
+
if (resolved) exact[field] = resolved;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return Object.freeze({
|
|
44
|
+
schema: 'agentsam.runtime-requirements.v1',
|
|
45
|
+
exact: Object.freeze(exact),
|
|
46
|
+
capabilities: normalizeRequiredCapabilities(input.capabilities),
|
|
47
|
+
statuses: Object.freeze(
|
|
48
|
+
stringList(input.statuses ?? input.status).length
|
|
49
|
+
? stringList(input.statuses ?? input.status)
|
|
50
|
+
: [...DEFAULT_RUNNABLE_STATUSES],
|
|
51
|
+
),
|
|
52
|
+
preferredProviders: Object.freeze(stringList(input.preferred_providers ?? input.preferredProviders)),
|
|
53
|
+
preferredSubstrates: Object.freeze(stringList(input.preferred_substrates ?? input.preferredSubstrates)),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function unwrapRuntime(candidate) {
|
|
58
|
+
if (candidate?.runtime && typeof candidate.runtime === 'object') {
|
|
59
|
+
return { id: clean(candidate.id || candidate.runtime_id || candidate.runtime.id) || null, runtime: candidate.runtime };
|
|
60
|
+
}
|
|
61
|
+
return { id: clean(candidate?.id || candidate?.runtime_id) || null, runtime: candidate || {} };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function matchRuntimeCandidate(candidate, requirements = {}) {
|
|
65
|
+
const normalized = requirements?.schema === 'agentsam.runtime-requirements.v1'
|
|
66
|
+
? requirements
|
|
67
|
+
: normalizeRuntimeRequirements(requirements);
|
|
68
|
+
const { id, runtime } = unwrapRuntime(candidate);
|
|
69
|
+
const mismatches = [];
|
|
70
|
+
|
|
71
|
+
if (runtime.schema && runtime.schema !== RUNTIME_PROTOCOL_SCHEMA) {
|
|
72
|
+
mismatches.push({ field: 'schema', required: RUNTIME_PROTOCOL_SCHEMA, actual: runtime.schema });
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
for (const [field, required] of Object.entries(normalized.exact)) {
|
|
76
|
+
if (clean(runtime[field]) !== required) {
|
|
77
|
+
mismatches.push({ field, required, actual: clean(runtime[field]) || null });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const capabilityMatch = capabilitiesSatisfy(normalized.capabilities, runtime.capabilities || {});
|
|
82
|
+
for (const missing of capabilityMatch.missing) {
|
|
83
|
+
mismatches.push({ field: 'capabilities.' + missing, required: true, actual: runtime.capabilities?.[missing] ?? false });
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (normalized.statuses.length && !normalized.statuses.includes(clean(runtime.status))) {
|
|
87
|
+
mismatches.push({
|
|
88
|
+
field: 'status',
|
|
89
|
+
required: normalized.statuses,
|
|
90
|
+
actual: clean(runtime.status) || null,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return Object.freeze({
|
|
95
|
+
ok: mismatches.length === 0,
|
|
96
|
+
id,
|
|
97
|
+
runtime,
|
|
98
|
+
mismatches: Object.freeze(mismatches),
|
|
99
|
+
missingCapabilities: Object.freeze(capabilityMatch.missing),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function preferenceIndex(list, value) {
|
|
104
|
+
const index = list.indexOf(clean(value));
|
|
105
|
+
return index === -1 ? Number.MAX_SAFE_INTEGER : index;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function readinessIndex(status) {
|
|
109
|
+
const value = clean(status);
|
|
110
|
+
if (value === 'ready') return 0;
|
|
111
|
+
if (value === 'online') return 1;
|
|
112
|
+
if (value === 'sleeping') return 2;
|
|
113
|
+
return 3;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Hard-filter using agentsam.runtime.v1, then apply only explicit preferences.
|
|
118
|
+
* There is no cloud-provider-specific hidden score.
|
|
119
|
+
*/
|
|
120
|
+
export function selectRuntimeCandidate(candidates = [], requirements = {}) {
|
|
121
|
+
const normalized = normalizeRuntimeRequirements(requirements);
|
|
122
|
+
const evaluations = candidates.map((candidate, index) => ({
|
|
123
|
+
index,
|
|
124
|
+
candidate,
|
|
125
|
+
match: matchRuntimeCandidate(candidate, normalized),
|
|
126
|
+
}));
|
|
127
|
+
const eligible = evaluations.filter((row) => row.match.ok);
|
|
128
|
+
|
|
129
|
+
eligible.sort((a, b) => {
|
|
130
|
+
const ap = preferenceIndex(normalized.preferredProviders, a.match.runtime.provider);
|
|
131
|
+
const bp = preferenceIndex(normalized.preferredProviders, b.match.runtime.provider);
|
|
132
|
+
if (ap !== bp) return ap - bp;
|
|
133
|
+
|
|
134
|
+
const as = preferenceIndex(normalized.preferredSubstrates, a.match.runtime.substrate);
|
|
135
|
+
const bs = preferenceIndex(normalized.preferredSubstrates, b.match.runtime.substrate);
|
|
136
|
+
if (as !== bs) return as - bs;
|
|
137
|
+
|
|
138
|
+
const ar = readinessIndex(a.match.runtime.status);
|
|
139
|
+
const br = readinessIndex(b.match.runtime.status);
|
|
140
|
+
if (ar !== br) return ar - br;
|
|
141
|
+
|
|
142
|
+
const aid = a.match.id || '';
|
|
143
|
+
const bid = b.match.id || '';
|
|
144
|
+
if (aid && bid && aid !== bid) return aid.localeCompare(bid);
|
|
145
|
+
return a.index - b.index;
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
if (!eligible.length) {
|
|
149
|
+
const error = new Error('runtime_unavailable');
|
|
150
|
+
error.code = 'runtime_unavailable';
|
|
151
|
+
error.requirements = normalized;
|
|
152
|
+
error.diagnostics = evaluations.map(({ match }) => ({
|
|
153
|
+
id: match.id,
|
|
154
|
+
provider: match.runtime.provider ?? null,
|
|
155
|
+
substrate: match.runtime.substrate ?? null,
|
|
156
|
+
status: match.runtime.status ?? null,
|
|
157
|
+
mismatches: match.mismatches,
|
|
158
|
+
}));
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const selected = eligible[0].match;
|
|
163
|
+
return Object.freeze({
|
|
164
|
+
schema: 'agentsam.runtime-selection.v1',
|
|
165
|
+
runtime_id: selected.id,
|
|
166
|
+
runtime: selected.runtime,
|
|
167
|
+
requirements: normalized,
|
|
168
|
+
eligible_count: eligible.length,
|
|
169
|
+
rejected_count: evaluations.length - eligible.length,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function createRuntimeSelector({ listRuntimes } = {}) {
|
|
174
|
+
if (typeof listRuntimes !== 'function') throw new TypeError('listRuntimes function is required');
|
|
175
|
+
return async function resolveRuntime(requirements = {}, context = {}) {
|
|
176
|
+
const candidates = await listRuntimes(context);
|
|
177
|
+
if (!Array.isArray(candidates)) throw new TypeError('runtime registry must return an array');
|
|
178
|
+
return selectRuntimeCandidate(candidates, requirements);
|
|
179
|
+
};
|
|
180
|
+
}
|
|
@@ -16,6 +16,8 @@ export const CLI_COMMAND_CATALOG = Object.freeze([
|
|
|
16
16
|
{ id: 'machine', summary: 'Deterministic local machine perception (inspect / asset discovery)', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'machine.inspect', common: true },
|
|
17
17
|
{ id: 'engine', summary: 'Discover, audit, benchmark, and govern local AI engines', topic: 'runtime', skill: 'agentsam-app-fundamentals', operation: 'engine.audit', common: true },
|
|
18
18
|
{ id: 'package', summary: 'Audit, verify, and plan publication of distributable packages', topic: 'work', skill: 'agentsam-progression-guard', operation: 'package.audit', common: true, usage: ['agentsam package audit [--public] [--offline] [--json]', 'agentsam package status <name> [--offline] [--json]', 'agentsam package verify <name> [--offline] [--json]', 'agentsam package publish-plan [--offline] [--json]'] },
|
|
19
|
+
{ id: 'merch', summary: 'Preflight designs against portable manufacturing profiles', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'merch.preflight', common: true, usage: ['agentsam merch profiles', 'agentsam merch build <manifest.json> [--all-compatible]'] },
|
|
20
|
+
{ id: 'receipts', summary: 'Inspect receipt proofs and prune ephemeral AgentSam workdirs', topic: 'runtime', skill: 'agentsam-progression-guard', operation: 'receipts.inspect', common: true, usage: ['agentsam receipts list [--limit 20] [--repo <id>]', 'agentsam receipts show <receipt-id>', 'agentsam receipts failures [--repo <id>]', 'agentsam receipts prune [--max-tmp-gb 1.0] [--dry-run]'] },
|
|
19
21
|
{ id: 'capabilities', summary: 'Inspect capability contracts', topic: 'create', skill: 'agentsam-app-fundamentals' },
|
|
20
22
|
{
|
|
21
23
|
id: 'setup',
|
|
@@ -106,6 +108,7 @@ export const CLI_COMMAND_CATALOG = Object.freeze([
|
|
|
106
108
|
{ id: 'autorag', summary: 'AutoRAG configure/probe helpers', topic: 'work', skill: 'agentsam-codebaseindex' },
|
|
107
109
|
{ id: 'identity', summary: 'Identity portal, providers, protocol surfaces', topic: 'create', skill: 'agentsam-app-fundamentals' },
|
|
108
110
|
{ id: 'scaffold', summary: 'Generate CMS or worker-api starter', topic: 'create', skill: 'agentsam-jr-dev' },
|
|
111
|
+
{ id: 'run', aliases: ['runs'], summary: 'Inspect and control AgentSam runs across local or hosted control planes', topic: 'work', skill: 'agentsam-app-fundamentals' },
|
|
109
112
|
{ id: 'goap', summary: 'GOAP blackboard status/plan', topic: 'inside', skill: 'agentsam-app-fundamentals' },
|
|
110
113
|
{ id: 'app', aliases: ['apps'], summary: 'Bundled AgentSam apps launcher', topic: 'create', skill: 'agentsam-app-fundamentals' },
|
|
111
114
|
]);
|
package/src/cli.js
CHANGED
|
@@ -33,6 +33,8 @@ import { runMerkle } from './commands/merkle.js';
|
|
|
33
33
|
import { runDeployReceipt } from './commands/deploy-receipt.js';
|
|
34
34
|
import { runSecurity } from './commands/security.js';
|
|
35
35
|
import { runPackage } from './commands/package.js';
|
|
36
|
+
import { runMerch } from './commands/merch.js';
|
|
37
|
+
import { runReceipts } from './commands/receipts.js';
|
|
36
38
|
import { runRecon } from './commands/recon.js';
|
|
37
39
|
import { runCad } from './commands/cad.js';
|
|
38
40
|
import { runMachine } from './commands/machine.js';
|
|
@@ -59,6 +61,7 @@ import { runBilling } from './commands/billing.js';
|
|
|
59
61
|
import { runUpdate } from './commands/update.js';
|
|
60
62
|
import { runSetup } from './commands/setup.js';
|
|
61
63
|
import { runRuntime } from './commands/runtime.js';
|
|
64
|
+
import { runRun } from './commands/run.js';
|
|
62
65
|
import { applyPresetSelection, runAdd, runCapabilities, runDev, runInspect } from './commands/product.js';
|
|
63
66
|
import { listPresets, resolvePreset } from './presets/index.js';
|
|
64
67
|
import {
|
|
@@ -624,6 +627,13 @@ if (command === '--version' || command === '-v') {
|
|
|
624
627
|
if (!e?.reported) reportCliError(e);
|
|
625
628
|
process.exitCode = 1;
|
|
626
629
|
}
|
|
630
|
+
} else if (command === 'run' || command === 'runs') {
|
|
631
|
+
try {
|
|
632
|
+
await runRun(rest);
|
|
633
|
+
} catch (e) {
|
|
634
|
+
if (!e?.reported) reportCliError(e);
|
|
635
|
+
process.exitCode = 1;
|
|
636
|
+
}
|
|
627
637
|
} else if (command === 'rust' || command === 'wasm' || command === 'rapid-rust') {
|
|
628
638
|
try {
|
|
629
639
|
await runRust(rest);
|
|
@@ -756,6 +766,20 @@ if (command === '--version' || command === '-v') {
|
|
|
756
766
|
reportCliError(e);
|
|
757
767
|
process.exitCode = 1;
|
|
758
768
|
}
|
|
769
|
+
} else if (command === 'merch') {
|
|
770
|
+
try {
|
|
771
|
+
await runMerch(rest);
|
|
772
|
+
} catch (e) {
|
|
773
|
+
reportCliError(e);
|
|
774
|
+
process.exitCode = 1;
|
|
775
|
+
}
|
|
776
|
+
} else if (command === 'receipts') {
|
|
777
|
+
try {
|
|
778
|
+
await runReceipts(rest);
|
|
779
|
+
} catch (e) {
|
|
780
|
+
reportCliError(e);
|
|
781
|
+
process.exitCode = 1;
|
|
782
|
+
}
|
|
759
783
|
} else if (command === 'security' || command === 'sca') {
|
|
760
784
|
await runSecurity(rest);
|
|
761
785
|
} else if (command === 'skills') {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
getCloudflareFeaturePack,
|
|
17
17
|
scopesForFeaturePacks,
|
|
18
18
|
scopesForCapabilities,
|
|
19
|
-
} from '../../packages/connectors/
|
|
19
|
+
} from '../../packages/connectors/cfoa/src/index.js';
|
|
20
20
|
|
|
21
21
|
function clean(value) {
|
|
22
22
|
return value == null ? '' : String(value).trim();
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
tokenValidation,
|
|
22
22
|
pages,
|
|
23
23
|
snippets,
|
|
24
|
-
} from '../../packages/connectors/
|
|
25
|
-
import { AGENTSAM_TAG_VOCABULARY as TAG_VOCAB } from '../../packages/connectors/
|
|
24
|
+
} from '../../packages/connectors/cfoa/src/index.js';
|
|
25
|
+
import { AGENTSAM_TAG_VOCABULARY as TAG_VOCAB } from '../../packages/connectors/cfoa/src/families/tags.js';
|
|
26
26
|
import {
|
|
27
27
|
isCloudflareLoginFamily,
|
|
28
28
|
runCloudflareBrowserOAuthLogin,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
CLOUDFLARE_FIXTURE_CLIENT_ID,
|
|
8
8
|
cloudflareConnectionSafeStatus,
|
|
9
9
|
resolveCloudflareOAuthClient,
|
|
10
|
-
} from '../../packages/connectors/
|
|
10
|
+
} from '../../packages/connectors/cfoa/src/index.js';
|
|
11
11
|
import { resolveIamIssuer } from '../../packages/identity/src/contracts/auth-config.js';
|
|
12
12
|
import { collectRuntimeStatus } from './runtime-status.js';
|
|
13
13
|
|
package/src/commands/go.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { cancel, confirm, intro, isCancel, outro, select } from '@clack/prompts';
|
|
2
|
+
import { cancel, confirm, intro, isCancel, outro, select, text } from '@clack/prompts';
|
|
3
3
|
import pc from 'picocolors';
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_PRODUCT,
|
|
@@ -32,6 +32,7 @@ function parse(argv = []) {
|
|
|
32
32
|
skipDeploy: false,
|
|
33
33
|
skipRegistry: false,
|
|
34
34
|
accountId: null,
|
|
35
|
+
receiptRoot: null,
|
|
35
36
|
officialRelease: false,
|
|
36
37
|
yes: false,
|
|
37
38
|
help: false,
|
|
@@ -48,6 +49,7 @@ function parse(argv = []) {
|
|
|
48
49
|
else if (arg === '--official-release') out.officialRelease = true;
|
|
49
50
|
else if (arg === '--yes' || arg === '-y') out.yes = true;
|
|
50
51
|
else if (arg === '--account') out.accountId = String(argv[++i] || '').trim() || null;
|
|
52
|
+
else if (arg === '--receipt-root') out.receiptRoot = String(argv[++i] || '').trim() || null;
|
|
51
53
|
else if (arg === '--cwd') out.cwd = path.resolve(argv[++i] || out.cwd);
|
|
52
54
|
else if (arg === '--cloudflare') {
|
|
53
55
|
out.cloudflare = true;
|
|
@@ -106,6 +108,7 @@ const HELP = `Agent Sam · Go
|
|
|
106
108
|
|
|
107
109
|
Flags:
|
|
108
110
|
--account <id> Explicit Cloudflare account target
|
|
111
|
+
--receipt-root <path> Base directory for AgentSam Go receipts/state
|
|
109
112
|
--yes, -y Confirm a live non-interactive deployment
|
|
110
113
|
--json Machine-readable output
|
|
111
114
|
--dry-run Build/probe + Wrangler dry-run; no live deploy or InnerAnimalMedia registry write
|
|
@@ -180,9 +183,13 @@ export async function runGo(argv = [], options = {}) {
|
|
|
180
183
|
|
|
181
184
|
const discovery = discoverGoRuntime(args.cwd);
|
|
182
185
|
const productRoot = resolveProductRoot(discovery, args.product);
|
|
183
|
-
|
|
186
|
+
|
|
187
|
+
let stateRoot = options.stateRoot
|
|
184
188
|
? path.resolve(options.stateRoot)
|
|
185
|
-
:
|
|
189
|
+
: args.receiptRoot
|
|
190
|
+
? path.resolve(args.cwd, args.receiptRoot)
|
|
191
|
+
: resolveGoStateRoot(discovery, args.cwd);
|
|
192
|
+
|
|
186
193
|
const runtimeRoot = discovery.runtime?.runtimeRoot || path.join(productRoot, 'runtime');
|
|
187
194
|
|
|
188
195
|
if (args.subcommand === 'menu' && process.stdout.isTTY && !args.json) {
|
|
@@ -485,7 +492,7 @@ async function shipCloudflare({ discovery, productRoot, stateRoot, runtimeRoot,
|
|
|
485
492
|
}
|
|
486
493
|
|
|
487
494
|
const preflight = preflightToolchain({
|
|
488
|
-
requireDocker: !args.skipDeploy,
|
|
495
|
+
requireDocker: !args.skipDeploy && !args.dryRun,
|
|
489
496
|
productRoot,
|
|
490
497
|
});
|
|
491
498
|
for (const check of preflight.checks) {
|
|
@@ -519,7 +526,7 @@ async function shipCloudflare({ discovery, productRoot, stateRoot, runtimeRoot,
|
|
|
519
526
|
note('✓ native runtime boot/probe/shutdown');
|
|
520
527
|
|
|
521
528
|
let container = null;
|
|
522
|
-
if (!args.skipDeploy) {
|
|
529
|
+
if (!args.skipDeploy && !args.dryRun) {
|
|
523
530
|
if (!args.json) write('\n Container\n');
|
|
524
531
|
container = await verifyGoContainer({
|
|
525
532
|
productRoot,
|
|
@@ -634,6 +641,62 @@ async function shipCloudflare({ discovery, productRoot, stateRoot, runtimeRoot,
|
|
|
634
641
|
|
|
635
642
|
async function runInteractiveMenu({ discovery, productRoot, stateRoot, runtimeRoot, args, write }) {
|
|
636
643
|
intro(pc.bgCyan(pc.black(' Agent Sam · Go ')));
|
|
644
|
+
|
|
645
|
+
const receiptChoice = await select({
|
|
646
|
+
message: 'Where should AgentSam Go store run receipts?',
|
|
647
|
+
options: [
|
|
648
|
+
{
|
|
649
|
+
value: 'project',
|
|
650
|
+
label: 'This project',
|
|
651
|
+
hint: path.join(stateRoot, '.agentsam', 'go'),
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
value: 'home',
|
|
655
|
+
label: 'Central AgentSam receipts folder',
|
|
656
|
+
hint: '~/.agentsam/receipts',
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
value: 'custom',
|
|
660
|
+
label: 'Choose another folder',
|
|
661
|
+
},
|
|
662
|
+
],
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
if (isCancel(receiptChoice)) {
|
|
666
|
+
cancel('Cancelled.');
|
|
667
|
+
return { ok: false, cancelled: true };
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
if (receiptChoice === 'home') {
|
|
671
|
+
stateRoot = path.join(
|
|
672
|
+
process.env.HOME || process.env.USERPROFILE || stateRoot,
|
|
673
|
+
'.agentsam',
|
|
674
|
+
'receipts',
|
|
675
|
+
path.basename(path.resolve(args.cwd)),
|
|
676
|
+
);
|
|
677
|
+
} else if (receiptChoice === 'custom') {
|
|
678
|
+
const customRoot = await text({
|
|
679
|
+
message: 'Receipt/state base directory',
|
|
680
|
+
placeholder: '/path/to/agentsam-receipts',
|
|
681
|
+
validate(value) {
|
|
682
|
+
return String(value || '').trim()
|
|
683
|
+
? undefined
|
|
684
|
+
: 'Enter a directory.';
|
|
685
|
+
},
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
if (isCancel(customRoot)) {
|
|
689
|
+
cancel('Cancelled.');
|
|
690
|
+
return { ok: false, cancelled: true };
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
stateRoot = path.resolve(
|
|
694
|
+
String(customRoot).replace(/^~(?=\/|$)/, process.env.HOME || '~'),
|
|
695
|
+
);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
write(`\n Receipts\n ${path.join(stateRoot, '.agentsam', 'go')}\n`);
|
|
699
|
+
|
|
637
700
|
const status = readLatestStatus(stateRoot);
|
|
638
701
|
write(`\n Runtime\n`);
|
|
639
702
|
write(` ${discovery.go?.ok ? '✓' : '✗'} Go ${discovery.go?.goversion || ''}\n`);
|
|
@@ -671,7 +734,14 @@ async function runInteractiveMenu({ discovery, productRoot, stateRoot, runtimeRo
|
|
|
671
734
|
return { ok: false, cancelled: true };
|
|
672
735
|
}
|
|
673
736
|
outro(`Running ${action}`);
|
|
674
|
-
const forwarded = [
|
|
737
|
+
const forwarded = [
|
|
738
|
+
action,
|
|
739
|
+
args.product,
|
|
740
|
+
'--cwd',
|
|
741
|
+
args.cwd,
|
|
742
|
+
'--receipt-root',
|
|
743
|
+
stateRoot,
|
|
744
|
+
];
|
|
675
745
|
if (action === 'deploy') forwarded.push('--cloudflare');
|
|
676
746
|
if (args.json) forwarded.push('--json');
|
|
677
747
|
return runGo(forwarded, { write });
|
package/src/commands/mini.js
CHANGED
|
@@ -7,7 +7,7 @@ export function printMiniHelp() {
|
|
|
7
7
|
console.log(`
|
|
8
8
|
agentsam mini — small local gadgets and prototypes
|
|
9
9
|
|
|
10
|
-
agentsam mini <name> Create and preview a
|
|
10
|
+
agentsam mini <name> Create and preview a small interactive prototype
|
|
11
11
|
agentsam mini <name> --template page Create and preview a simple page
|
|
12
12
|
agentsam mini <name> --template data Create and preview a JSON viewer
|
|
13
13
|
agentsam mini <name> --write-only Create files without starting anything
|