@inneranimalmedia/agentsam-sdk 2.6.7 → 2.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (371) hide show
  1. package/README.md +37 -0
  2. package/apps/README.md +25 -0
  3. package/apps/cad-creator/shared/cad/package.json +1 -1
  4. package/apps/client-cms-editor/backend/package.json +4 -6
  5. package/apps/client-cms-editor/frontend/package.json +6 -8
  6. package/apps/client-cms-editor/frontend/tsconfig.json +27 -8
  7. package/apps/client-cms-editor/package.json +1 -1
  8. package/apps/client-cms-editor/shared/cms/package.json +4 -6
  9. package/docs/LOCAL_ENGINE_COMPUTE_AUDIT_PLAN.md +299 -0
  10. package/docs/REPO_FILE_MAP.txt +132 -0
  11. package/migrations/d1/0018_goap_control_plane_remaster.sql +40 -0
  12. package/migrations/d1/0019_agentsam_agent_run_plan_todo.sql +14 -0
  13. package/migrations/d1/README_PORTABLE_CONTROL_PLANE.md +20 -9
  14. package/migrations/runtime/0002_goap_blackboard_v1.sql +15 -0
  15. package/migrations/runtime/0004_agent_run_plan_linkage.sql +8 -0
  16. package/native/agentsam-machine/cli/Cargo.toml +8 -1
  17. package/native/agentsam-machine/cli/README.md +21 -0
  18. package/native/agentsam-machine/core/Cargo.toml +7 -0
  19. package/native/agentsam-machine/core/README.md +14 -0
  20. package/native/agentsam-machine/core/build.rs +33 -0
  21. package/native/agentsam-machine/core/contracts/source-types.v1.json +353 -0
  22. package/native/agentsam-machine/core/src/lib.rs +6 -0
  23. package/native/agentsam-machine/core/src/source_types.rs +2 -2
  24. package/package.json +31 -10
  25. package/packages/agentsam-brand/package.json +1 -1
  26. package/packages/agentsam-contracts/package.json +71 -20
  27. package/packages/agentsam-contracts/scripts/build.mjs +18 -0
  28. package/packages/agentsam-contracts/test/contracts.test.mjs +4 -1
  29. package/packages/agentsam-contracts/test/repository.test.mjs +4 -1
  30. package/packages/agentsam-contracts/tsconfig.build.json +10 -0
  31. package/packages/agentsam-errors/package.json +3 -2
  32. package/packages/agentsam-errors/src/index.js +1 -0
  33. package/packages/agentsam-errors/src/tool.js +56 -0
  34. package/packages/agentsam-errors/test/tool.test.mjs +58 -0
  35. package/packages/agentsam-goap/README.md +52 -0
  36. package/packages/agentsam-goap/package.json +37 -0
  37. package/packages/agentsam-goap/src/adapters/d1-sqlite.js +570 -0
  38. package/packages/agentsam-goap/src/adapters/memory.js +199 -0
  39. package/packages/agentsam-goap/src/contracts.js +226 -0
  40. package/packages/agentsam-goap/src/control-plane.js +112 -0
  41. package/packages/agentsam-goap/src/errors.js +157 -0
  42. package/packages/agentsam-goap/src/index.js +5 -0
  43. package/packages/agentsam-goap/src/world.js +202 -0
  44. package/packages/agentsam-goap/test/goap-control-plane.test.mjs +245 -0
  45. package/packages/agentsam-goap/test/world.test.mjs +79 -0
  46. package/packages/agentsam-knowledge/package.json +3 -2
  47. package/packages/agentsam-nav/package.json +1 -1
  48. package/packages/agentsam-queue-control/package.json +1 -1
  49. package/packages/agentsam-rapid-rust/src/main.rs +1 -0
  50. package/packages/agentsam-repository/package.json +3 -2
  51. package/packages/agentsam-repository/src/goap.js +13 -14
  52. package/packages/agentsam-repository/src/tickets.js +15 -22
  53. package/packages/agentsam-repository/test/goap-tickets-workspace-state.test.mjs +19 -8
  54. package/packages/agentsam-vault/package.json +8 -5
  55. package/packages/agentsam-workbench/package.json +44 -17
  56. package/packages/connectors/cloudflare/package.json +4 -2
  57. package/packages/heuristic-theme/package.json +1 -1
  58. package/packages/identity/package.json +4 -3
  59. package/packages/identity/tests/lane1-packed-consumer.test.mjs +10 -2
  60. package/packages/providers/completeful/package.json +1 -1
  61. package/packages/theme-church-site/README.md +2 -2
  62. package/packages/theme-church-site/package.json +3 -4
  63. package/packages/theme-church-site/src/index.js +1 -1
  64. package/packages/theme-church-site/test/theme.test.mjs +1 -1
  65. package/packages/theme-companions-site/README.md +2 -2
  66. package/packages/theme-companions-site/package.json +3 -4
  67. package/packages/theme-companions-site/src/index.js +1 -1
  68. package/packages/theme-companions-site/test/theme.test.mjs +1 -1
  69. package/packages/theme-floors-site/README.md +2 -2
  70. package/packages/theme-floors-site/package.json +3 -4
  71. package/packages/theme-floors-site/src/index.js +1 -1
  72. package/packages/theme-floors-site/test/theme.test.mjs +1 -1
  73. package/packages/theme-fuelnfree-site/README.md +2 -2
  74. package/packages/theme-fuelnfree-site/package.json +3 -4
  75. package/packages/theme-fuelnfree-site/src/index.js +1 -1
  76. package/packages/theme-fuelnfree-site/test/theme.test.mjs +1 -1
  77. package/packages/theme-handyman-site/README.md +2 -2
  78. package/packages/theme-handyman-site/package.json +3 -4
  79. package/packages/theme-handyman-site/src/index.js +1 -1
  80. package/packages/theme-handyman-site/test/theme.test.mjs +1 -1
  81. package/packages/theme-insurance-site/README.md +2 -2
  82. package/packages/theme-insurance-site/package.json +3 -4
  83. package/packages/theme-insurance-site/src/index.js +1 -1
  84. package/packages/theme-insurance-site/test/theme.test.mjs +1 -1
  85. package/packages/theme-scenes/package.json +1 -1
  86. package/packages/theme-shinshu-site/README.md +2 -2
  87. package/packages/theme-shinshu-site/package.json +3 -4
  88. package/packages/theme-shinshu-site/src/index.js +1 -1
  89. package/packages/theme-shinshu-site/test/theme.test.mjs +1 -1
  90. package/packages/work-graph/package.json +3 -2
  91. package/protocol/local-engine/benchmark.v1.schema.json +14 -0
  92. package/protocol/local-engine/engine.v1.schema.json +17 -0
  93. package/python/agentsam_sdk/repository/intelligence/discovery.py +27 -2
  94. package/python/agentsam_sdk/repository/intelligence/git.py +4 -0
  95. package/python/tests/test_repository_intelligence.py +30 -0
  96. package/src/cli/command-catalog.js +3 -1
  97. package/src/cli.js +20 -1
  98. package/src/commands/app.js +10 -0
  99. package/src/commands/engine.js +10 -0
  100. package/src/commands/goap-world.js +134 -0
  101. package/src/commands/goap.js +11 -4
  102. package/src/commands/machine-binary.js +33 -27
  103. package/src/commands/machine-runtime.js +266 -0
  104. package/src/commands/machine.js +155 -51
  105. package/src/commands/package.js +537 -0
  106. package/src/commands/plan-ledger.js +370 -0
  107. package/src/commands/plan.js +183 -0
  108. package/src/commands/runtime.js +25 -10
  109. package/src/commands/setup.js +30 -6
  110. package/src/commands/skill.js +78 -17
  111. package/src/commands/terminal.js +20 -8
  112. package/src/errors/contract.js +4 -4
  113. package/src/errors/diagnostic.js +1 -1
  114. package/src/errors/index.js +1 -1
  115. package/src/index.js +20 -0
  116. package/src/indexing/ingest/materials.js +237 -30
  117. package/src/knowledge/source.js +1 -1
  118. package/src/lib/setup/runtime.js +4 -2
  119. package/src/lib/slash-commands.js +1 -1
  120. package/src/local/runtime-store.js +24 -2
  121. package/src/local/sqlite.js +17 -0
  122. package/src/local-engine/assets.js +37 -0
  123. package/src/local-engine/audit.js +133 -0
  124. package/src/local-engine/benchmark.js +26 -0
  125. package/src/local-engine/contracts.js +101 -0
  126. package/src/local-engine/engines.js +142 -0
  127. package/src/local-engine/index.js +18 -0
  128. package/src/local-engine/runtime.js +39 -0
  129. package/src/sam/operations/package-audit.js +41 -0
  130. package/src/sam/seed.js +2 -0
  131. package/skills/grok-auth/SKILL.md +0 -110
  132. package/skills/grok-auth/agentsam.skill.json +0 -25
  133. package/skills/grok-auth/references/grok-identity.md +0 -64
  134. package/skills/grok-auth/references/per-user-data.md +0 -49
  135. package/skills/grok-auth/references/prewired-and-env.md +0 -54
  136. package/skills/grok-auth/references/session-ui.md +0 -133
  137. package/skills/grok-auth/references/sign-in-methods.md +0 -55
  138. package/skills/grok-auth/references/wiring.md +0 -71
  139. package/skills/grok-building-games/SKILL.md +0 -213
  140. package/skills/grok-building-games/agentsam.skill.json +0 -25
  141. package/skills/grok-building-games/references/3d-libs.md +0 -64
  142. package/skills/grok-building-games/references/ai-pathfinding.md +0 -122
  143. package/skills/grok-building-games/references/audio.md +0 -129
  144. package/skills/grok-building-games/references/babylon.md +0 -202
  145. package/skills/grok-building-games/references/collision-physics.md +0 -122
  146. package/skills/grok-building-games/references/ecs-architecture.md +0 -111
  147. package/skills/grok-building-games/references/game-feel-juice.md +0 -110
  148. package/skills/grok-building-games/references/genres/board-card-chess.md +0 -89
  149. package/skills/grok-building-games/references/genres/endless-runner.md +0 -83
  150. package/skills/grok-building-games/references/genres/fps.md +0 -105
  151. package/skills/grok-building-games/references/genres/platformer-2d.md +0 -97
  152. package/skills/grok-building-games/references/genres/puzzle-match3-tetris.md +0 -131
  153. package/skills/grok-building-games/references/genres/racing-kart.md +0 -106
  154. package/skills/grok-building-games/references/genres/topdown-twin-stick.md +0 -97
  155. package/skills/grok-building-games/references/genres/tower-defense.md +0 -84
  156. package/skills/grok-building-games/references/genres/voxel-minecraft.md +0 -89
  157. package/skills/grok-building-games/references/input.md +0 -139
  158. package/skills/grok-building-games/references/phaser.md +0 -277
  159. package/skills/grok-building-games/references/procedural-generation.md +0 -141
  160. package/skills/grok-building-games/references/save-persistence.md +0 -108
  161. package/skills/grok-building-games/references/threejs-foundational.md +0 -148
  162. package/skills/grok-controls/SKILL.md +0 -274
  163. package/skills/grok-controls/agentsam.skill.json +0 -25
  164. package/skills/grok-design-ui/SKILL.md +0 -122
  165. package/skills/grok-design-ui/agentsam.skill.json +0 -25
  166. package/skills/grok-design-ui/references/animations.md +0 -379
  167. package/skills/grok-design-ui/references/performance.md +0 -88
  168. package/skills/grok-design-ui/references/refined-ui.md +0 -384
  169. package/skills/grok-design-ui/references/surfaces.md +0 -247
  170. package/skills/grok-design-ui/references/typography.md +0 -123
  171. package/skills/grok-game-animation-frames/SKILL.md +0 -84
  172. package/skills/grok-game-animation-frames/agentsam.skill.json +0 -25
  173. package/skills/grok-game-asset-core/SKILL.md +0 -69
  174. package/skills/grok-game-asset-core/agentsam.skill.json +0 -25
  175. package/skills/grok-game-character-consistency/SKILL.md +0 -69
  176. package/skills/grok-game-character-consistency/agentsam.skill.json +0 -25
  177. package/skills/grok-game-tilesets/SKILL.md +0 -65
  178. package/skills/grok-game-tilesets/agentsam.skill.json +0 -25
  179. package/skills/grok-game-ui-icons/SKILL.md +0 -56
  180. package/skills/grok-game-ui-icons/agentsam.skill.json +0 -25
  181. package/skills/grok-generate2dmap/LICENSE +0 -21
  182. package/skills/grok-generate2dmap/SKILL.md +0 -120
  183. package/skills/grok-generate2dmap/SOURCE.md +0 -6
  184. package/skills/grok-generate2dmap/agentsam.skill.json +0 -25
  185. package/skills/grok-generate2dmap/references/deliverables.md +0 -101
  186. package/skills/grok-generate2dmap/references/layered-map-contract.md +0 -209
  187. package/skills/grok-generate2dmap/references/map-strategies.md +0 -341
  188. package/skills/grok-generate2dmap/references/object-production-gate.md +0 -24
  189. package/skills/grok-generate2dmap/references/pipeline.md +0 -149
  190. package/skills/grok-generate2dmap/references/prop-pack-contract.md +0 -174
  191. package/skills/grok-generate2dmap/references/side-scroll-stages.md +0 -29
  192. package/skills/grok-generate2dmap/scripts/compose_layered_preview.py +0 -157
  193. package/skills/grok-generate2dmap/scripts/extract_prop_pack.py +0 -369
  194. package/skills/grok-generate2dsprite/LICENSE +0 -21
  195. package/skills/grok-generate2dsprite/SKILL.md +0 -313
  196. package/skills/grok-generate2dsprite/SOURCE.md +0 -6
  197. package/skills/grok-generate2dsprite/agentsam.skill.json +0 -25
  198. package/skills/grok-generate2dsprite/references/modes.md +0 -124
  199. package/skills/grok-generate2dsprite/references/prompt-rules.md +0 -315
  200. package/skills/grok-generate2dsprite/scripts/generate2dsprite.py +0 -1031
  201. package/skills/grok-generate2dsprite/scripts/make_layout_guide.py +0 -109
  202. package/skills/grok-imagine/SKILL.md +0 -201
  203. package/skills/grok-imagine/agentsam.skill.json +0 -25
  204. package/skills/grok-multiplayer-p2p/SKILL.md +0 -111
  205. package/skills/grok-multiplayer-p2p/agentsam.skill.json +0 -25
  206. package/skills/grok-multiplayer-p2p/references/react-binding.md +0 -144
  207. package/skills/grok-multiplayer-p2p/references/signaling-relay.md +0 -269
  208. package/skills/grok-neon/SKILL.md +0 -157
  209. package/skills/grok-neon/agentsam.skill.json +0 -25
  210. package/skills/grok-og/SKILL.md +0 -102
  211. package/skills/grok-og/agentsam.skill.json +0 -25
  212. package/skills/grok-og/references/brand-pass.md +0 -53
  213. package/skills/grok-og/references/custom-card.md +0 -107
  214. package/skills/grok-og/references/favicon-and-icons.md +0 -48
  215. package/skills/grok-og/references/og-type-contract.md +0 -18
  216. package/skills/grok-og/references/placeholder-card.md +0 -21
  217. package/skills/grok-og/references/x-banner.md +0 -41
  218. package/skills/grok-threejs/SKILL.md +0 -67
  219. package/skills/grok-threejs/agentsam.skill.json +0 -25
  220. package/skills/grok-threejs/references/llms-full.txt +0 -2780
  221. package/skills/grok-video2dsprite/LICENSE +0 -21
  222. package/skills/grok-video2dsprite/SKILL.md +0 -236
  223. package/skills/grok-video2dsprite/SOURCE.md +0 -6
  224. package/skills/grok-video2dsprite/agentsam.skill.json +0 -25
  225. package/skills/grok-video2dsprite/references/pipeline.md +0 -90
  226. package/skills/grok-video2dsprite/references/prompt-rules.md +0 -63
  227. package/skills/grok-video2dsprite/scripts/video2dsprite.py +0 -490
  228. package/skills/grok-xai-api/SKILL.md +0 -152
  229. package/skills/grok-xai-api/agentsam.skill.json +0 -25
  230. package/test/account-session.test.mjs +0 -101
  231. package/test/agent-capabilities.test.mjs +0 -67
  232. package/test/app-authority-context.test.mjs +0 -32
  233. package/test/app-building-skills.test.mjs +0 -61
  234. package/test/apps-scaffold-contract.test.mjs +0 -115
  235. package/test/blender-cad.test.mjs +0 -146
  236. package/test/cad-docker.test.mjs +0 -96
  237. package/test/capabilities.test.mjs +0 -133
  238. package/test/cli/api-key-env-whoami.test.mjs +0 -129
  239. package/test/cli/catalog-authority.test.mjs +0 -64
  240. package/test/cli/codebaseindex-plan-ux.test.mjs +0 -37
  241. package/test/cli/eval-live.test.mjs +0 -219
  242. package/test/cli/go.test.mjs +0 -128
  243. package/test/cli/local-vault-and-provider-setup.test.mjs +0 -268
  244. package/test/cli/machine-command.test.mjs +0 -34
  245. package/test/cli/mcp-client.test.mjs +0 -256
  246. package/test/cli/preferences-runtime.test.mjs +0 -11
  247. package/test/cli/runtime-persist.test.mjs +0 -56
  248. package/test/cli/runtime-ui.test.mjs +0 -141
  249. package/test/cli/rust-command.test.mjs +0 -21
  250. package/test/cli/skill-npm-and-env.test.mjs +0 -52
  251. package/test/cli/status-actions.test.mjs +0 -88
  252. package/test/cli/wireframes-go-registry.test.mjs +0 -139
  253. package/test/cli-preferences.test.mjs +0 -46
  254. package/test/cloudflare-connector.test.mjs +0 -93
  255. package/test/cloudflare-runtime.test.mjs +0 -82
  256. package/test/context.test.mjs +0 -159
  257. package/test/credentials-audit.test.mjs +0 -113
  258. package/test/deploy-health-scan.test.mjs +0 -95
  259. package/test/deploy-receipt.test.mjs +0 -91
  260. package/test/dockerize.test.mjs +0 -93
  261. package/test/error-diagnostics.test.mjs +0 -124
  262. package/test/eval-context.test.mjs +0 -37
  263. package/test/execution-approvals.test.mjs +0 -27
  264. package/test/fixtures/cad/courtyard-house.json +0 -208
  265. package/test/fixtures/knowledge-rpc-worker.mjs +0 -16
  266. package/test/fixtures/project-authority/customer-app/.agentsam/app.json +0 -5
  267. package/test/fixtures/project-authority/customer-app/apps/my-product/index.ts +0 -1
  268. package/test/fixtures/project-authority/customer-app/wrangler.toml +0 -17
  269. package/test/gcloud-auth.test.mjs +0 -111
  270. package/test/go/build-source-identity.test.mjs +0 -31
  271. package/test/go/cloudflare-probe.test.mjs +0 -317
  272. package/test/go/distribution.test.mjs +0 -28
  273. package/test/google-cloud-connection.test.mjs +0 -83
  274. package/test/google-cloud-inventory.test.mjs +0 -64
  275. package/test/indexing-provider.test.mjs +0 -29
  276. package/test/init-options.test.mjs +0 -35
  277. package/test/integration/ai-access-onboarding.test.mjs +0 -47
  278. package/test/integration/app-command.test.mjs +0 -85
  279. package/test/integration/autorag-project-authority.integration.test.mjs +0 -51
  280. package/test/integration/autorag-runtime-discovery.test.mjs +0 -107
  281. package/test/integration/cad-discovery.test.mjs +0 -158
  282. package/test/integration/cad-docker-executor.test.mjs +0 -249
  283. package/test/integration/cad-execution.test.mjs +0 -184
  284. package/test/integration/cad-project-app.test.mjs +0 -31
  285. package/test/integration/cad-project-d1.test.mjs +0 -25
  286. package/test/integration/cad-project-native.test.mjs +0 -24
  287. package/test/integration/cad-project-workflow.test.mjs +0 -9
  288. package/test/integration/cad-project.test.mjs +0 -85
  289. package/test/integration/cli-help.test.mjs +0 -41
  290. package/test/integration/cms-app-scaffold.test.mjs +0 -77
  291. package/test/integration/cms-site-tenancy-contract.test.mjs +0 -268
  292. package/test/integration/codebaseindex-ingest.test.mjs +0 -255
  293. package/test/integration/core-client.integration.test.mjs +0 -55
  294. package/test/integration/database-hosted-honesty.test.mjs +0 -49
  295. package/test/integration/desktop-keychain-boundary.test.mjs +0 -45
  296. package/test/integration/error-runtime-rpc.test.mjs +0 -71
  297. package/test/integration/features-resolve.test.mjs +0 -147
  298. package/test/integration/hosted-work-host-authority.test.mjs +0 -47
  299. package/test/integration/icon-registry.test.mjs +0 -67
  300. package/test/integration/ingest-discover-models.test.mjs +0 -30
  301. package/test/integration/inspect-path-cli.test.mjs +0 -46
  302. package/test/integration/install-script.test.mjs +0 -110
  303. package/test/integration/inventory-core.test.mjs +0 -53
  304. package/test/integration/inventory-eligibility.test.mjs +0 -59
  305. package/test/integration/inventory-evidence.test.mjs +0 -125
  306. package/test/integration/knowledge-rpc.test.mjs +0 -112
  307. package/test/integration/local-fs.test.mjs +0 -113
  308. package/test/integration/local-provider-bridge.test.mjs +0 -65
  309. package/test/integration/local-studio-settings-production.test.mjs +0 -40
  310. package/test/integration/lockfile-sync.test.mjs +0 -26
  311. package/test/integration/merkle-cli.test.mjs +0 -61
  312. package/test/integration/merkle-persistence-identity.test.mjs +0 -48
  313. package/test/integration/plugins-cloudflare.integration.test.mjs +0 -28
  314. package/test/integration/provider-env-cli.test.mjs +0 -60
  315. package/test/integration/provider-factory.test.mjs +0 -197
  316. package/test/integration/repository-company-graph.test.mjs +0 -90
  317. package/test/integration/runtime-migrations.test.mjs +0 -87
  318. package/test/integration/runtime-status.integration.test.mjs +0 -227
  319. package/test/integration/sam-activity-recovery.test.mjs +0 -147
  320. package/test/integration/sam-decision.test.mjs +0 -584
  321. package/test/integration/sam-kernel.test.mjs +0 -99
  322. package/test/integration/sam-planning-astar.test.mjs +0 -279
  323. package/test/integration/scaffold-cloudflare.test.mjs +0 -46
  324. package/test/integration/skill-runtime.test.mjs +0 -240
  325. package/test/integration/storage-architecture.test.mjs +0 -154
  326. package/test/integration/store-discovery.test.mjs +0 -44
  327. package/test/integration/studio-fs-pty-e2e.test.mjs +0 -294
  328. package/test/integration/terminal-exec.integration.test.mjs +0 -86
  329. package/test/integration/theme-package-registry.test.mjs +0 -31
  330. package/test/integration/tool-runtime.test.mjs +0 -124
  331. package/test/integration/tool-schema.test.mjs +0 -59
  332. package/test/jr-dev-skill.test.mjs +0 -26
  333. package/test/knowledge-context-pack.test.mjs +0 -19
  334. package/test/knowledge-postgres.test.mjs +0 -40
  335. package/test/knowledge-service.test.mjs +0 -110
  336. package/test/knowledge.test.mjs +0 -206
  337. package/test/live/terminal-transport.live.test.mjs +0 -24
  338. package/test/local-sessions.test.mjs +0 -57
  339. package/test/local-studio-deploy.test.mjs +0 -83
  340. package/test/loopback-oauth.test.mjs +0 -53
  341. package/test/merkle-render.test.mjs +0 -31
  342. package/test/mini.test.mjs +0 -140
  343. package/test/model-catalog.test.mjs +0 -70
  344. package/test/models.test.mjs +0 -309
  345. package/test/npm10-lock.test.mjs +0 -29
  346. package/test/ollama.test.mjs +0 -137
  347. package/test/open-url.test.mjs +0 -64
  348. package/test/openai-responses.test.mjs +0 -155
  349. package/test/portable-context.test.mjs +0 -94
  350. package/test/project-config.test.mjs +0 -81
  351. package/test/project-rules.test.mjs +0 -44
  352. package/test/provider-credentials.test.mjs +0 -106
  353. package/test/rehydrate.test.mjs +0 -25
  354. package/test/release-hygiene.test.mjs +0 -42
  355. package/test/repository-snapshot-view.test.mjs +0 -112
  356. package/test/responses-runner.test.mjs +0 -465
  357. package/test/runtime-activity.test.mjs +0 -98
  358. package/test/sdk-worker-contract.test.mjs +0 -72
  359. package/test/security.test.mjs +0 -266
  360. package/test/setup-planner.test.mjs +0 -74
  361. package/test/setup-runtime.test.mjs +0 -51
  362. package/test/shell.test.mjs +0 -281
  363. package/test/skills.test.mjs +0 -22
  364. package/test/smoke.mjs +0 -122
  365. package/test/telemetry.test.mjs +0 -79
  366. package/test/terminal/local-pty.mock.test.mjs +0 -153
  367. package/test/terminal-machine-identity.test.mjs +0 -88
  368. package/test/theme-portability.test.mjs +0 -14
  369. package/test/tools-search.test.mjs +0 -73
  370. package/test/unit/website-assets-bindings.test.mjs +0 -60
  371. package/test/whoami-resume.test.mjs +0 -157
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inneranimalmedia/theme-harbor",
3
- "version": "2.6.7",
4
- "description": "Real Chrystal Clear Insurance build — editorial insurance storefront with coverage storytelling and quote capture.",
3
+ "version": "2.6.9",
4
+ "description": "Real Chrystal Clear Insurance build \u2014 editorial insurance storefront with coverage storytelling and quote capture.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "exports": {
@@ -37,6 +37,5 @@
37
37
  "type": "git",
