fix(create-agent-app): repair template deps/types, harden scaffold CI, scope npm name (#188)#195
Merged
Merged
Conversation
…, scope npm name - template: add the agent-runtime peer (+devDep) the /runtime subpath imports at runtime, align agent-integrations to >=0.44.0 and add agent-interface >=0.15.0 to match agent-app's current peerDependencies; annotate the two tool-loop callback params in src/worker.ts (implicit-any under noImplicitAny when engine types are absent) - scaffold CI test: install agent-app into the generated project as a COPY of the published payload (package.json + dist) instead of a repo-root symlink, so undeclared engine deps cannot resolve through the repo's node_modules; link only the engine deps the generated package.json declares; add a peer-pin drift gate against agent-app's peerDependencies and run the generated project's own vitest suite against the real dist - package: scope the npm name to @tangle-network/create-agent-app (the bare name is squatted), keep the create-agent-app bin, add publishConfig + repository and a README with the npm create command
tangletools
approved these changes
Jul 15, 2026
tangletools
left a comment
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — ffbb220c
This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: drewstone_author · 2026-07-15T19:37:22Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repairs the
create-agent-appscaffolder so a freshly generated app is green out of the box, hardens the CI test so this class of drift cannot ship again, and scopes the npm name (the barecreate-agent-appis squatted — Collab.Land, v1.0.1, Jan 2025).1. Template deps/types (reproduced against published
agent-app@0.43.25)node create-agent-app/index.mjs demo && cd demo && pnpm install && pnpm typecheck && pnpm test, before → after:pnpm installunmet peer @tangle-network/agent-integrations: installed 0.32.0, agent-app wants >=0.44.0pnpm typechecksrc/worker.ts(110,25) TS7006: 'call' implicitly any+src/worker.ts(117,46) TS7006: 't' implicitly anypnpm testCannot find package '@tangle-network/agent-runtime'(imported by agent-app's dist chunk) — 0 tests runRoot cause:
@tangle-network/agent-app/runtimere-exports the tool loop from@tangle-network/agent-runtime, which the template never declared (it is an optional peer of agent-app, so pnpm does not auto-install it). Without it the loop types collapse toany(→ the two TS7006s) and the dist chunk's import fails at runtime (→ the vitest error).Template fixes:
@tangle-network/agent-runtime>=0.79.3(peer) /^0.79.3(devDep),@tangle-network/agent-integrations>=0.32.0→>=0.44.0,@tangle-network/agent-interface>=0.15.0(a required peer of agent-app since feat(interactions): human-in-the-loop ask channel — contract subpath, answer route, question/plan cards #192),src/worker.ts(LoopToolCall,ToolLoopResult['toolResults'][number]).All pins read from agent-app's current
peerDependencies(unchanged by the #194 rebase — re-checked).2. Hardened scaffold CI test (
tests/create-agent-app.test.ts)The existing test symlinked the repo root as the installed
agent-app— so Node resolved undeclared engine deps by walking up into the repo's ownnode_modules, masking exactly the bug that shipped (verified: the old harness passes withagent-runtimedeleted from the template). Now:package.json+dist), and only the engine deps the generatedpackage.jsondeclares get linked — an undeclared dep fails here the same way it fails a user.peerDependencies; every required engine peer must be declared; every peer pin must ship a devDep meeting the floor.vitest runexecutes against the real dist (catches runtime-import gaps types can't see).Red-state proof (template reverted to the old pins): the drift gate fails with
template pins @tangle-network/agent-integrations@>=0.32.0; agent-app wants >=0.44.0, and the nested suite fails with the user's exactCannot find package '@tangle-network/agent-runtime'. Cost: the whole 6-test scaffold file runs in ~1.8s locally (dist copy + skeleton tsc + nested 4-test vitest) — far under the CI budget.3. npm identity
create-agent-app/package.json→@tangle-network/create-agent-app(bare name is squatted), bincreate-agent-appunchanged,publishConfig.access: public+repository.directoryadded, README with the create command (npm create @tangle-network/agent-app@latest my-agent).publish.ymlnever touchescreate-agent-app/— both the auto-release and tag paths runnpm publishat the repo root only, so the scaffolder has no publish path today. Left unmodified per scope; wiring it in needs a follow-up insidepublish.yml(npm OIDC trusted publishing is filename-bound).Next
The
--chattemplate variant (scaffold onto/chat-routes) is the follow-up, now unblocked by #194.Part of #188.
🤖 Generated with Claude Code