@inneranimalmedia/agentsam-sdk 2.6.3 → 2.6.4
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/AGENTSAM.md +6 -0
- package/README.md +16 -1
- package/bin/agentsam +16 -1
- package/docs/BRAND_INTELLIGENCE.md +1 -1
- package/docs/architecture/AGENTSAM_DISTRIBUTION_OWNERSHIP.md +176 -0
- package/docs/architecture/AGENTSAM_GO_RUNTIME.md +282 -0
- package/docs/architecture/CODEBASEINDEX_GUIDED_PATH.md +202 -0
- package/docs/architecture/FS_E2E_CLOSURE_RECEIPT.md +59 -0
- package/docs/architecture/LOCAL_FS_AUTHORITY.md +38 -0
- package/docs/architecture/LOCAL_STUDIO_CLOUDFLARE_OAUTH.md +28 -0
- package/docs/architecture/PLAN_CLI_AND_LOCAL_STUDIO_DESKTOP.md +96 -0
- package/docs/architecture/SAM_ACTIVITY_RECOVERY_RECEIPT.md +39 -0
- package/docs/architecture/SAM_DECISION_WORK_RECEIPT.md +54 -0
- package/docs/architecture/SAM_KERNEL.md +181 -0
- package/docs/architecture/SAM_MACHINE_NORMALIZATION_PRECOMMIT_REPORT.md +208 -0
- package/docs/architecture/SLASH_SKILLS_PORTABLE.md +116 -0
- package/docs/architecture/fs-e2e-receipt.latest.json +42 -0
- package/docs/architecture/previews/codebaseindex-guided-path/CODEBASEINDEX_GUIDED_PATH.md +202 -0
- package/docs/architecture/previews/codebaseindex-guided-path/index.html +321 -0
- package/migrations/d1/0010_portable_tickets_memory.sql +140 -0
- package/migrations/d1/0011_agentsam_skill_v2.sql +185 -0
- package/migrations/d1/0011b_agentsam_skill_v2_cutover.sql +22 -0
- package/migrations/d1/0011c_agentsam_skill_v2_backfill.sql +76 -0
- package/migrations/d1/0011d_agentsam_skill_v2_retrieval_revisions.sql +50 -0
- package/migrations/d1/0012_agentsam_tools_required_seed.sql +67 -0
- package/migrations/d1/0013_identity_oauth_states.sql +15 -0
- package/migrations/d1/0014_auth_event_log.sql +20 -0
- package/migrations/d1/0015_identity_oauth_state_app_id.sql +3 -0
- package/migrations/d1/README_PORTABLE_CONTROL_PLANE.md +16 -0
- package/migrations/sqlite/agentsam_skill_retrieval.portable.sql +42 -0
- package/package.json +19 -4
- package/packages/agentsam-contracts/src/errors.ts +16 -0
- package/packages/agentsam-errors/src/envelope.js +53 -0
- package/packages/agentsam-errors/src/index.js +1 -0
- package/packages/agentsam-errors/src/recovery.js +301 -0
- package/packages/agentsam-knowledge/src/providers/index.js +18 -6
- package/packages/connectors/cloudflare/src/routes.js +9 -0
- package/packages/connectors/cloudflare/tests/connector.test.mjs +26 -1
- package/packages/identity/.agentsam/features/oauth-login-portal/agentsam.feature.json +1 -1
- package/packages/identity/.agentsam/features/oauth-login-portal/routes.json +11 -2
- package/packages/identity/docs/PORTABLE_IDENTITY_ARCHITECTURE.md +50 -0
- package/packages/identity/migrations/D1_SCHEMA_MAPPING.md +31 -0
- package/packages/identity/migrations/sqlite/001_identity_core.sql +99 -0
- package/packages/identity/migrations/sqlite/002_identity_oauth_client.sql +38 -0
- package/packages/identity/migrations/sqlite/003_identity_oauth_server.sql +64 -0
- package/packages/identity/package.json +2 -2
- package/packages/identity/src/adapters/cloudflare-d1/index.js +122 -22
- package/packages/identity/src/adapters/sqlite/index.js +319 -0
- package/packages/identity/src/app/verify-app.js +95 -0
- package/packages/identity/src/contracts/identity-store.js +115 -0
- package/packages/identity/src/contracts/route-ids.js +30 -0
- package/packages/identity/src/contracts/route-projection.js +218 -0
- package/packages/identity/src/contracts/routes.js +11 -0
- package/packages/identity/src/core/browser-paths.js +4 -5
- package/packages/identity/src/core/constants.js +13 -8
- package/packages/identity/src/core/session-policy.js +32 -0
- package/packages/identity/src/frontend/auth-portal/pages/login.html +10 -10
- package/packages/identity/src/frontend/auth-portal/pages/reset.html +3 -3
- package/packages/identity/src/frontend/auth-portal/pages/signup.html +3 -3
- package/packages/identity/src/frontend/auth-portal/preview/dashboard-stub.html +1 -1
- package/packages/identity/src/index.js +25 -0
- package/packages/identity/src/oauth/README.md +10 -4
- package/packages/identity/src/oauth/credentials.js +20 -13
- package/packages/identity/src/oauth/finalize-inbound.js +1 -1
- package/packages/identity/src/oauth/iam-platform.js +8 -7
- package/packages/identity/src/oauth/redirect-paths.js +27 -36
- package/packages/identity/src/server/identity-service.js +30 -13
- package/packages/identity/src/server/mount-policy.js +30 -0
- package/packages/identity/src/server/post-auth.js +79 -0
- package/packages/identity/src/server/worker-router.js +104 -72
- package/packages/identity/tests/finalize-inbound-oauth.test.mjs +6 -6
- package/packages/identity/tests/iam-provider.test.mjs +1 -1
- package/packages/identity/tests/identity-service.test.mjs +36 -5
- package/packages/identity/tests/oauth-credentials.test.mjs +3 -1
- package/packages/identity/tests/portable-identity-architecture.test.mjs +157 -0
- package/packages/identity/tests/session-routes-policy.test.mjs +21 -0
- package/packages/theme-church-site/package.json +2 -1
- package/packages/theme-church-site/src/index.js +1 -0
- package/packages/theme-companions-site/package.json +2 -1
- package/packages/theme-companions-site/src/index.js +1 -0
- package/packages/theme-floors-site/package.json +2 -1
- package/packages/theme-floors-site/src/index.js +1 -0
- package/packages/theme-fuelnfree-site/package.json +2 -1
- package/packages/theme-fuelnfree-site/src/index.js +1 -0
- package/packages/theme-handyman-site/package.json +2 -1
- package/packages/theme-handyman-site/src/index.js +1 -0
- package/packages/theme-insurance-site/package.json +2 -1
- package/packages/theme-insurance-site/src/index.js +1 -0
- package/packages/theme-shinshu-site/package.json +2 -1
- package/packages/theme-shinshu-site/src/index.js +1 -0
- package/protocol/apps/agentsam.app.v1.schema.json +51 -0
- package/protocol/brand/brandpack.v1.schema.json +43 -0
- package/protocol/credentials/issue.v1.schema.json +38 -0
- package/protocol/database/connection.v1.schema.json +41 -0
- package/protocol/embeddings/embedding-profile.v1.schema.json +20 -0
- package/protocol/errors/error-envelope.schema.json +135 -1
- package/protocol/errors/recovery.v1.schema.json +50 -0
- package/protocol/runtime/workspace-fs.v1.schema.json +71 -0
- package/protocol/sam/activity.v1.schema.json +48 -0
- package/protocol/sam/answer.v1.schema.json +35 -0
- package/protocol/sam/calibration.v1.schema.json +21 -0
- package/protocol/sam/decision-receipt.v1.schema.json +29 -0
- package/protocol/sam/evaluation.v1.schema.json +19 -0
- package/protocol/sam/operation.schema.json +66 -0
- package/protocol/sam/outcome.v1.schema.json +36 -0
- package/protocol/sam/question.v1.schema.json +26 -0
- package/protocol/sam/registry.seed.json +153 -0
- package/protocol/sam/result.schema.json +53 -0
- package/protocol/sam/state.v1.schema.json +23 -0
- package/protocol/skills/agentsam.interaction.v1.schema.json +50 -0
- package/protocol/skills/agentsam.skill.v1.schema.json +57 -0
- package/protocol/ui/icon-registry.mjs +226 -0
- package/protocol/ui/icon.v1.schema.json +51 -0
- package/skills/README.md +22 -9
- package/skills/agentsam-codebaseindex/SKILL.md +225 -0
- package/skills/catalog.json +14 -0
- package/src/cli/command-catalog.js +130 -0
- package/src/cli/dispatch.js +48 -0
- package/src/cli.js +43 -1
- package/src/commands/api-key.js +244 -0
- package/src/commands/app.js +60 -28
- package/src/commands/brand.js +17 -19
- package/src/commands/codebaseindex.js +688 -0
- package/src/commands/env.js +152 -25
- package/src/commands/go.js +366 -53
- package/src/commands/interaction-clack.js +115 -0
- package/src/commands/models.js +1 -1
- package/src/commands/providers.js +62 -14
- package/src/commands/shell.js +43 -2
- package/src/commands/skill.js +248 -0
- package/src/commands/skills.js +1 -1
- package/src/commands/start-local.js +4 -0
- package/src/commands/whoami.js +90 -18
- package/src/go/build.js +229 -39
- package/src/go/cloudflare.js +506 -105
- package/src/go/container.js +120 -0
- package/src/go/contract.js +9 -4
- package/src/go/discover.js +149 -33
- package/src/go/index.js +15 -3
- package/src/go/native-probe-runner.mjs +119 -0
- package/src/go/{registry.js → official-registry.js} +64 -7
- package/src/go/official-release.js +10 -0
- package/src/go/receipts.js +77 -10
- package/src/go/verify.js +9 -2
- package/src/index.js +27 -0
- package/src/indexing/ingest/discover-models.js +298 -0
- package/src/indexing/ingest/inventory.js +243 -0
- package/src/indexing/ingest/job-graph.js +181 -0
- package/src/indexing/ingest/materials.js +210 -0
- package/src/lib/provider-credentials.js +63 -21
- package/src/lib/slash-commands.js +1 -0
- package/src/local-fs/capability.js +121 -0
- package/src/local-fs/freshness.js +75 -0
- package/src/local-fs/index.js +385 -0
- package/src/local-fs/paths.js +100 -0
- package/src/local-pty/server.js +295 -19
- package/src/mcp/client.js +2 -2
- package/src/models/ai-access-onboarding.js +112 -0
- package/src/models/discovery.js +10 -2
- package/src/models/inventory-core.js +9 -1
- package/src/sam/activity/index.js +183 -0
- package/src/sam/client.js +252 -0
- package/src/sam/decision/calibration.js +109 -0
- package/src/sam/decision/confidence.js +126 -0
- package/src/sam/decision/evaluate.js +157 -0
- package/src/sam/decision/evaluators/deterministic.js +341 -0
- package/src/sam/decision/evaluators/heuristic.js +61 -0
- package/src/sam/decision/evaluators/select.js +50 -0
- package/src/sam/decision/evaluators/semantic.js +149 -0
- package/src/sam/decision/hierarchical.js +61 -0
- package/src/sam/decision/index.js +53 -0
- package/src/sam/decision/policy.js +86 -0
- package/src/sam/decision/questions.js +120 -0
- package/src/sam/decision/receipt.js +148 -0
- package/src/sam/decision/state.js +117 -0
- package/src/sam/decision/types.js +22 -0
- package/src/sam/decision/validate.js +200 -0
- package/src/sam/define.js +51 -0
- package/src/sam/index.js +65 -0
- package/src/sam/operations/brand-scan.js +62 -0
- package/src/sam/operations/cad-blender-inspect.js +36 -0
- package/src/sam/operations/codebaseindex-ingest.js +49 -0
- package/src/sam/operations/decision-evaluate.js +59 -0
- package/src/sam/operations/planning-astar.js +77 -0
- package/src/sam/operations/planning-goap.js +60 -0
- package/src/sam/operations/repository-inspect.js +72 -0
- package/src/sam/operations/security-scan.js +33 -0
- package/src/sam/operations/terminal-exec.js +29 -0
- package/src/sam/planning/astar.js +311 -0
- package/src/sam/planning/goap.js +177 -0
- package/src/sam/planning/index.js +21 -0
- package/src/sam/planning/state.js +84 -0
- package/src/sam/registry.js +48 -0
- package/src/sam/result.js +77 -0
- package/src/sam/seed.js +44 -0
- package/src/sam/types.js +91 -0
- package/src/skills/catalog.js +64 -0
- package/src/skills/content-resolver.js +124 -0
- package/src/skills/hosted-store.js +37 -0
- package/src/skills/index.js +29 -64
- package/src/skills/interaction.js +102 -0
- package/src/skills/local-store.js +228 -0
- package/src/skills/manifest.js +104 -0
- package/src/skills/metrics.js +31 -0
- package/src/skills/registry.js +184 -0
- package/src/skills/runtime.js +287 -0
- package/src/skills/slash.js +44 -0
- package/src/ui/cli/help.js +94 -101
- package/test/cli/api-key-env-whoami.test.mjs +129 -0
- package/test/cli/codebaseindex-plan-ux.test.mjs +37 -0
- package/test/cli/go.test.mjs +62 -5
- package/test/cli/skill-npm-and-env.test.mjs +52 -0
- package/test/cli/wireframes-go-registry.test.mjs +87 -2
- package/test/go/build-source-identity.test.mjs +31 -0
- package/test/go/cloudflare-probe.test.mjs +274 -10
- package/test/go/distribution.test.mjs +28 -0
- package/test/integration/ai-access-onboarding.test.mjs +47 -0
- package/test/integration/cli-help.test.mjs +1 -1
- package/test/integration/cms-site-tenancy-contract.test.mjs +6 -6
- package/test/integration/codebaseindex-ingest.test.mjs +166 -0
- package/test/integration/icon-registry.test.mjs +67 -0
- package/test/integration/ingest-discover-models.test.mjs +30 -0
- package/test/integration/install-script.test.mjs +12 -9
- package/test/integration/local-fs.test.mjs +113 -0
- package/test/integration/provider-env-cli.test.mjs +2 -1
- package/test/integration/sam-activity-recovery.test.mjs +147 -0
- package/test/integration/sam-decision.test.mjs +584 -0
- package/test/integration/sam-kernel.test.mjs +99 -0
- package/test/integration/sam-planning-astar.test.mjs +279 -0
- package/test/integration/skill-runtime.test.mjs +240 -0
- package/test/integration/studio-fs-pty-e2e.test.mjs +294 -0
- package/test/models.test.mjs +14 -7
- package/test/shell.test.mjs +4 -4
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": 1,
|
|
3
|
+
"package": "@inneranimalmedia/agentsam-sdk",
|
|
4
|
+
"sam": "Systems Automation Machinery",
|
|
5
|
+
"note": "Seed registry — canonical operation IDs. CLI aliases are projections, not authority.",
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"id": "repository.inspect",
|
|
9
|
+
"module": "repository",
|
|
10
|
+
"action": "inspect",
|
|
11
|
+
"summary": "Inspect repository structure and semantic evidence.",
|
|
12
|
+
"execution": {
|
|
13
|
+
"lanes": ["local", "remote", "sandbox"],
|
|
14
|
+
"model": "never",
|
|
15
|
+
"network": "none",
|
|
16
|
+
"sideEffects": "none"
|
|
17
|
+
},
|
|
18
|
+
"risk": "read_only",
|
|
19
|
+
"capabilities": ["repository.snapshot"],
|
|
20
|
+
"cli": { "command": [["inspect"]] },
|
|
21
|
+
"status": "stable"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "brand.scan",
|
|
25
|
+
"module": "brand",
|
|
26
|
+
"action": "scan",
|
|
27
|
+
"summary": "Inspect repository material and derive brand evidence.",
|
|
28
|
+
"execution": {
|
|
29
|
+
"lanes": ["local", "remote", "sandbox"],
|
|
30
|
+
"model": "never",
|
|
31
|
+
"network": "none",
|
|
32
|
+
"sideEffects": "none"
|
|
33
|
+
},
|
|
34
|
+
"risk": "read_only",
|
|
35
|
+
"capabilities": ["brand.scan"],
|
|
36
|
+
"cli": { "command": [["brand", "scan"]] },
|
|
37
|
+
"status": "stable"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "security.scan",
|
|
41
|
+
"module": "security",
|
|
42
|
+
"action": "scan",
|
|
43
|
+
"summary": "Scan project dependencies and trust boundary (SCA).",
|
|
44
|
+
"execution": {
|
|
45
|
+
"lanes": ["local", "remote", "sandbox"],
|
|
46
|
+
"model": "never",
|
|
47
|
+
"network": "optional",
|
|
48
|
+
"sideEffects": "none"
|
|
49
|
+
},
|
|
50
|
+
"risk": "read_only",
|
|
51
|
+
"capabilities": ["security.scan"],
|
|
52
|
+
"cli": { "command": [["security", "scan"], ["sca", "scan"]] },
|
|
53
|
+
"status": "stable"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"id": "terminal.exec",
|
|
57
|
+
"module": "terminal",
|
|
58
|
+
"action": "exec",
|
|
59
|
+
"summary": "Execute a bounded argv process inside the project root.",
|
|
60
|
+
"execution": {
|
|
61
|
+
"lanes": ["local", "sandbox"],
|
|
62
|
+
"model": "never",
|
|
63
|
+
"network": "optional",
|
|
64
|
+
"sideEffects": "local_write"
|
|
65
|
+
},
|
|
66
|
+
"risk": "write",
|
|
67
|
+
"capabilities": ["terminal.exec"],
|
|
68
|
+
"cli": { "command": [] },
|
|
69
|
+
"status": "stable"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "cad.blender.inspect",
|
|
73
|
+
"module": "cad",
|
|
74
|
+
"action": "blender.inspect",
|
|
75
|
+
"summary": "Inspect an existing Blender source (.blend).",
|
|
76
|
+
"execution": {
|
|
77
|
+
"lanes": ["local", "remote", "sandbox"],
|
|
78
|
+
"model": "never",
|
|
79
|
+
"network": "none",
|
|
80
|
+
"sideEffects": "none"
|
|
81
|
+
},
|
|
82
|
+
"risk": "read_only",
|
|
83
|
+
"capabilities": ["blender.inspect"],
|
|
84
|
+
"cli": { "command": [["cad", "blender", "inspect"]] },
|
|
85
|
+
"status": "stable"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"id": "codebaseindex.ingest",
|
|
89
|
+
"module": "codebaseindex",
|
|
90
|
+
"action": "ingest",
|
|
91
|
+
"summary": "Ingest repository and/or dropped materials into the knowledge index.",
|
|
92
|
+
"execution": {
|
|
93
|
+
"lanes": ["local", "remote", "platform"],
|
|
94
|
+
"model": "optional",
|
|
95
|
+
"network": "optional",
|
|
96
|
+
"sideEffects": "local_write"
|
|
97
|
+
},
|
|
98
|
+
"risk": "write",
|
|
99
|
+
"capabilities": ["knowledge.index"],
|
|
100
|
+
"cli": { "command": [["codebaseindex"], ["ingest"]] },
|
|
101
|
+
"pipeline": "sam.codebaseindex.index.run",
|
|
102
|
+
"status": "stable"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "planning.astar",
|
|
106
|
+
"module": "planning",
|
|
107
|
+
"action": "astar",
|
|
108
|
+
"summary": "Deterministic A* planner (f = g + h).",
|
|
109
|
+
"execution": {
|
|
110
|
+
"lanes": ["local", "remote", "sandbox"],
|
|
111
|
+
"model": "never",
|
|
112
|
+
"network": "none",
|
|
113
|
+
"sideEffects": "none"
|
|
114
|
+
},
|
|
115
|
+
"risk": "read_only",
|
|
116
|
+
"capabilities": ["planning.astar"],
|
|
117
|
+
"cli": { "command": [] },
|
|
118
|
+
"status": "stable"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "planning.goap",
|
|
122
|
+
"module": "planning",
|
|
123
|
+
"action": "goap",
|
|
124
|
+
"summary": "GOAP adapter over A* with preconditions and effects.",
|
|
125
|
+
"execution": {
|
|
126
|
+
"lanes": ["local", "remote", "sandbox"],
|
|
127
|
+
"model": "never",
|
|
128
|
+
"network": "none",
|
|
129
|
+
"sideEffects": "none"
|
|
130
|
+
},
|
|
131
|
+
"risk": "read_only",
|
|
132
|
+
"capabilities": ["planning.goap", "planning.astar"],
|
|
133
|
+
"cli": { "command": [] },
|
|
134
|
+
"status": "stable"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "decision.evaluate",
|
|
138
|
+
"module": "decision",
|
|
139
|
+
"action": "evaluate",
|
|
140
|
+
"summary": "Evaluate choose/score/check questions against a SAM decision state.",
|
|
141
|
+
"execution": {
|
|
142
|
+
"lanes": ["local", "remote", "sandbox"],
|
|
143
|
+
"model": "optional",
|
|
144
|
+
"network": "optional",
|
|
145
|
+
"sideEffects": "none"
|
|
146
|
+
},
|
|
147
|
+
"risk": "read_only",
|
|
148
|
+
"capabilities": ["decision.evaluate"],
|
|
149
|
+
"cli": { "command": [] },
|
|
150
|
+
"status": "stable"
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentsam.inneranimalmedia.com/protocol/sam/result.schema.json",
|
|
4
|
+
"title": "SamResult",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schema", "operation", "ok", "data", "receipt"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema": { "const": "agentsam.result.v1" },
|
|
10
|
+
"operation": { "type": "string" },
|
|
11
|
+
"ok": { "type": "boolean" },
|
|
12
|
+
"data": {},
|
|
13
|
+
"receipt": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["id", "operation", "started_at", "completed_at", "execution", "status"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"id": { "type": "string" },
|
|
19
|
+
"operation": { "type": "string" },
|
|
20
|
+
"module": { "type": "string" },
|
|
21
|
+
"started_at": { "type": "string" },
|
|
22
|
+
"completed_at": { "type": "string" },
|
|
23
|
+
"execution": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"required": ["lane", "deterministic", "model_used"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"lane": { "enum": ["local", "remote", "sandbox", "platform"] },
|
|
28
|
+
"deterministic": { "type": "boolean" },
|
|
29
|
+
"model_used": { "type": "boolean" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"side_effects": { "type": "array", "items": { "type": "string" } },
|
|
33
|
+
"input_hash": { "type": ["string", "null"] },
|
|
34
|
+
"output_hash": { "type": ["string", "null"] },
|
|
35
|
+
"status": { "enum": ["completed", "failed", "cancelled"] }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"evidence": { "type": "array" },
|
|
39
|
+
"artifacts": { "type": "array" },
|
|
40
|
+
"usage": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"properties": {
|
|
43
|
+
"provider_calls": { "type": "integer", "minimum": 0 },
|
|
44
|
+
"input_tokens": { "type": "integer" },
|
|
45
|
+
"output_tokens": { "type": "integer" },
|
|
46
|
+
"cost_usd": { "type": "number" }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"warnings": { "type": "array" },
|
|
50
|
+
"diagnostics": { "type": "array" },
|
|
51
|
+
"error": {}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://agentsam.inneranimalmedia.com/protocol/sam/state.v1.schema.json",
|
|
4
|
+
"title": "AgentSamDecisionState",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schema"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schema": { "const": "agentsam.decision-state.v1" },
|
|
9
|
+
"intent": {},
|
|
10
|
+
"goal": {},
|
|
11
|
+
"repository": { "type": ["object", "null"] },
|
|
12
|
+
"code": { "type": ["object", "null"] },
|
|
13
|
+
"runtime": { "type": ["object", "null"] },
|
|
14
|
+
"tools": {},
|
|
15
|
+
"skills": {},
|
|
16
|
+
"models": {},
|
|
17
|
+
"constraints": { "type": ["object", "null"] },
|
|
18
|
+
"evidence": { "type": "array" },
|
|
19
|
+
"history": {},
|
|
20
|
+
"metadata": { "type": "object" },
|
|
21
|
+
"facts": { "type": "object" }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "agentsam.interaction.v1",
|
|
4
|
+
"title": "AgentSamInteraction",
|
|
5
|
+
"description": "Host-agnostic interaction contract for CLI (Clack), Local Studio, Tauri, and other AgentSam surfaces.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["status"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"status": {
|
|
11
|
+
"enum": ["ready", "needs_input", "needs_approval", "blocked", "complete"]
|
|
12
|
+
},
|
|
13
|
+
"prompt": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"required": ["kind", "message"],
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"properties": {
|
|
18
|
+
"kind": {
|
|
19
|
+
"enum": ["info", "text", "select", "multiselect", "confirm", "error"]
|
|
20
|
+
},
|
|
21
|
+
"code": { "type": "string" },
|
|
22
|
+
"title": { "type": "string" },
|
|
23
|
+
"message": { "type": "string" },
|
|
24
|
+
"options": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["value", "label"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"value": { "type": "string" },
|
|
31
|
+
"label": { "type": "string" },
|
|
32
|
+
"description": { "type": "string" }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"actions": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"required": ["id", "label"],
|
|
41
|
+
"properties": {
|
|
42
|
+
"id": { "type": "string" },
|
|
43
|
+
"label": { "type": "string" }
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "agentsam.skill.v1",
|
|
4
|
+
"title": "AgentSamSkillManifest",
|
|
5
|
+
"description": "Portable AgentSam skill definition. Identity is package/local id — not workspace, tenant, R2 key, or default model.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["schema", "id", "name", "instructions"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema": { "const": "agentsam.skill.v1" },
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
14
|
+
},
|
|
15
|
+
"name": { "type": "string", "minLength": 1 },
|
|
16
|
+
"description": { "type": "string" },
|
|
17
|
+
"icon": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Semantic agentsam.icon.v1 key only"
|
|
20
|
+
},
|
|
21
|
+
"version": { "type": "string" },
|
|
22
|
+
"package": { "type": "string" },
|
|
23
|
+
"slash": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"properties": {
|
|
27
|
+
"suggested": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"pattern": "^/[a-z0-9][a-z0-9-]{0,63}$",
|
|
30
|
+
"description": "Suggested trigger at install time. Not globally reserved."
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"instructions": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"required": ["source"],
|
|
37
|
+
"additionalProperties": false,
|
|
38
|
+
"properties": {
|
|
39
|
+
"source": {
|
|
40
|
+
"enum": ["inline", "local_file", "package_file", "database", "object_store"]
|
|
41
|
+
},
|
|
42
|
+
"ref": { "type": "string" },
|
|
43
|
+
"inline": { "type": "string" }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"execution": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"properties": {
|
|
50
|
+
"mode": { "const": "turn" },
|
|
51
|
+
"tools": { "type": "array", "items": { "type": "string" } },
|
|
52
|
+
"operations": { "type": "array", "items": { "type": "string" } },
|
|
53
|
+
"capabilities": { "type": "array", "items": { "type": "string" } }
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agentsam.icon.v1 — semantic vocabulary registry (additive-only).
|
|
3
|
+
* Persist keys only. Renderer packages map keys → Lucide / CLI glyphs / native.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** @type {readonly string[]} */
|
|
7
|
+
export const AGENTSAM_ICON_KEYS = Object.freeze([
|
|
8
|
+
'generic',
|
|
9
|
+
'agent',
|
|
10
|
+
'app',
|
|
11
|
+
'project',
|
|
12
|
+
'package',
|
|
13
|
+
'plugin',
|
|
14
|
+
'inspect',
|
|
15
|
+
'search',
|
|
16
|
+
'code',
|
|
17
|
+
'terminal',
|
|
18
|
+
'browser',
|
|
19
|
+
'workflow',
|
|
20
|
+
'database',
|
|
21
|
+
'storage',
|
|
22
|
+
'vector',
|
|
23
|
+
'data',
|
|
24
|
+
'repository',
|
|
25
|
+
'file',
|
|
26
|
+
'folder',
|
|
27
|
+
'document',
|
|
28
|
+
'artifact',
|
|
29
|
+
'image',
|
|
30
|
+
'memory',
|
|
31
|
+
'model',
|
|
32
|
+
'provider',
|
|
33
|
+
'tool',
|
|
34
|
+
'skill',
|
|
35
|
+
'integration',
|
|
36
|
+
'connection',
|
|
37
|
+
'api',
|
|
38
|
+
'identity',
|
|
39
|
+
'key',
|
|
40
|
+
'security',
|
|
41
|
+
'network',
|
|
42
|
+
'cloud',
|
|
43
|
+
'deploy',
|
|
44
|
+
'brand',
|
|
45
|
+
'theme',
|
|
46
|
+
'settings',
|
|
47
|
+
'metrics',
|
|
48
|
+
'logs',
|
|
49
|
+
]);
|
|
50
|
+
|
|
51
|
+
/** @type {Readonly<Record<string, string>>} */
|
|
52
|
+
export const ICON_ALIASES = Object.freeze({
|
|
53
|
+
db: 'database',
|
|
54
|
+
repo: 'repository',
|
|
55
|
+
repos: 'repository',
|
|
56
|
+
files: 'file',
|
|
57
|
+
dirs: 'folder',
|
|
58
|
+
directories: 'folder',
|
|
59
|
+
docs: 'document',
|
|
60
|
+
doc: 'document',
|
|
61
|
+
img: 'image',
|
|
62
|
+
media: 'image',
|
|
63
|
+
auth: 'identity',
|
|
64
|
+
secret: 'key',
|
|
65
|
+
secrets: 'key',
|
|
66
|
+
vault: 'key',
|
|
67
|
+
embeddings: 'vector',
|
|
68
|
+
vectors: 'vector',
|
|
69
|
+
sql: 'database',
|
|
70
|
+
d1: 'database',
|
|
71
|
+
config: 'settings',
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/** @type {Readonly<Record<string, { category: string, label: string }>>} */
|
|
75
|
+
export const ICON_CATALOG = Object.freeze({
|
|
76
|
+
generic: { category: 'system', label: 'Generic' },
|
|
77
|
+
agent: { category: 'runtime', label: 'Agent' },
|
|
78
|
+
app: { category: 'product', label: 'App' },
|
|
79
|
+
project: { category: 'product', label: 'Project' },
|
|
80
|
+
package: { category: 'product', label: 'Package' },
|
|
81
|
+
plugin: { category: 'product', label: 'Plugin' },
|
|
82
|
+
inspect: { category: 'runtime', label: 'Inspect' },
|
|
83
|
+
search: { category: 'runtime', label: 'Search' },
|
|
84
|
+
code: { category: 'runtime', label: 'Code' },
|
|
85
|
+
terminal: { category: 'runtime', label: 'Terminal' },
|
|
86
|
+
browser: { category: 'runtime', label: 'Browser' },
|
|
87
|
+
workflow: { category: 'runtime', label: 'Workflow' },
|
|
88
|
+
database: { category: 'data', label: 'Database' },
|
|
89
|
+
storage: { category: 'data', label: 'Storage' },
|
|
90
|
+
vector: { category: 'data', label: 'Vector' },
|
|
91
|
+
data: { category: 'data', label: 'Data' },
|
|
92
|
+
repository: { category: 'product', label: 'Repository' },
|
|
93
|
+
file: { category: 'product', label: 'File' },
|
|
94
|
+
folder: { category: 'product', label: 'Folder' },
|
|
95
|
+
document: { category: 'product', label: 'Document' },
|
|
96
|
+
artifact: { category: 'product', label: 'Artifact' },
|
|
97
|
+
image: { category: 'product', label: 'Image' },
|
|
98
|
+
memory: { category: 'ai', label: 'Memory' },
|
|
99
|
+
model: { category: 'ai', label: 'Model' },
|
|
100
|
+
provider: { category: 'ai', label: 'Provider' },
|
|
101
|
+
tool: { category: 'runtime', label: 'Tool' },
|
|
102
|
+
skill: { category: 'runtime', label: 'Skill' },
|
|
103
|
+
integration: { category: 'connectivity', label: 'Integration' },
|
|
104
|
+
connection: { category: 'connectivity', label: 'Connection' },
|
|
105
|
+
api: { category: 'connectivity', label: 'API' },
|
|
106
|
+
identity: { category: 'security', label: 'Identity' },
|
|
107
|
+
key: { category: 'security', label: 'Key' },
|
|
108
|
+
security: { category: 'security', label: 'Security' },
|
|
109
|
+
network: { category: 'connectivity', label: 'Network' },
|
|
110
|
+
cloud: { category: 'connectivity', label: 'Cloud' },
|
|
111
|
+
deploy: { category: 'runtime', label: 'Deploy' },
|
|
112
|
+
brand: { category: 'design', label: 'Brand' },
|
|
113
|
+
theme: { category: 'design', label: 'Theme' },
|
|
114
|
+
settings: { category: 'system', label: 'Settings' },
|
|
115
|
+
metrics: { category: 'observability', label: 'Metrics' },
|
|
116
|
+
logs: { category: 'observability', label: 'Logs' },
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export const CLI_ICON_GLYPHS = Object.freeze({
|
|
120
|
+
generic: '●',
|
|
121
|
+
inspect: '◇',
|
|
122
|
+
search: '⌕',
|
|
123
|
+
code: '›_',
|
|
124
|
+
terminal: '›',
|
|
125
|
+
database: '▦',
|
|
126
|
+
storage: '▦',
|
|
127
|
+
vector: '◎',
|
|
128
|
+
data: '▦',
|
|
129
|
+
package: '□',
|
|
130
|
+
deploy: '↑',
|
|
131
|
+
security: '◆',
|
|
132
|
+
identity: '◆',
|
|
133
|
+
key: '◆',
|
|
134
|
+
workflow: '↳',
|
|
135
|
+
skill: '●',
|
|
136
|
+
agent: '●',
|
|
137
|
+
app: '□',
|
|
138
|
+
project: '□',
|
|
139
|
+
repository: '□',
|
|
140
|
+
file: '□',
|
|
141
|
+
folder: '□',
|
|
142
|
+
document: '□',
|
|
143
|
+
artifact: '□',
|
|
144
|
+
image: '□',
|
|
145
|
+
settings: '◇',
|
|
146
|
+
brand: '◇',
|
|
147
|
+
theme: '◇',
|
|
148
|
+
metrics: '⌕',
|
|
149
|
+
logs: '⌕',
|
|
150
|
+
connection: '⌕',
|
|
151
|
+
integration: '⌕',
|
|
152
|
+
api: '⌕',
|
|
153
|
+
network: '⌕',
|
|
154
|
+
cloud: '⌕',
|
|
155
|
+
browser: '⌕',
|
|
156
|
+
tool: '›',
|
|
157
|
+
plugin: '□',
|
|
158
|
+
memory: '◇',
|
|
159
|
+
model: '◎',
|
|
160
|
+
provider: '◎',
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @param {unknown} raw
|
|
165
|
+
* @returns {string}
|
|
166
|
+
*/
|
|
167
|
+
export function normalizeIconKey(raw) {
|
|
168
|
+
const input = String(raw ?? '')
|
|
169
|
+
.trim()
|
|
170
|
+
.toLowerCase()
|
|
171
|
+
.replace(/^lucide[-_]/, '')
|
|
172
|
+
.replace(/^heroicons?[-_]/, '');
|
|
173
|
+
if (!input) return 'generic';
|
|
174
|
+
const aliased = ICON_ALIASES[input] || input;
|
|
175
|
+
if (AGENTSAM_ICON_KEYS.includes(aliased)) return aliased;
|
|
176
|
+
return 'generic';
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @param {unknown} raw
|
|
181
|
+
* @returns {boolean}
|
|
182
|
+
*/
|
|
183
|
+
export function isAgentsamIconKey(raw) {
|
|
184
|
+
const k = String(raw ?? '')
|
|
185
|
+
.trim()
|
|
186
|
+
.toLowerCase();
|
|
187
|
+
return AGENTSAM_ICON_KEYS.includes(k);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @param {unknown} raw
|
|
192
|
+
* @returns {string}
|
|
193
|
+
*/
|
|
194
|
+
export function resolveCliIconGlyph(raw) {
|
|
195
|
+
const key = normalizeIconKey(raw);
|
|
196
|
+
return CLI_ICON_GLYPHS[key] || CLI_ICON_GLYPHS.generic;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @param {unknown} raw
|
|
201
|
+
* @returns {{ key: string, category: string, label: string }}
|
|
202
|
+
*/
|
|
203
|
+
export function resolveIconMeta(raw) {
|
|
204
|
+
const key = normalizeIconKey(raw);
|
|
205
|
+
const meta = ICON_CATALOG[key] || ICON_CATALOG.generic;
|
|
206
|
+
return { key, category: meta.category, label: meta.label };
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @template T
|
|
211
|
+
* @param {Partial<Record<string, T>>} mapping
|
|
212
|
+
* @param {T} genericFallback
|
|
213
|
+
* @returns {(raw: unknown) => T}
|
|
214
|
+
*/
|
|
215
|
+
export function createIconRenderer(mapping, genericFallback) {
|
|
216
|
+
return (raw) => {
|
|
217
|
+
const key = normalizeIconKey(raw);
|
|
218
|
+
if (Object.prototype.hasOwnProperty.call(mapping, key) && mapping[key] != null) {
|
|
219
|
+
return /** @type {T} */ (mapping[key]);
|
|
220
|
+
}
|
|
221
|
+
if (Object.prototype.hasOwnProperty.call(mapping, 'generic') && mapping.generic != null) {
|
|
222
|
+
return /** @type {T} */ (mapping.generic);
|
|
223
|
+
}
|
|
224
|
+
return genericFallback;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "agentsam.icon.v1",
|
|
4
|
+
"title": "AgentSamSemanticIconKey",
|
|
5
|
+
"description": "Stable semantic icon key used by AgentSam registries and manifests. Persist semantic meaning only; renderer-specific icon library identifiers, emoji, SVG paths, and asset URLs are not valid values. Vocabulary is additive-only: never rename a shipped key; alias on ingest if needed.",
|
|
6
|
+
"type": "string",
|
|
7
|
+
"enum": [
|
|
8
|
+
"generic",
|
|
9
|
+
"agent",
|
|
10
|
+
"app",
|
|
11
|
+
"project",
|
|
12
|
+
"package",
|
|
13
|
+
"plugin",
|
|
14
|
+
"inspect",
|
|
15
|
+
"search",
|
|
16
|
+
"code",
|
|
17
|
+
"terminal",
|
|
18
|
+
"browser",
|
|
19
|
+
"workflow",
|
|
20
|
+
"database",
|
|
21
|
+
"storage",
|
|
22
|
+
"vector",
|
|
23
|
+
"data",
|
|
24
|
+
"repository",
|
|
25
|
+
"file",
|
|
26
|
+
"folder",
|
|
27
|
+
"document",
|
|
28
|
+
"artifact",
|
|
29
|
+
"image",
|
|
30
|
+
"memory",
|
|
31
|
+
"model",
|
|
32
|
+
"provider",
|
|
33
|
+
"tool",
|
|
34
|
+
"skill",
|
|
35
|
+
"integration",
|
|
36
|
+
"connection",
|
|
37
|
+
"api",
|
|
38
|
+
"identity",
|
|
39
|
+
"key",
|
|
40
|
+
"security",
|
|
41
|
+
"network",
|
|
42
|
+
"cloud",
|
|
43
|
+
"deploy",
|
|
44
|
+
"brand",
|
|
45
|
+
"theme",
|
|
46
|
+
"settings",
|
|
47
|
+
"metrics",
|
|
48
|
+
"logs"
|
|
49
|
+
],
|
|
50
|
+
"examples": ["database", "skill", "identity", "theme", "vector"]
|
|
51
|
+
}
|
package/skills/README.md
CHANGED
|
@@ -4,18 +4,31 @@ Portable, on-demand AgentSam behavior modules. Skills keep specialized guidance
|
|
|
4
4
|
out of the permanent system prompt and load deeper `references/` only when the
|
|
5
5
|
current task calls for them.
|
|
6
6
|
|
|
7
|
-
## Canonical skills
|
|
7
|
+
## Canonical portable skills (`skills/catalog.json`)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
| id | Status | Use when |
|
|
10
|
+
|----|--------|----------|
|
|
11
|
+
| `agentsam-jr-dev` | **current** | Teach/inspect/build with beginner-friendly, evidence-grounded language |
|
|
12
|
+
| `agentsam-app-fundamentals` | **current** | Contracts, credentials, graphs, AST, Merkle — application laws |
|
|
13
|
+
| `agentsam-progression-guard` | **current** | Local → CI → deploy → postdeploy gates; no silent regress |
|
|
14
|
+
| `agentsam-cloudflare-workers` | **current** | Wrangler-native ops, observability, CPU profiling |
|
|
15
|
+
| `agentsam-codebaseindex` | **current** | Guided ingest / `codebaseindex.ingest` / Vectorize+pgvector+local lanes |
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- `agentsam-progression-guard/` — checkpoint/hook discipline for local work, CI,
|
|
15
|
-
deploy, postdeploy verification, promotion, runtime observation, and rollback.
|
|
17
|
+
List or open them with `agentsam skills`; aliases such as `quick-bytes`, `no-regress`,
|
|
18
|
+
`ingest` are intentionally short enough for terminal use.
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
## Not portable (host / app scoped)
|
|
21
|
+
|
|
22
|
+
`apps/local-studio/.grok/skills/*` (game/UI/sprite/xAI packs) are **Local Studio
|
|
23
|
+
Grok host skills**. They do not belong in the SDK portable catalog and must not
|
|
24
|
+
be confused with D1 `agentsam_skill` rows or `agentsam_tools`.
|
|
25
|
+
|
|
26
|
+
## D1 registries (normalize for new users)
|
|
27
|
+
|
|
28
|
+
| Table | Owns | New-user requirement |
|
|
29
|
+
|-------|------|----------------------|
|
|
30
|
+
| `agentsam_skill` (+ revision/invocation) | Dashboard Skills CRUD / slash triggers | Ship schema + seed portable skill metadata that mirrors `skills/catalog.json` |
|
|
31
|
+
| `agentsam_tools` (+ capabilities/call log) | Callable tools: AST retrieve, merkle, D1, Vectorize, … | Ship schema migrations under `migrations/d1/` + optional seed of filesystem/code AST tools so scaffolds match IAM host |
|
|
19
32
|
|
|
20
33
|
Apps may contain host-specific skill directories of their own. Those do not
|
|
21
34
|
replace the portable SDK skills in this directory.
|