38
38
  "url": "git+https://github.com/SamPrimeaux/agentsam-sdk.git",
39
39
  "directory": "packages/theme-insurance-site"
40
- },
41
- "private": true
40
+ }
42
41
  }
@@ -8,7 +8,7 @@ const THEME = {
8
8
  "version": "0.1.0",
9
9
  "kind": "gallery-theme",
10
10
  "icon": "theme",
11
- "package": "@inneranimalmedia/theme-insurance-site",
11
+ "package": "@inneranimalmedia/theme-harbor",
12
12
  "category": "Professional",
13
13
  "industries": [
14
14
  "Insurance",
@@ -8,7 +8,7 @@ test('insurance-site theme package exports harvested (not installable) contract'
8
8
  assert.equal(theme.installable, false);
9
9
  assert.equal(theme.lineage, "cci");
10
10
  assert.equal(theme.family, "professional-leadgen");
11
- assert.equal(theme.package, "@inneranimalmedia/theme-insurance-site");
11
+ assert.equal(theme.package, "@inneranimalmedia/theme-harbor");
12
12
  assert.ok(Array.isArray(theme.pages));
13
13
  });
14
14
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneranimalmedia/theme-scenes",
3
- "version": "2.6.7",
3
+ "version": "2.6.9",
4
4
  "description": "Reusable scene / shell / block vocabulary for branded website experiences. BrandPack owns look; theme-scenes owns composition.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,10 +1,10 @@
1
- # @inneranimalmedia/theme-shinshu-site
1
+ # @inneranimalmedia/theme-summit
2
2
 
3
3
  Installable AgentSam theme: **Shinshu Solutions**.
4
4
 
5
5
  Gallery preview source: `apps/theme-gallery-preview/themes/shinshu-site`.
6
6
 
7
7
  ```js
8
- import { createTheme } from "@inneranimalmedia/theme-shinshu-site";
8
+ import { createTheme } from "@inneranimalmedia/theme-summit";
9
9
  const theme = createTheme();
10
10
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inneranimalmedia/theme-summit",
3
- "version": "2.6.7",
4
- "description": "Real Shinshu Solutions static archive — services, gallery, and CMS-ready pages.",
3
+ "version": "2.6.9",
4
+ "description": "Real Shinshu Solutions static archive \u2014 services, gallery, and CMS-ready pages.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "exports": {
@@ -37,6 +37,5 @@
37
37
  "type": "git",
38
38
  "url": "git+https://github.com/SamPrimeaux/agentsam-sdk.git",
39
39
  "directory": "packages/theme-shinshu-site"
40
- },
41
- "private": true
40
+ }
42
41
  }
@@ -8,7 +8,7 @@ const THEME = {
8
8
  "version": "0.1.0",
9
9
  "kind": "gallery-theme",
10
10
  "icon": "theme",
11
- "package": "@inneranimalmedia/theme-shinshu-site",
11
+ "package": "@inneranimalmedia/theme-summit",
12
12
  "category": "Professional",
13
13
  "industries": [
14
14
  "Consulting",
@@ -8,7 +8,7 @@ test('shinshu-site theme package exports harvested (not installable) contract',
8
8
  assert.equal(theme.installable, false);
9
9
  assert.equal(theme.lineage, "shin");
10
10
  assert.equal(theme.family, "consulting-portfolio");
11
- assert.equal(theme.package, "@inneranimalmedia/theme-shinshu-site");
11
+ assert.equal(theme.package, "@inneranimalmedia/theme-summit");
12
12
  assert.ok(Array.isArray(theme.pages));
13
13
  });
14
14
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneranimalmedia/agentsam-work-graph",
3
- "version": "2.6.7",
3
+ "version": "2.6.9",
4
4
  "description": "Core AgentSam work-graph primitive: one graph model (WorkItem, Dependency, TimelineEvent, Artifact, Evidence, Actor) powering an engineering adapter (git/MCP/tests/deploys) and a business adapter (projects/clients/approvals/milestones), with Gantt/timeline rendering as a pure projection over the graph rather than its own source of truth.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -25,5 +25,6 @@
25
25
  },
26
26
  "files": [
27
27
  "src"
28
- ]
28
+ ],
29
+ "license": "MIT"
29
30
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "agentsam.engine.benchmark.v1",
4
+ "type": "object",
5
+ "required": ["schema_version", "engine_id", "runs", "summary"],
6
+ "properties": {
7
+ "schema_version": { "const": "agentsam.engine.benchmark.v1" },
8
+ "engine_id": { "type": "string" },
9
+ "model": { "type": ["string", "null"] },
10
+ "runs": { "type": "array" },
11
+ "summary": { "type": "object" },
12
+ "resource": { "type": "object" }
13
+ }
14
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "agentsam.local-engine.v1",
4
+ "type": "object",
5
+ "required": ["schema_version", "engine_id", "status", "capabilities"],
6
+ "properties": {
7
+ "schema_version": { "const": "agentsam.local-engine.v1" },
8
+ "engine_id": { "type": "string", "minLength": 1 },
9
+ "version": { "type": ["string", "null"] },
10
+ "model": { "type": ["string", "null"] },
11
+ "status": { "enum": ["installed", "available", "unavailable", "unknown", "completed", "unsupported"] },
12
+ "capabilities": { "type": "object", "additionalProperties": { "type": "boolean" } },
13
+ "evidence": { "type": "array" },
14
+ "warnings": { "type": "array", "items": { "type": "string" } }
15
+ },
16
+ "additionalProperties": true
17
+ }
@@ -10,6 +10,11 @@ DEFAULT_FALLBACK_EXCLUDE_DIRS = frozenset(
10
10
  {
11
11
  ".git",
12
12
  "node_modules",
13
+ "python_modules",
14
+ ".agentsam",
15
+ ".wrangler",
16
+ "vendor",
17
+ "target",
13
18
  "dist",
14
19
  "build",
15
20
  "coverage",
@@ -21,6 +26,25 @@ DEFAULT_FALLBACK_EXCLUDE_DIRS = frozenset(
21
26
  }
22
27
  )
23
28
 
29
+
30
+
31
+ DEFAULT_EVIDENCE_NOISE_DIRS = frozenset(DEFAULT_FALLBACK_EXCLUDE_DIRS)
32
+ DEFAULT_EVIDENCE_NOISE_SUFFIXES = (".min.js", ".bundle.js", ".map")
33
+
34
+
35
+ def is_default_evidence_noise_path(value: str) -> bool:
36
+ path = str(value or "").replace("\\", "/").strip("/")
37
+ if not path:
38
+ return False
39
+ parts = path.split("/")
40
+ if any(part in DEFAULT_EVIDENCE_NOISE_DIRS for part in parts[:-1]):
41
+ return True
42
+ name = parts[-1]
43
+ if name in DEFAULT_EVIDENCE_NOISE_DIRS:
44
+ return True
45
+ lowered = name.lower()
46
+ return lowered.endswith(DEFAULT_EVIDENCE_NOISE_SUFFIXES)
47
+
24
48
  LANGUAGE_BY_EXT = {
25
49
  ".js": "JavaScript", ".mjs": "JavaScript", ".cjs": "JavaScript", ".jsx": "JavaScript",
26
50
  ".ts": "TypeScript", ".tsx": "TypeScript", ".py": "Python", ".go": "Go",
@@ -79,8 +103,9 @@ def active_paths(
79
103
  """Return active paths and discovery source (`git` or `filesystem`)."""
80
104
  paths = _git_paths(repo_root)
81
105
  if paths:
82
- return paths, "git"
83
- return _walk_paths(repo_root, fallback_exclude_dir_names), "filesystem"
106
+ return [path for path in paths if not is_default_evidence_noise_path(path)], "git"
107
+ walked = _walk_paths(repo_root, fallback_exclude_dir_names)
108
+ return [path for path in walked if not is_default_evidence_noise_path(path)], "filesystem"
84
109
 
85
110
 
86
111
  def _line_count(path: Path) -> int | None:
@@ -6,6 +6,8 @@ from collections import Counter, defaultdict
6
6
  from pathlib import Path
7
7
  from typing import Any
8
8
 
9
+ from .discovery import is_default_evidence_noise_path
10
+
9
11
 
10
12
  def run_git(repo_root: Path, *args: str) -> str:
11
13
  try:
@@ -56,6 +58,8 @@ def git_churn(repo_root: Path, *, days: int = 30) -> dict[str, dict[str, int]]:
56
58
  if len(parts) != 3:
57
59
  continue
58
60
  added_raw, deleted_raw, path = parts
61
+ if is_default_evidence_noise_path(path):
62
+ continue
59
63
  if added_raw == "-" or deleted_raw == "-":
60
64
  continue
61
65
  try:
@@ -65,5 +65,35 @@ class TestRepositoryIntelligence(unittest.TestCase):
65
65
  self.assertTrue(any(row["path"] == "src/a.py" for row in snapshot["hot_files"]))
66
66
 
67
67
 
68
+ def test_default_evidence_noise_never_becomes_architecture_pressure(self):
69
+ with tempfile.TemporaryDirectory() as tmp:
70
+ root = Path(tmp)
71
+ subprocess.run(["git", "init"], cwd=root, check=True, capture_output=True)
72
+ subprocess.run(["git", "config", "user.email", "fixture@example.com"], cwd=root, check=True)
73
+ subprocess.run(["git", "config", "user.name", "Fixture"], cwd=root, check=True)
74
+ (root / "src").mkdir()
75
+ (root / "python_modules").mkdir()
76
+ (root / ".agentsam" / "machine").mkdir(parents=True)
77
+ (root / "dist").mkdir()
78
+ (root / "src" / "app.js").write_text("export const app = 1;\n", encoding="utf-8")
79
+ (root / "python_modules" / "vendor.py").write_text("x = 1\n" * 100, encoding="utf-8")
80
+ (root / ".agentsam" / "machine" / "receipt.json").write_text("{}", encoding="utf-8")
81
+ (root / "dist" / "app.bundle.js").write_text("x" * 5000, encoding="utf-8")
82
+ subprocess.run(["git", "add", "-f", "."], cwd=root, check=True)
83
+ subprocess.run(["git", "commit", "-m", "fixture"], cwd=root, check=True, capture_output=True)
84
+
85
+ paths, _ = active_paths(root)
86
+ self.assertIn("src/app.js", paths)
87
+ self.assertNotIn("python_modules/vendor.py", paths)
88
+ self.assertNotIn(".agentsam/machine/receipt.json", paths)
89
+ self.assertNotIn("dist/app.bundle.js", paths)
90
+
91
+ snapshot = build_snapshot(root, churn_days=30, top=20)
92
+ pressure = {row["path"] for row in snapshot["pressure_points"]}
93
+ self.assertFalse(any(path.startswith("python_modules") for path in pressure))
94
+ self.assertFalse(any(path.startswith(".agentsam") for path in pressure))
95
+ self.assertFalse(any(path.startswith("dist") for path in pressure))
96
+
97
+
68
98
  if __name__ == "__main__":
69
99
  unittest.main()
@@ -14,6 +14,8 @@ export const CLI_COMMAND_CATALOG = Object.freeze([
14
14
  { id: 'dev', summary: 'Run this project’s npm dev script', topic: 'work', skill: 'agentsam-app-fundamentals' },
15
15
  { id: 'inspect', summary: 'Bounded repository inspect / authority view', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'repository.inspect', common: true },
16
16
  { id: 'machine', summary: 'Deterministic local machine perception (inspect / asset discovery)', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'machine.inspect', common: true },
17
+ { id: 'engine', summary: 'Discover, audit, benchmark, and govern local AI engines', topic: 'runtime', skill: 'agentsam-app-fundamentals', operation: 'engine.audit', common: true },
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]'] },
17
19
  { id: 'capabilities', summary: 'Inspect capability contracts', topic: 'create', skill: 'agentsam-app-fundamentals' },
18
20
  {
19
21
  id: 'setup',
@@ -93,7 +95,7 @@ export const CLI_COMMAND_CATALOG = Object.freeze([
93
95
  { id: 'init', summary: 'Knowledge setup or local scaffold', topic: 'create', skill: 'agentsam-app-fundamentals' },
94
96
  { id: 'codebaseindex', aliases: ['ingest', 'codebase-index'], summary: 'Guided codebase ingest: materials, allowlist, embeddings, storage', topic: 'work', skill: 'agentsam-codebaseindex', operation: 'codebaseindex.ingest', common: true },
95
97
  { id: 'brand', summary: 'Deterministic brand intelligence', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'brand.scan' },
96
- { id: 'plan', summary: 'Composable plans (e.g. brand)', topic: 'work', skill: 'agentsam-app-fundamentals' },
98
+ { id: 'plan', summary: 'Durable project-local work plans + domain plans', topic: 'work', skill: 'agentsam-app-fundamentals' },
97
99
  { id: 'security', aliases: ['sca'], summary: 'Dependency + trust-boundary scan', topic: 'work', skill: 'agentsam-progression-guard', operation: 'security.scan', common: true },
98
100
  { id: 'merkle', summary: 'File integrity snapshots and explorer', topic: 'work', skill: 'agentsam-app-fundamentals' },
99
101
  { id: 'cad', summary: 'Blender/OpenSCAD/FreeCAD CAD tools', topic: 'work', skill: 'agentsam-app-fundamentals', operation: 'cad.blender.inspect' },
package/src/cli.js CHANGED
@@ -25,15 +25,18 @@ import { runStatus } from './commands/status.js';
25
25
  import { runInteractive } from './commands/interactive.js';
26
26
  import { runShell } from './commands/shell.js';
27
27
  import { runGoap } from './commands/goap.js';
28
- import { runBrand, runPlan } from './commands/brand.js';
28
+ import { runBrand } from './commands/brand.js';
29
+ import { runPlan } from './commands/plan.js';
29
30
  import { runDockerize } from './commands/dockerize.js';
30
31
  import { runMini } from './commands/mini.js';
31
32
  import { runMerkle } from './commands/merkle.js';
32
33
  import { runDeployReceipt } from './commands/deploy-receipt.js';
33
34
  import { runSecurity } from './commands/security.js';
35
+ import { runPackage } from './commands/package.js';
34
36
  import { runRecon } from './commands/recon.js';
35
37
  import { runCad } from './commands/cad.js';
36
38
  import { runMachine } from './commands/machine.js';
39
+ import { runEngine } from './commands/engine.js';
37
40
  import { runSkills } from './commands/skills.js';
38
41
  import { runSkill } from './commands/skill.js';
39
42
  import { runEval } from './commands/eval.js';
@@ -97,6 +100,7 @@ function printLegacyHelp() {
97
100
  agentsam dev Run this project's existing npm dev script
98
101
  agentsam inspect [--json] Bounded repository index by default; use --view full for authority envelope
99
102
  agentsam machine inspect Native deterministic perception + asset discovery (--json)
103
+ agentsam engine status|audit|benchmark|assets Local AI engine + compute tooling
100
104
  agentsam brand [scan|…] Deterministic brand intelligence on repository.snapshot authority
101
105
  agentsam plan brand Composable brand normalization plan (--goap optional)
102
106
  agentsam deploy Graduate an AgentSam project intentionally
@@ -452,6 +456,14 @@ if (command === '--version' || command === '-v') {
452
456
  } else if (command === 'inspect') {
453
457
  try { await runInspect(rest); }
454
458
  catch (e) { reportCliError(e); process.exitCode = 1; }
459
+ } else if (command === 'engine') {
460
+ try {
461
+ const code = await runEngine(rest);
462
+ if (typeof code === 'number' && code !== 0) process.exitCode = code;
463
+ } catch (e) {
464
+ reportCliError(e);
465
+ process.exitCode = e?.exitCode || 1;
466
+ }
455
467
  } else if (command === 'machine') {
456
468
  try {
457
469
  const code = await runMachine(rest);
@@ -728,6 +740,13 @@ if (command === '--version' || command === '-v') {
728
740
  reportCliError(e);
729
741
  process.exitCode = 1;
730
742
  }
743
+ } else if (command === 'package') {
744
+ try {
745
+ await runPackage(rest);
746
+ } catch (e) {
747
+ reportCliError(e);
748
+ process.exitCode = 1;
749
+ }
731
750
  } else if (command === 'security' || command === 'sca') {
732
751
  await runSecurity(rest);
733
752
  } else if (command === 'skills') {
@@ -365,6 +365,7 @@ export async function runApp(argv = [], options = {}) {
365
365
  'agentsam app doctor <id>',
366
366
  'agentsam app preview <id>',
367
367
  'agentsam app scaffold <id> <dir>',
368
+ 'agentsam app package <id> [--dry-run]',
368
369
  '',
369
370
  ].join('\n'));
370
371
  return;
@@ -424,6 +425,15 @@ export async function runApp(argv = [], options = {}) {
424
425
  write(' app_id is stable product identity. Pass --app-id explicitly; no AGENTSAM_DEFAULT_APP.\n\n');
425
426
  return { id: app.id, curl, command: npmCmd };
426
427
  }
428
+ if (command === 'package') {
429
+ const dryRun = rest.includes('--dry-run') || !rest.includes('--write');
430
+ const packArgs = ['pack', ...(dryRun ? ['--dry-run', '--ignore-scripts'] : []), '--json'];
431
+ const result = spawnSync('npm', packArgs, { cwd: app.dir, encoding: 'utf8', env: process.env });
432
+ if (result.status !== 0) throw new Error(String(result.stderr || result.stdout || `npm pack failed for ${app.id}`).trim());
433
+ const metadata = JSON.parse(result.stdout)[0];
434
+ write(`${JSON.stringify({ app_id: app.id, package: metadata.name, version: metadata.version, filename: metadata.filename, size: metadata.size, dry_run: dryRun }, null, 2)}\n`);
435
+ return metadata;
436
+ }
427
437
  if (command === 'doctor' || command === 'preview') {
428
438
  runAppBin(app, [command, ...rest], options);
429
439
  return;
@@ -0,0 +1,10 @@
1
+ import path from 'node:path';
2
+ import { createLocalEngineRegistry } from '../local-engine/index.js';
3
+ import { auditLocalCompute } from '../local-engine/audit.js';
4
+ import { auditAssets } from '../local-engine/assets.js';
5
+ import { benchmarkEngine } from '../local-engine/benchmark.js';
6
+
7
+ function parse(argv = []) { const out = { action: argv[0] || 'status', engine: null, model: null, json: argv.includes('--json'), runs: 1, cwd: process.cwd() }; for (let i = 1; i < argv.length; i += 1) { const arg = argv[i]; if (arg === '--model') out.model = argv[++i]; else if (arg === '--runs') out.runs = Number(argv[++i]) || 1; else if (arg === '--cwd') out.cwd = path.resolve(argv[++i] || out.cwd); else if (arg === '--engine') out.engine = argv[++i]; } return out; }
8
+ function emit(value, json) { if (json) console.log(JSON.stringify(value)); else console.log(JSON.stringify(value, null, 2)); }
9
+ function usage() { return `agentsam engine <status|audit|benchmark|assets> [options]\n\n status Discover local engines and models\n audit Read-only Apple hardware + engine inventory\n benchmark Measure a selected engine/model\n assets audit Audit adopted model references without copying weights\n\n --engine <id> ollama | mlx-lm | llama.cpp\n --model <id> Engine model identifier\n --runs <n> Benchmark repetitions (default 1)\n --cwd <path> Project context\n --json Machine-readable output\n`; }
10
+ export async function runEngine(argv = []) { const args = parse(argv); if (args.action === '--help' || args.action === 'help') { console.log(usage()); return 0; } const registry = createLocalEngineRegistry(); if (args.action === 'status') { emit({ schema_version: 'agentsam.local-engine.v1', engines: await registry.discover() }, args.json); return 0; } if (args.action === 'audit') { emit(auditLocalCompute(), args.json); return 0; } if (args.action === 'assets' && argv[1] === 'audit') { emit(auditAssets(), args.json); return 0; } if (args.action === 'benchmark') { if (!args.engine || !args.model) throw new Error('engine benchmark requires --engine <id> and --model <id>'); const result = await benchmarkEngine(registry.get(args.engine), { model: args.model, runs: args.runs }); emit(result, args.json); return 0; } console.log(usage()); return 1; }
@@ -0,0 +1,134 @@
1
+ import { buildRepositoryAuditPacket } from '../agent/repository-audit.js';
2
+ import { repositorySnapshot } from '../capabilities/repository-snapshot.js';
3
+ import { getNextPlanStep, getPlan, openPlanLedger } from './plan-ledger.js';
4
+ import { projectGoapWorld } from '../../packages/agentsam-goap/src/world.js';
5
+
6
+ const PRIORITY_TO_TICKET = Object.freeze({
7
+ critical: 'P0',
8
+ high: 'P1',
9
+ medium: 'P2',
10
+ low: 'P3',
11
+ });
12
+
13
+ function stableJson(value) {
14
+ if (Array.isArray(value)) return '[' + value.map(stableJson).join(',') + ']';
15
+ if (value && typeof value === 'object') {
16
+ return '{' + Object.keys(value).sort().map((key) => JSON.stringify(key) + ':' + stableJson(value[key])).join(',') + '}';
17
+ }
18
+ return JSON.stringify(value);
19
+ }
20
+
21
+ export function knowledgeFreshness(snapshot = {}) {
22
+ const knowledge = snapshot.knowledge || {};
23
+ if (!knowledge.configured) return { status: 'not_configured', reason: 'knowledge_config_missing' };
24
+ if (!knowledge.indexed) return { status: 'not_indexed', reason: 'active_generation_missing' };
25
+ const receipt = knowledge.receipt || {};
26
+ if (receipt.scope && knowledge.scope && stableJson(receipt.scope) !== stableJson(knowledge.scope)) {
27
+ return { status: 'stale', reason: 'scope_policy_changed' };
28
+ }
29
+ if (receipt.merkle_root && snapshot.tree?.merkle_root && receipt.merkle_root !== snapshot.tree.merkle_root) {
30
+ return { status: 'stale', reason: 'repository_merkle_changed' };
31
+ }
32
+ return { status: 'current', reason: 'active_generation_matches_world' };
33
+ }
34
+
35
+ export async function buildLocalGoapState({ cwd = process.cwd(), snapshot = null } = {}) {
36
+ const ctx = openPlanLedger(cwd);
37
+ try {
38
+ const plan = getPlan(ctx, 'current');
39
+ if (!plan) return null;
40
+
41
+ const running = (plan.tasks || []).find((task) => task.status === 'running') || null;
42
+ const next = running ? null : getNextPlanStep(ctx, { planId: plan.id });
43
+ const step = running || next?.step || null;
44
+ const world = snapshot || await repositorySnapshot({ cwd: ctx.root });
45
+ const packet = buildRepositoryAuditPacket({
46
+ snapshot: world,
47
+ focus: [plan.title, step?.title].filter(Boolean),
48
+ requestedSections: ['repository', 'tree', 'knowledge', 'packages'],
49
+ evidenceBudget: 6000,
50
+ });
51
+ const freshness = knowledgeFreshness(world);
52
+ const projectedWorld = projectGoapWorld({
53
+ repository: {
54
+ ...world.repository,
55
+ merkle_root: world.tree?.merkle_root || null,
56
+ },
57
+ plan,
58
+ activeTodo: step,
59
+ knowledge: {
60
+ ...freshness,
61
+ generation_id: world.knowledge?.generation_id || null,
62
+ },
63
+ evidence: packet,
64
+ updatedAt: step?.updated_at_unix || plan.updated_at_unix || null,
65
+ });
66
+ const run = step?.agent_run_id
67
+ ? ctx.db.prepare('SELECT * FROM agentsam_agent_run WHERE id = ? LIMIT 1').get(step.agent_run_id) || null
68
+ : null;
69
+
70
+ const git = {
71
+ root: ctx.root,
72
+ repoFullName: world.repository?.full_name || ctx.git?.repoFullName || null,
73
+ revisionSha: world.repository?.revision_sha || ctx.git?.revisionSha || null,
74
+ branch: world.repository?.branch || ctx.git?.branch || null,
75
+ dirty: world.repository?.dirty ?? ctx.git?.dirty ?? null,
76
+ };
77
+ const activeTicket = step ? {
78
+ id: step.id,
79
+ title: step.title,
80
+ status: step.status,
81
+ priority: PRIORITY_TO_TICKET[step.priority] || 'P2',
82
+ subsystem: step.metadata?.kind || 'work',
83
+ surface: 'local',
84
+ status_reason: 'selected_from_project_local_plan',
85
+ description: step.description || null,
86
+ agent_run_id: step.agent_run_id || null,
87
+ } : {
88
+ id: plan.id,
89
+ title: plan.title,
90
+ status: plan.tasks_done === plan.tasks_total ? 'complete' : 'active',
91
+ priority: 'P2',
92
+ subsystem: 'plan',
93
+ surface: 'local',
94
+ status_reason: 'plan_has_no_open_executable_step',
95
+ agent_run_id: null,
96
+ };
97
+
98
+ return {
99
+ ok: true,
100
+ source: 'local_world',
101
+ repositoryId: world.repository?.repository_id || ctx.repositoryId,
102
+ git,
103
+ workspaceState: {
104
+ current_task_id: step?.id || null,
105
+ locked_by: 'project_local_plan',
106
+ checkpoint_sha: plan.metadata?.revision || null,
107
+ last_agent_action: 'world_snapshot_projected',
108
+ updated_at: step?.updated_at_unix || plan.updated_at_unix || null,
109
+ },
110
+ activeTicket,
111
+ agentRun: run,
112
+ recentCommits: [],
113
+ checkpoint: null,
114
+ cursor: {},
115
+ steps: plan.tasks || [],
116
+ stepsUnavailable: false,
117
+ localPlan: plan,
118
+ localStep: step,
119
+ worldSnapshot: {
120
+ snapshot_id: world.snapshot_id,
121
+ content_hash: world.content_hash,
122
+ merkle_root: world.tree?.merkle_root || null,
123
+ knowledge_generation_id: world.knowledge?.generation_id || null,
124
+ knowledge_freshness: freshness,
125
+ repository: world.repository,
126
+ actions: projectedWorld.actions,
127
+ },
128
+ boundedEvidence: packet,
129
+ canonicalWorld: projectedWorld,
130
+ };
131
+ } finally {
132
+ ctx.close();
133
+ }
134
+ }
@@ -11,6 +11,7 @@ import {
11
11
  renderGoapPlan,
12
12
  } from '../../packages/agentsam-repository/src/goap.js';
13
13
  import { readAccountSession } from '../lib/account-session.js';
14
+ import { buildLocalGoapState } from './goap-world.js';
14
15
 
15
16
  function parseArgs(args = []) {
16
17
  const flags = { _: [] };
@@ -102,7 +103,7 @@ export async function runGoap(subcommand = 'status', options = {}) {
102
103
  console.log(`Successfully created and activated GOAP goal: ${res.ticketId}`);
103
104
  console.log(` Title: ${res.title}`);
104
105
  console.log(` Priority: ${res.priority} [Subsystem: ${res.subsystem}]`);
105
- console.log(` Agent Run: ${res.agentRunId}`);
106
+ if (res.agentRunId) console.log(` Agent Run: ${res.agentRunId}`);
106
107
  return;
107
108
  }
108
109
 
@@ -147,9 +148,15 @@ export async function runGoap(subcommand = 'status', options = {}) {
147
148
  return;
148
149
  }
149
150
 
150
- const state = await readGoapState({ cwd, accountId });
151
- if (!state.ok) {
152
- console.error(`Error reading GOAP state: ${state.error || 'unknown error'}`);
151
+ let state = null;
152
+ try {
153
+ state = await buildLocalGoapState({ cwd });
154
+ } catch (error) {
155
+ if (jsonMode && options.debug) console.error(error?.stack || error);
156
+ }
157
+ if (!state && accountId) state = await readGoapState({ cwd, accountId });
158
+ if (!state?.ok) {
159
+ console.error(`Error reading GOAP state: ${state?.error || 'no local plan or remote GOAP state available'}`);
153
160
  return;
154
161
  }
155
162