@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
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import assert from 'node:assert/strict';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import test from 'node:test';
|
|
6
|
+
import { createLocalSqliteDatabase } from '../../../src/local/sqlite.js';
|
|
7
|
+
import { applyRuntimeMigrations } from '../../../src/local/migrations.js';
|
|
8
|
+
import {
|
|
9
|
+
SqliteQueueAdapter,
|
|
10
|
+
QueueControl,
|
|
11
|
+
buildQueueTopology,
|
|
12
|
+
createJobEnvelope,
|
|
13
|
+
} from '../src/index.js';
|
|
14
|
+
|
|
15
|
+
async function fixture() {
|
|
16
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'agentsam-queue-sqlite-'));
|
|
17
|
+
const db = await createLocalSqliteDatabase(path.join(dir, 'agentsam.sqlite'));
|
|
18
|
+
await applyRuntimeMigrations(db);
|
|
19
|
+
return { dir, db, close: () => db.close() };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
test('SQLite adapter persists delayed work and leases due jobs without polling models', async (t) => {
|
|
23
|
+
const fx = await fixture();
|
|
24
|
+
t.after(fx.close);
|
|
25
|
+
const topology = buildQueueTopology({ namespace: 'test', environment: 'local' });
|
|
26
|
+
const adapter = new SqliteQueueAdapter({ database: fx.db, leaseOwner: 'worker-a', leaseTtlSeconds: 30 });
|
|
27
|
+
const control = new QueueControl({ adapter, topology });
|
|
28
|
+
|
|
29
|
+
const enqueued = await control.enqueue(
|
|
30
|
+
{ kind: 'repository.index', account_id: 'acct_1' },
|
|
31
|
+
{
|
|
32
|
+
account_id: 'acct_1',
|
|
33
|
+
id: 'job_delayed',
|
|
34
|
+
available_at: 120,
|
|
35
|
+
created_at: 100,
|
|
36
|
+
idempotency_key: 'idx:repo:a',
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
const queue = enqueued.plan.physical_queue;
|
|
40
|
+
|
|
41
|
+
assert.equal(await adapter.depth(queue), 1);
|
|
42
|
+
assert.deepEqual(await adapter.pull(queue, 1, { now: 119 }), []);
|
|
43
|
+
|
|
44
|
+
const first = await adapter.pull(queue, 1, { now: 120, owner: 'worker-a', ttl_seconds: 30 });
|
|
45
|
+
assert.equal(first.length, 1);
|
|
46
|
+
assert.equal(first[0].status, 'claimed');
|
|
47
|
+
assert.equal(first[0].lease_owner, 'worker-a');
|
|
48
|
+
assert.equal(first[0].lease_expires_at, 150);
|
|
49
|
+
assert.equal(first[0].lease_generation, 1);
|
|
50
|
+
|
|
51
|
+
assert.deepEqual(await adapter.pull(queue, 1, { now: 149, owner: 'worker-b' }), []);
|
|
52
|
+
|
|
53
|
+
const reclaimed = await adapter.pull(queue, 1, { now: 150, owner: 'worker-b', ttl_seconds: 20 });
|
|
54
|
+
assert.equal(reclaimed.length, 1);
|
|
55
|
+
assert.equal(reclaimed[0].lease_owner, 'worker-b');
|
|
56
|
+
assert.equal(reclaimed[0].lease_generation, 2);
|
|
57
|
+
|
|
58
|
+
const ack = await adapter.ack(reclaimed[0], { status: 'completed', result: { indexed: 3 }, now: 151 });
|
|
59
|
+
assert.equal(ack.updated, 1);
|
|
60
|
+
assert.equal(await adapter.depth(queue), 0);
|
|
61
|
+
assert.equal((await adapter.get('job_delayed')).status, 'completed');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('SQLite adapter deduplicates stable idempotency keys across repeated enqueue attempts', async (t) => {
|
|
65
|
+
const fx = await fixture();
|
|
66
|
+
t.after(fx.close);
|
|
67
|
+
const adapter = new SqliteQueueAdapter({ database: fx.db });
|
|
68
|
+
const queue = 'agentsam-local-jobs';
|
|
69
|
+
|
|
70
|
+
const first = createJobEnvelope({
|
|
71
|
+
id: 'job_a',
|
|
72
|
+
account_id: 'acct_1',
|
|
73
|
+
kind: 'deployment.poll',
|
|
74
|
+
idempotency_key: 'deploy:123',
|
|
75
|
+
created_at: 10,
|
|
76
|
+
});
|
|
77
|
+
const duplicate = createJobEnvelope({
|
|
78
|
+
id: 'job_b',
|
|
79
|
+
account_id: 'acct_1',
|
|
80
|
+
kind: 'deployment.poll',
|
|
81
|
+
idempotency_key: 'deploy:123',
|
|
82
|
+
created_at: 11,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
assert.equal((await adapter.publish(queue, first)).accepted, 1);
|
|
86
|
+
const second = await adapter.publish(queue, duplicate);
|
|
87
|
+
assert.equal(second.accepted, 0);
|
|
88
|
+
assert.equal(second.deduplicated, true);
|
|
89
|
+
assert.equal(second.existing_job_id, 'job_a');
|
|
90
|
+
assert.equal(await adapter.depth(queue), 1);
|
|
91
|
+
});
|
|
@@ -3,3 +3,6 @@
|
|
|
3
3
|
Native Rust CLI source for `agentsam rust` / `agentsam-rapid-rust`.
|
|
4
4
|
|
|
5
5
|
It scaffolds Cloudflare `workers-rs` projects, performs local Wasm checks/builds, runs Wrangler locally, and gates live deployment behind an explicit `--yes`. Compiled binaries are not committed; use `scripts/build_rapid_rust_cli.py` to build/install one.
|
|
6
|
+
|
|
7
|
+
<!-- agentsam:trademark-notice -->
|
|
8
|
+
> Independent project. Not affiliated with, endorsed by, or sponsored by Cloudflare, Inc. or by any other company whose products are named here. Cloudflare is a registered trademark of Cloudflare, Inc. Other names are trademarks of their respective owners. See [TRADEMARKS](https://github.com/SamPrimeaux/agentsam-sdk/blob/main/TRADEMARKS.md).
|
|
@@ -13,3 +13,6 @@ It owns deterministic repository identity and Merkle behavior that must be reusa
|
|
|
13
13
|
It does **not** own authenticated account sessions, CLI commands, UI rendering, knowledge retrieval, deployment orchestration, or product application state. Those layers consume this package through explicit imports.
|
|
14
14
|
|
|
15
15
|
The workspace is private while the extraction stabilizes. Cross-repository consumers should continue using the published `@inneranimalmedia/agentsam-sdk` facade until this package receives its own release policy.
|
|
16
|
+
|
|
17
|
+
<!-- agentsam:trademark-notice -->
|
|
18
|
+
> Independent project. Not affiliated with, endorsed by, or sponsored by Cloudflare, Inc. or by any other company whose products are named here. Cloudflare is a registered trademark of Cloudflare, Inc. Other names are trademarks of their respective owners. See [TRADEMARKS](https://github.com/SamPrimeaux/agentsam-sdk/blob/main/TRADEMARKS.md).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneranimalmedia/agentsam-repository",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.11",
|
|
4
4
|
"description": "Portable AgentSam repository identity, Merkle, semantic file metadata, persistence, and repository graph runtime contracts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneranimalmedia/agentsam-vault",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgentSam credential vault core — contracts, AES-GCM crypto, provider registry, resolver. UI lives in agentsam-key-manager.",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -22,3 +22,46 @@ values are withheld. Cross-origin and sandboxed iframe contents are not inspecte
|
|
|
22
22
|
their host frame may be selected as a contextual resource. Mark semantic ancestors
|
|
23
23
|
with `data-agentsam-resource` and excluded controls with `data-annotation-control`.
|
|
24
24
|
Local Studio stages the annotation in its active conversation draft for review.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Conversation and runtime surfaces
|
|
28
|
+
|
|
29
|
+
`AgentConversationSurface` is the portable thread + persistent-composer ownership
|
|
30
|
+
boundary. Product apps provide state and actions; the surface guarantees that
|
|
31
|
+
moving between an empty conversation and an active thread does not replace the
|
|
32
|
+
composer DOM ownership.
|
|
33
|
+
|
|
34
|
+
`AgentRuntimeField` projects `@inneranimalmedia/agentsam-loading-scene` into the
|
|
35
|
+
same surface. A lead thread and each co-worker may bind separate controllers, so
|
|
36
|
+
parallel work can show independent semantic scenes and task narration without
|
|
37
|
+
duplicating renderer code in product apps.
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
<AgentConversationSurface
|
|
41
|
+
empty={messages.length === 0}
|
|
42
|
+
runtime={<AgentRuntimeField controller={runtimeController} />}
|
|
43
|
+
thread={<AgentThread messages={messages} />}
|
|
44
|
+
composer={<AgentComposer {...composerProps} />}
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The workbench owns presentation mechanics. The host still owns model/provider
|
|
49
|
+
selection, tool execution, persistence, permissions, runtime events, queueing and
|
|
50
|
+
cancel semantics.
|
|
51
|
+
|
|
52
|
+
## Widgets
|
|
53
|
+
|
|
54
|
+
`@inneranimalmedia/agentsam-workbench/widgets` is the shared widget surface:
|
|
55
|
+
`WidgetFrame` (size/state chrome around any widget body), `useCountdown`, and
|
|
56
|
+
`CountdownWidget`. Widget identity — kind, sizes, data source, deep link — comes
|
|
57
|
+
from the framework-neutral contracts in `@inneranimalmedia/agentsam-contracts/widgets`.
|
|
58
|
+
|
|
59
|
+
Countdown time authority is an absolute deadline, not accumulated interval
|
|
60
|
+
ticks: remaining time is derived from `Date.now()` on every render tick, so a
|
|
61
|
+
sleeping or backgrounded tab cannot corrupt the timer. Import
|
|
62
|
+
`@inneranimalmedia/agentsam-workbench/widgets/widgets.css` once in the host;
|
|
63
|
+
the widget tokens inherit the host theme.
|
|
64
|
+
|
|
65
|
+
Widgets are app-native primitives, not installable prebuilds — the host decides
|
|
66
|
+
where a widget appears and what its data means. Local Studio's `/widgets`
|
|
67
|
+
utilities surface is the proof consumer.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneranimalmedia/agentsam-workbench",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.11",
|
|
4
4
|
"description": "Reusable AgentSam workbench primitives for agent threads, composer, browser, terminal and resizable work surfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,16 @@
|
|
|
36
36
|
"./agent/mini-agentsam.css": "./dist/agent/mini-agentsam.css",
|
|
37
37
|
"./agent/contextual-composer.css": "./dist/agent/contextual-composer.css",
|
|
38
38
|
"./agent/tool-permission.css": "./dist/agent/tool-permission.css",
|
|
39
|
-
"./project-control.css": "./dist/project-control.css"
|
|
39
|
+
"./project-control.css": "./dist/project-control.css",
|
|
40
|
+
"./manufacturing": {
|
|
41
|
+
"types": "./dist/manufacturing/index.d.ts",
|
|
42
|
+
"import": "./dist/manufacturing/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./widgets": {
|
|
45
|
+
"types": "./dist/widgets/index.d.ts",
|
|
46
|
+
"import": "./dist/widgets/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./widgets/widgets.css": "./dist/widgets/widgets.css"
|
|
40
49
|
},
|
|
41
50
|
"scripts": {
|
|
42
51
|
"typecheck": "node scripts/ensure-local-deps.mjs && tsc --noEmit -p tsconfig.json",
|
|
@@ -45,7 +54,8 @@
|
|
|
45
54
|
"prepack": "npm run build"
|
|
46
55
|
},
|
|
47
56
|
"dependencies": {
|
|
48
|
-
"@inneranimalmedia/agentsam-contracts": "2.6.
|
|
57
|
+
"@inneranimalmedia/agentsam-contracts": "2.6.11",
|
|
58
|
+
"@inneranimalmedia/agentsam-loading-scene": "2.6.11"
|
|
49
59
|
},
|
|
50
60
|
"peerDependencies": {
|
|
51
61
|
"react": ">=18",
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export type AgentConversationSurfaceProps = {
|
|
4
|
+
empty?: boolean;
|
|
5
|
+
thread: ReactNode;
|
|
6
|
+
composer: ReactNode;
|
|
7
|
+
emptyState?: ReactNode;
|
|
8
|
+
runtime?: ReactNode;
|
|
9
|
+
status?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
bodyClassName?: string;
|
|
12
|
+
composerClassName?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Portable thread + persistent composer surface.
|
|
18
|
+
*
|
|
19
|
+
* The composer slot is never conditionally removed when a conversation moves
|
|
20
|
+
* from empty/startup to active. Hosts can restyle the surface, but the DOM
|
|
21
|
+
* ownership contract remains stable across web/desktop/product adapters.
|
|
22
|
+
*/
|
|
23
|
+
export function AgentConversationSurface({
|
|
24
|
+
empty = false,
|
|
25
|
+
thread,
|
|
26
|
+
composer,
|
|
27
|
+
emptyState,
|
|
28
|
+
runtime,
|
|
29
|
+
status,
|
|
30
|
+
className,
|
|
31
|
+
bodyClassName,
|
|
32
|
+
composerClassName,
|
|
33
|
+
style,
|
|
34
|
+
}: AgentConversationSurfaceProps) {
|
|
35
|
+
return (
|
|
36
|
+
<section
|
|
37
|
+
className={className}
|
|
38
|
+
data-agent-conversation-surface=""
|
|
39
|
+
data-agent-conversation-empty={empty ? 'true' : 'false'}
|
|
40
|
+
style={{
|
|
41
|
+
position: 'relative',
|
|
42
|
+
display: 'flex',
|
|
43
|
+
minWidth: 0,
|
|
44
|
+
minHeight: 0,
|
|
45
|
+
flex: 1,
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
...style,
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{runtime}
|
|
52
|
+
|
|
53
|
+
<div
|
|
54
|
+
className={bodyClassName}
|
|
55
|
+
data-agent-conversation-body=""
|
|
56
|
+
data-agent-conversation-body-empty={empty ? 'true' : 'false'}
|
|
57
|
+
style={{
|
|
58
|
+
display: 'flex',
|
|
59
|
+
minWidth: 0,
|
|
60
|
+
minHeight: 0,
|
|
61
|
+
flex: '1 1 auto',
|
|
62
|
+
flexDirection: 'column',
|
|
63
|
+
overflow: 'hidden',
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
{empty ? (
|
|
67
|
+
emptyState ? (
|
|
68
|
+
<div
|
|
69
|
+
data-agent-conversation-empty-state=""
|
|
70
|
+
style={{
|
|
71
|
+
display: 'flex',
|
|
72
|
+
minWidth: 0,
|
|
73
|
+
minHeight: 0,
|
|
74
|
+
flex: '1 1 auto',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{emptyState}
|
|
80
|
+
</div>
|
|
81
|
+
) : null
|
|
82
|
+
) : (
|
|
83
|
+
thread
|
|
84
|
+
)}
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
{status ? (
|
|
88
|
+
<div data-agent-conversation-status="" style={{ flexShrink: 0 }}>
|
|
89
|
+
{status}
|
|
90
|
+
</div>
|
|
91
|
+
) : null}
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
className={composerClassName}
|
|
95
|
+
data-agent-conversation-composer=""
|
|
96
|
+
style={{
|
|
97
|
+
position: 'relative',
|
|
98
|
+
zIndex: 2,
|
|
99
|
+
width: '100%',
|
|
100
|
+
flexShrink: 0,
|
|
101
|
+
}}
|
|
102
|
+
>
|
|
103
|
+
{composer}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
</section>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -3,6 +3,7 @@ import type { AgentMessage, ModelOption } from '@inneranimalmedia/agentsam-contr
|
|
|
3
3
|
import { AgentThread } from './Thread';
|
|
4
4
|
import { AgentComposer } from './Composer';
|
|
5
5
|
import { AgentModelSelect } from './ModelSelect';
|
|
6
|
+
import { AgentConversationSurface } from './AgentConversationSurface';
|
|
6
7
|
|
|
7
8
|
export interface AgentPanelProps {
|
|
8
9
|
messages: AgentMessage[];
|
|
@@ -24,17 +25,33 @@ export function AgentPanel(props: AgentPanelProps) {
|
|
|
24
25
|
const modelControl = props.models?.length && props.selectedModelId && props.onModelChange
|
|
25
26
|
? <AgentModelSelect value={props.selectedModelId} models={props.models} onChange={props.onModelChange} />
|
|
26
27
|
: null;
|
|
28
|
+
const thread = (
|
|
29
|
+
<AgentThread
|
|
30
|
+
messages={props.messages}
|
|
31
|
+
streaming={props.streaming}
|
|
32
|
+
renderMessage={props.renderMessage}
|
|
33
|
+
empty={props.empty}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
const composer = (
|
|
37
|
+
<AgentComposer
|
|
38
|
+
value={props.draft}
|
|
39
|
+
onChange={props.onDraftChange}
|
|
40
|
+
onSend={props.onSend}
|
|
41
|
+
onCancel={props.onCancel}
|
|
42
|
+
streaming={props.streaming}
|
|
43
|
+
toolbarStart={modelControl}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
|
|
27
47
|
return (
|
|
28
48
|
<section className={props.className} data-agent-panel="">
|
|
29
49
|
{props.header}
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
onCancel={props.onCancel}
|
|
36
|
-
streaming={props.streaming}
|
|
37
|
-
toolbarStart={modelControl}
|
|
50
|
+
<AgentConversationSurface
|
|
51
|
+
empty={props.messages.length === 0}
|
|
52
|
+
thread={thread}
|
|
53
|
+
composer={composer}
|
|
54
|
+
emptyState={props.empty}
|
|
38
55
|
/>
|
|
39
56
|
</section>
|
|
40
57
|
);
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { useEffect, useRef, type CSSProperties } from 'react';
|
|
2
|
+
import type {
|
|
3
|
+
LoadingSceneController,
|
|
4
|
+
ScenePreset,
|
|
5
|
+
} from '@inneranimalmedia/agentsam-loading-scene';
|
|
6
|
+
import {
|
|
7
|
+
HyperspaceRenderer,
|
|
8
|
+
computationalHyperspace,
|
|
9
|
+
} from '@inneranimalmedia/agentsam-loading-scene';
|
|
10
|
+
import {
|
|
11
|
+
LoadingSceneNarration,
|
|
12
|
+
useLoadingScene,
|
|
13
|
+
} from '@inneranimalmedia/agentsam-loading-scene/react';
|
|
14
|
+
|
|
15
|
+
export type AgentRuntimeFieldProps = {
|
|
16
|
+
controller: LoadingSceneController;
|
|
17
|
+
preset?: ScenePreset;
|
|
18
|
+
blocking?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
activeOpacity?: number;
|
|
22
|
+
passiveOpacity?: number;
|
|
23
|
+
narration?: boolean;
|
|
24
|
+
narrationStyle?: CSSProperties;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Reusable workbench runtime surface.
|
|
29
|
+
*
|
|
30
|
+
* Product apps own runtime state and event production. This primitive owns the
|
|
31
|
+
* presentation contract: one persistent semantic scene, task-aware narration,
|
|
32
|
+
* resize handling and blocking/non-blocking composition.
|
|
33
|
+
*/
|
|
34
|
+
export function AgentRuntimeField({
|
|
35
|
+
controller,
|
|
36
|
+
preset = computationalHyperspace,
|
|
37
|
+
blocking = false,
|
|
38
|
+
className,
|
|
39
|
+
style,
|
|
40
|
+
activeOpacity = 1,
|
|
41
|
+
passiveOpacity = 0.34,
|
|
42
|
+
narration = true,
|
|
43
|
+
narrationStyle,
|
|
44
|
+
}: AgentRuntimeFieldProps) {
|
|
45
|
+
const scene = useLoadingScene(controller);
|
|
46
|
+
const hostRef = useRef<HTMLDivElement | null>(null);
|
|
47
|
+
const canvasRef = useRef<HTMLCanvasElement | null>(null);
|
|
48
|
+
const rendererRef = useRef<HyperspaceRenderer | null>(null);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const host = hostRef.current;
|
|
52
|
+
const canvas = canvasRef.current;
|
|
53
|
+
if (!host || !canvas) return;
|
|
54
|
+
|
|
55
|
+
const renderer = new HyperspaceRenderer(preset, {
|
|
56
|
+
canvas,
|
|
57
|
+
reducedMotion: 'auto',
|
|
58
|
+
});
|
|
59
|
+
rendererRef.current = renderer;
|
|
60
|
+
|
|
61
|
+
const fit = () => renderer.setSize(host.clientWidth, host.clientHeight);
|
|
62
|
+
fit();
|
|
63
|
+
|
|
64
|
+
const observer =
|
|
65
|
+
typeof ResizeObserver !== 'undefined' ? new ResizeObserver(fit) : null;
|
|
66
|
+
observer?.observe(host);
|
|
67
|
+
renderer.setScene(controller.getScene());
|
|
68
|
+
|
|
69
|
+
return () => {
|
|
70
|
+
observer?.disconnect();
|
|
71
|
+
renderer.dispose();
|
|
72
|
+
rendererRef.current = null;
|
|
73
|
+
};
|
|
74
|
+
}, [controller, preset]);
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
const renderer = rendererRef.current;
|
|
78
|
+
if (!renderer) return;
|
|
79
|
+
|
|
80
|
+
renderer.setScene(scene);
|
|
81
|
+
if (
|
|
82
|
+
scene.status === 'running' ||
|
|
83
|
+
scene.status === 'waiting' ||
|
|
84
|
+
scene.status === 'error'
|
|
85
|
+
) {
|
|
86
|
+
renderer.resume();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const timeout = window.setTimeout(
|
|
91
|
+
() => renderer.suspend(),
|
|
92
|
+
preset.transition.settleMs + 300,
|
|
93
|
+
);
|
|
94
|
+
return () => window.clearTimeout(timeout);
|
|
95
|
+
}, [scene, preset]);
|
|
96
|
+
|
|
97
|
+
const active =
|
|
98
|
+
blocking ||
|
|
99
|
+
scene.status === 'running' ||
|
|
100
|
+
scene.status === 'waiting' ||
|
|
101
|
+
scene.status === 'error';
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div
|
|
105
|
+
ref={hostRef}
|
|
106
|
+
data-agent-runtime-field=""
|
|
107
|
+
aria-hidden={active ? undefined : true}
|
|
108
|
+
className={className}
|
|
109
|
+
style={{
|
|
110
|
+
position: 'absolute',
|
|
111
|
+
inset: 0,
|
|
112
|
+
overflow: 'hidden',
|
|
113
|
+
pointerEvents: blocking ? 'auto' : 'none',
|
|
114
|
+
opacity: active ? 1 : 0,
|
|
115
|
+
transition: 'opacity 500ms ease',
|
|
116
|
+
background: blocking ? preset.palette.canvas : 'transparent',
|
|
117
|
+
...style,
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<canvas
|
|
121
|
+
ref={canvasRef}
|
|
122
|
+
aria-hidden="true"
|
|
123
|
+
style={{
|
|
124
|
+
position: 'absolute',
|
|
125
|
+
inset: 0,
|
|
126
|
+
width: '100%',
|
|
127
|
+
height: '100%',
|
|
128
|
+
opacity: blocking ? activeOpacity : passiveOpacity,
|
|
129
|
+
}}
|
|
130
|
+
/>
|
|
131
|
+
|
|
132
|
+
{active && narration ? (
|
|
133
|
+
<LoadingSceneNarration
|
|
134
|
+
controller={controller}
|
|
135
|
+
preset={preset}
|
|
136
|
+
align={blocking ? 'center' : 'start'}
|
|
137
|
+
showStudy
|
|
138
|
+
showMeta
|
|
139
|
+
style={{
|
|
140
|
+
position: 'absolute',
|
|
141
|
+
left: blocking ? '50%' : 18,
|
|
142
|
+
top: blocking ? '50%' : 'auto',
|
|
143
|
+
bottom: blocking ? 'auto' : 18,
|
|
144
|
+
transform: blocking ? 'translate(-50%, -50%)' : undefined,
|
|
145
|
+
pointerEvents: 'none',
|
|
146
|
+
...narrationStyle,
|
|
147
|
+
}}
|
|
148
|
+
/>
|
|
149
|
+
) : null}
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useRef, type KeyboardEvent, type ReactNode, type TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import type { AgentRunMode } from '@inneranimalmedia/agentsam-contracts';
|
|
2
3
|
|
|
3
4
|
export interface AgentComposerProps {
|
|
4
5
|
value: string;
|
|
@@ -17,6 +18,8 @@ export interface AgentComposerProps {
|
|
|
17
18
|
toolbarClassName?: string;
|
|
18
19
|
textareaProps?: Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'value' | 'onChange' | 'placeholder'>;
|
|
19
20
|
maxHeight?: number;
|
|
21
|
+
/** Semantic run mode. Hosts own behavior; the primitive exposes it for accessible styling. */
|
|
22
|
+
runMode?: AgentRunMode;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
/**
|
|
@@ -43,6 +46,7 @@ export function AgentComposer({
|
|
|
43
46
|
toolbarClassName,
|
|
44
47
|
textareaProps,
|
|
45
48
|
maxHeight = 220,
|
|
49
|
+
runMode = 'agent',
|
|
46
50
|
}: AgentComposerProps) {
|
|
47
51
|
const areaRef = useRef<HTMLTextAreaElement>(null);
|
|
48
52
|
|
|
@@ -66,7 +70,12 @@ export function AgentComposer({
|
|
|
66
70
|
const defaultStop = <button type="button" onClick={() => void onCancel?.()}>Stop</button>;
|
|
67
71
|
|
|
68
72
|
return (
|
|
69
|
-
<div
|
|
73
|
+
<div
|
|
74
|
+
className={containerClassName}
|
|
75
|
+
data-agent-composer=""
|
|
76
|
+
data-agent-mode={runMode}
|
|
77
|
+
aria-busy={streaming || undefined}
|
|
78
|
+
>
|
|
70
79
|
<textarea
|
|
71
80
|
{...textareaProps}
|
|
72
81
|
ref={areaRef}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentRunMode } from '@inneranimalmedia/agentsam-contracts';
|
|
2
|
+
|
|
3
|
+
export type AgentRunModeTone = 'blue' | 'yellow' | 'red' | 'multicolor' | 'green';
|
|
4
|
+
|
|
5
|
+
export type AgentRunModeProfile = Readonly<{
|
|
6
|
+
id: AgentRunMode;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
tone: AgentRunModeTone;
|
|
10
|
+
}>;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Presentation metadata for the canonical AgentSam run modes.
|
|
14
|
+
* Runtime meaning remains owned by @inneranimalmedia/agentsam-contracts.
|
|
15
|
+
*/
|
|
16
|
+
export const AGENT_RUN_MODE_PROFILES: readonly AgentRunModeProfile[] = Object.freeze([
|
|
17
|
+
{ id: 'agent', label: 'Agent', description: 'Execute and open surfaces', tone: 'blue' },
|
|
18
|
+
{ id: 'plan', label: 'Plan', description: 'Design technical plans', tone: 'yellow' },
|
|
19
|
+
{ id: 'debug', label: 'Debug', description: 'Inspect, prove, and fix', tone: 'red' },
|
|
20
|
+
{ id: 'multitask', label: 'Multitask', description: 'Coordinate managed workflows', tone: 'multicolor' },
|
|
21
|
+
{ id: 'ask', label: 'Ask', description: 'Talk and answer questions', tone: 'green' },
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
export function agentRunModeProfile(mode: AgentRunMode): AgentRunModeProfile {
|
|
25
|
+
return AGENT_RUN_MODE_PROFILES.find((profile) => profile.id === mode) ?? AGENT_RUN_MODE_PROFILES[0]!;
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useRef, type ReactNode, type UIEvent } from 'react';
|
|
1
|
+
import { useEffect, useRef, type CSSProperties, type ReactNode, type UIEvent } from 'react';
|
|
2
2
|
import type { AgentMessage } from '@inneranimalmedia/agentsam-contracts';
|
|
3
3
|
|
|
4
4
|
export interface AgentThreadProps {
|
|
@@ -8,6 +8,8 @@ export interface AgentThreadProps {
|
|
|
8
8
|
empty?: ReactNode;
|
|
9
9
|
scrollerClassName?: string;
|
|
10
10
|
listClassName?: string;
|
|
11
|
+
scrollerStyle?: CSSProperties;
|
|
12
|
+
listStyle?: CSSProperties;
|
|
11
13
|
stickThreshold?: number;
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -18,6 +20,8 @@ export function AgentThread({
|
|
|
18
20
|
empty = null,
|
|
19
21
|
scrollerClassName,
|
|
20
22
|
listClassName,
|
|
23
|
+
scrollerStyle,
|
|
24
|
+
listStyle,
|
|
21
25
|
stickThreshold = 80,
|
|
22
26
|
}: AgentThreadProps) {
|
|
23
27
|
const scroller = useRef<HTMLDivElement>(null);
|
|
@@ -35,8 +39,19 @@ export function AgentThread({
|
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
return (
|
|
38
|
-
<div
|
|
39
|
-
|
|
42
|
+
<div
|
|
43
|
+
ref={scroller}
|
|
44
|
+
className={scrollerClassName}
|
|
45
|
+
data-agent-thread=""
|
|
46
|
+
onScroll={onScroll}
|
|
47
|
+
style={
|
|
48
|
+
scrollerStyle ??
|
|
49
|
+
(scrollerClassName
|
|
50
|
+
? undefined
|
|
51
|
+
: { minHeight: 0, flex: 1, overflowY: 'auto' })
|
|
52
|
+
}
|
|
53
|
+
>
|
|
54
|
+
<div className={listClassName} style={listStyle}>
|
|
40
55
|
{messages.length === 0
|
|
41
56
|
? empty
|
|
42
57
|
: messages.map((message, index) =>
|
|
@@ -2,6 +2,7 @@ export * from './AgentPanel';
|
|
|
2
2
|
export * from './Thread';
|
|
3
3
|
export * from './Composer';
|
|
4
4
|
export * from './ModelSelect';
|
|
5
|
+
export * from './RunMode';
|
|
5
6
|
export * from './ToolReceipt';
|
|
6
7
|
export * from './ArtifactCard';
|
|
7
8
|
export * from './ConnectedAgentPanel';
|
|
@@ -10,3 +11,5 @@ export * from './MiniAgentSam';
|
|
|
10
11
|
export * from './ContextualComposer';
|
|
11
12
|
|
|
12
13
|
export * from './ToolPermissionRequest';
|
|
14
|
+
export * from './AgentConversationSurface';
|
|
15
|
+
export * from './AgentRuntimeField';
|