TypeAgent Studio: New agent wizard - #2754
Conversation
…A Discovery) Stand up the Gate A "new agent" flow end-to-end behind the studio-service, with the VS Code extension as a thin channel client. Onboarding execution (t1): - Add an onboarding-only dispatcher (createOnboardingOnlyDispatcher) in defaultAgentProvider that loads just the onboarding agent (translation on, cache/explainer off, silent clientIO) to minimize action collision, started lazily on first wizard run. ensureServiceKeysLoaded() loads config.local.yaml. - Add studio-service onboarding phaseRunner + dispatcherGateway that drive the 7 phases via typed @action commands and detect success from on-disk artifacts. Protocol/RPC channelization (b1) + thin extension (b3): - Channel the full onboarding surface over the studio service protocol; the extension delegates to the service instead of hosting its own runtime (studioRuntime.ts removed, serviceRuntimeFacade + studioServiceClient added). Keys + guided auto-run (t2). New Agent wizard shell (F1.1): webviewKit wizard host/client/protocol/viewModel, wizardView, stylesheet, esbuild bundle, and command registration. Discovery reliability fix: - Use dotted sub-schema @action names (onboarding.onboarding-discovery ...); the dispatcher keys sub-schemas as <parent>.<subName>, so the bare hyphenated form threw "Invalid schema name" and silently resolved undefined. Unblocks phases 2-7. - Detect Discovery success from discovery/api-surface.json rather than the unreliable CommandResult.actions in silent/headless mode. - Treat the NL Discovery utterance as best-effort and add a deterministic extractDiscoverySource fallback (parse a URL/CLI from the description and dispatch the typed crawl) so nondeterministic NL translation no longer blocks Discovery. Surface the NL error only when neither path yields a surface. Tests: studio-service jest 42/42 (incl. onboardingPhaseRunner 20/20); typeagent-studio wizard specs; default-agent-provider + studio-service tsc clean. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… it") After install, the New Agent wizard can translate a PhraseGen example utterance through a dispatcher loaded with only the generated agent and confirm it resolves to one of the agent's actions (translate-only, nothing executed) -- the J1/Gate A "the agent answers >=1 utterance" proof. - studio-service/onboarding/utteranceProver.ts: pure orchestration core (createUtteranceProver: pick a deterministic example phrase, translate, verdict). 13 unit tests. - defaultAgentProvider/generatedAgentTranslator.ts: loads the built agent by path, runs a translate-only dispatcher, parses the resolved action. Shared ensureServiceKeysLoaded extracted to serviceKeys.ts. - studio-service dispatcherGateway.createServiceUtteranceProver + core runtime hook proveActiveSessionUtterance (injected like the packaging health gate) + RPC across studioProtocol/handlers/client/facade. - Wizard "Try it" UI: tryIt/utteranceProof messages, handleTryIt, a "Try an example utterance" button and pass/fail proof banner (theme-adaptive). Live E2E against a real scaffolded+built agent is deferred (shared toolchain unlock with Gate A acceptance); this lands the plumbing tsc-clean like t1/t3. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…itizers) Onboarding GrammarGen frequently produced .agr grammars that failed to compile, hard-failing the phase (the real agc error was masked as "Command was cancelled" by the silent onboarding dispatcher). Live walks of the Open-Meteo weather + geocoding APIs reproduced three recurring classes of LLM grammar errors. generateGrammar now runs a bounded generate -> compile -> repair loop (MAX_GRAMMAR_ATTEMPTS): it compiles each candidate via a shared compileGrammarFile() helper and, on failure, feeds the exact agc diagnostic back to the model for a targeted repair pass. It only reports success when the grammar actually compiles, and on exhaustion returns the real compiler error (fixing the diagnostics gap). Also hardens the prompt + adds deterministic sanitizers for the dominant error classes: - Strengthened grammar + new repair prompt: forbid function calls / ternaries / expressions, require a numeric capture type for number fields, guide array fields to single-element [capture]. - rewriteInlineUnionCaptures: rewrites unsupported inline-union capture types. - stripUnboundOutputReferences: removes output-object properties that reference names the rule never captured (e.g. optional schema fields the model over-includes) - the single most common failure across live runs. Verified live (Azure OpenAI keys via config.local.yaml) against Open-Meteo geocoding: generateGrammar compiles on the first attempt and the full GrammarGen phase passes end-to-end through the onboarding-only dispatcher. onboarding tsc -b clean. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The onboarding Testing phase (6) loads the scaffolded agent as an npm agent
provider and imports its compiled `dist/` handler, but nothing built the agent
before Testing ran: the Scaffolder phase (5) only wrote source, and the sole
`pnpm install` + `pnpm run build` lived in Packaging (7), which runs AFTER
Testing. The live walk therefore crashed at Testing with an opaque
ERR_MODULE_NOT_FOUND.
Build the agent at the end of `scaffoldAgent`, right before the phase is
marked approved, so Testing and Packaging both see a built agent. A shared
`buildScaffoldedAgent()` helper (lib/agentBuild.ts) runs `pnpm install
--ignore-scripts` (skips heavy, unrelated native postinstalls like the shell's
better-sqlite3/electron rebuild) + `pnpm run build`, forcing
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 so a corepack shim never blocks the headless
onboarding dispatcher. Packaging now calls the same helper (idempotent
rebuild), replacing its duplicated install/build + local runCommand. A build
failure now fails the Scaffolder phase with the real compiler error instead of
surfacing later as a module-not-found.
Also fix a real, machine-independent build bug this surfaced: SchemaGen emits a
doc comment directly above the entry union (`export type <Pascal>Actions`),
which the action-schema compiler (asc) rejects ("entry type comments ... are
not used for prompts"). New `stripEntryTypeComment()` removes only a comment
block contiguous with the union (preserving the license header and per-action
comments) before the schema is written.
Verified live (Azure OpenAI keys via config.local.yaml, Open-Meteo geocoding):
the generated agent compiles (tsc + asc + agc) and the Testing phase passes
10/10 — every sample phrase resolves to the agent's `searchLocations` action.
(The `pnpm install` step itself is exercised on a networked machine; this
sandbox blocks the npm registry, so the compile was verified via the workspace
toolchain.) onboarding tsc -b clean; prettier applied.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…space) A freshly scaffolded agent lands in `packages/agents/<name>`, which the pnpm workspace globs as a member. Building it with a plain `pnpm install` + `pnpm run build` therefore re-resolved and relinked the ENTIRE workspace: it mutated the tracked `pnpm-lock.yaml` and coupled the agent build to unrelated heavy packages (the shell's electron / better-sqlite3 native deps), which hang / fail when they can't be fetched. This made the onboarding Scaffolder/Packaging phases destructive and, in practice, unable to complete. Build the agent as a standalone project instead: - agentBuild.ts: `buildScaffoldedAgent` now runs `pnpm install --ignore-workspace --ignore-scripts --prefer-offline` and `pnpm --ignore-workspace run build`. `--ignore-workspace` on BOTH steps is required — `pnpm run` performs a deps-status check before the script, and without the flag that check re-engages the workspace and triggers the same whole-workspace install. The install writes only the agent's own node_modules + lockfile and never touches `pnpm-lock.yaml`. The feed registry is read from the nearest `.npmrc` and passed via `--registry` (an `--ignore-workspace` install treats the agent dir as root and does not inherit the repo `.npmrc`; auth still comes from the user-level `~/.npmrc`). - scaffolderHandler.ts: `getWorkspaceDepValue` emits `link:` deps to the in-repo `@typeagent/*` source packages instead of `workspace:*` (which an isolated install cannot resolve). `link:` reuses the prebuilt source package and its already-resolved dependency graph; a `file:` copy would re-resolve the package's own `workspace:*` deps and fail. Out-of-repo scaffolds keep `file:`. - scaffolderHandler.ts: add `@types/node` to the generated devDependencies. `tsconfig.base.json` sets `types: ["node"]`, and the isolated install does not hoist `@types/node` from the workspace, so tsc needs it declared locally. Verified on Windows: the Scaffolder phase run through the real onboarding dispatcher completes in ~9s (previously hung ~45 min), the agent builds (tsc + asc + agc) into `dist/`, and `pnpm-lock.yaml` is byte-for-byte unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The generated-agent translator captures the @dispatcher translate result by overriding the dispatcher's setDisplay/appendDisplay clientIO callbacks and parsing the emitted JSON: block. But those callbacks receive an IAgentMessage envelope { message, requestId, source, sourceIcon } — the visible text (incl. the JSON payload) lives under .message (itself a string or a { type, content, kind } object), not the top-level .content that extractDisplayText looked for. So every capture yielded an empty string and the proof resolved zero actions even though translation succeeded. Unwrap .message before falling back to .content. Add a regression spec that reproduces the exact envelope shape the dispatcher emits (status + result block) and asserts the action resolves. Verified live: the REST Countries demo agent now answers 8/8 PhraseGen example utterances (Gate A / J1 requires >= 1). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A tiny, dependency-free .NET console tool under dotnet/randomStub used to exercise the New Agent onboarding pipeline end to end, offline. Discovery crawls its --help surface (number/dice/pick subcommands); the generated agent can actually invoke a subcommand and get a real result, so the Try it step proves the agent runs. Emits LF line endings so the CLI help crawler's subcommand parser enumerates every command. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cross-platform build+publish+deploy helper (deploy.mjs) that publishes a framework-dependent single-file binary for the current RID and copies it to a PATH dir (npm global bin by default), so the onboarding Discovery phase can resolve the bare 'randomstub' command. README updated to feature it. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…hangs GrammarGen (agc) and the scaffolder/packaging build (concurrently tsc/asc/agc through a Windows shell) can spawn grandchildren that inherit and hold the stdout/stderr pipes open after the process itself has exited, so "close" never fires and the phase hangs forever. Resolve on "exit" with a short grace period for a trailing "close", guarded against double-resolve; also set windowsHide. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ed base command) The generated exhaustive-switch default branch read action.actionName after action narrowed to never (TS2339); cast back to read the name. The switch cases also pushed the full discovered command path, which includes the base command, while runCli already invokes the base command as the executable, producing e.g. "randomstub randomstub number". Strip a leading base-command prefix so only the subcommand tokens are emitted. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
submitAction built an "@action ... --parameters" command by single-quoting the JSON, which truncated at the first apostrophe in free text (the agent description flows through startOnboarding verbatim), crashing Discovery. The dispatcher tokenizer ends a single-quoted token at a bare quote and never unescapes, so escaping cannot help; instead encode every apostrophe in the payload as the \u0027 JSON escape (valid JSON, tokenizer-safe). Extracted a testable buildActionCommand plus a round-trip spec against a faithful port of the dispatcher tokenizer. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ects The wizard initial postState() was fired with void; listPhases() rejects with NOT_CONNECTED during the brief window before the service socket is up, surfacing an unhandled rejection. Route the rejection to the webview error banner. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The VS Code "build typeagent-studio" task ran "pnpm --filter typeagent-studio build" from the workspace root, which triggers the pnpm workspace deps-status check and its auto-install. Run "node esbuild.mjs" in the package dir directly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the hand-rolled arg parser and help strings in the randomStub demo CLI with System.CommandLine, so its --help surface has the standard real-world shape (Description / Usage / Commands / Options) -- a more faithful exercise of the onboarding Discovery crawler. Every output path (the command actions and System.CommandLine own help/error rendering, via an InvocationConfiguration) is forced to LF so the crawler Commands: parser still finds every subcommand. Verified: --help is pure LF, parseSubcommands extracts number/dice/pick, per-subcommand Options list --min/--max/--seed, and the framework-dependent single-file publish bundles the dependency and runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces the TypeAgent Studio “New Agent” wizard and completes the “onboarding channelization” shift so onboarding runs in the standalone studio-service and is driven from the VS Code extension via typed RPC calls. It also adds a “Try it” translate-only proof, improves GrammarGen reliability, and makes scaffolded agents build before Testing/Packaging.
Changes:
- Add a 7-phase “New Agent” wizard webview (UI, typed protocol, view model, bundle + CSS) and wire it to the
typeagent-studio.newAgentcommand. - Move onboarding operations to the Studio service channel (new RPC surface, service handlers, service runtime wiring, remove the extension’s in-process runtime).
- Build scaffolded agents during Scaffolder (isolated pnpm install/build), add “Try it” utterance proving, and harden GrammarGen with compile/repair + deterministic sanitizers.
Show a summary per file
| File | Description |
|---|---|
| ts/packages/typeagent-studio/src/wizardView.ts | Webview host panel wiring for the New Agent wizard and service-backed onboarding calls |
| ts/packages/typeagent-studio/src/webviewKit/wizardViewModel.ts | Browser-safe wizard view model mapping from OnboardingState |
| ts/packages/typeagent-studio/src/webviewKit/wizardProtocol.ts | Typed message protocol and message narrowing for host ↔ webview |
| ts/packages/typeagent-studio/src/webviewKit/client/wizard.ts | Wizard iframe UI renderer and host messaging client |
| ts/packages/typeagent-studio/src/test/wizardViewModel.spec.ts | Unit tests for view model behavior (runnability, install gate) |
| ts/packages/typeagent-studio/src/test/wizardProtocol.spec.ts | Unit tests pinning phase names and message parsing |
| ts/packages/typeagent-studio/src/test/webviewBundle.spec.ts | Browser-safety check for the wizard webview bundle |
| ts/packages/typeagent-studio/src/test/stubInvokeHandlers.ts | Extend stub RPC handlers to include onboarding methods |
| ts/packages/typeagent-studio/src/studioServiceClient.ts | Add onboarding RPC client methods (phases, install, “Try it”, health gate) |
| ts/packages/typeagent-studio/src/studioRuntime.ts | Remove in-process runtime implementation |
| ts/packages/typeagent-studio/src/serviceRuntimeFacade.ts | Add OnboardingRuntime interface and route onboarding via the service connection |
| ts/packages/typeagent-studio/src/extension.ts | Resolve repo root locally and register commands against the service-backed runtime |
| ts/packages/typeagent-studio/src/commands.ts | Add typeagent-studio.newAgent and make onboarding routing async/service-backed |
| ts/packages/typeagent-studio/package.json | Register “New Agent…” command and add it to the Sandboxes view title actions |
| ts/packages/typeagent-studio/media/wizard.css | Wizard styling using VS Code theme tokens |
| ts/packages/typeagent-studio/esbuild.mjs | Add browser build configuration for wizard.js |
| ts/packages/typeagent-studio/AGENTS.md | Update architecture doc: no in-process runtime, onboarding now channelized |
| ts/packages/typeagent-core/src/runtime/studioRuntimeCore.ts | Add “Try it” types and runtime hook (proveActiveSessionUtterance) |
| ts/packages/typeagent-core/src/runtime/studioProtocol.ts | Extend Studio service RPC protocol with onboarding operations |
| ts/packages/studio-service/test/utteranceProver.spec.ts | Unit tests for phrase selection and utterance proof logic |
| ts/packages/studio-service/test/onboardingPhaseRunner.spec.ts | Unit tests for deterministic phase dispatch plan and Discovery fallback logic |
| ts/packages/studio-service/src/studioRpcHandlers.ts | Implement RPC handlers for onboarding operations |
| ts/packages/studio-service/src/runtime.ts | Inject service-backed onboarding bridge + utterance prover into the runtime |
| ts/packages/studio-service/src/onboarding/utteranceProver.ts | Pure orchestration for translate-only “Try it” proofing |
| ts/packages/studio-service/src/onboarding/phaseRunner.ts | Pure orchestration for mapping phases to onboarding-agent action sequences |
| ts/packages/studio-service/src/onboarding/dispatcherGateway.ts | Lazy dynamic import bridge to defaultAgentProvider dispatchers and artifact readers |
| ts/packages/defaultAgentProvider/test/onboardingDispatcher.spec.ts | Tests for safe command serialization for typed onboarding actions |
| ts/packages/defaultAgentProvider/test/generatedAgentTranslator.spec.ts | Tests for translate display capture and JSON parsing pipeline |
| ts/packages/defaultAgentProvider/src/serviceKeys.ts | Best-effort service-side config/env key bootstrapping for LLM calls |
| ts/packages/defaultAgentProvider/src/onboardingDispatcher.ts | Onboarding-only dispatcher wrapper (typed actions and NL utterances) |
| ts/packages/defaultAgentProvider/src/index.ts | Export new onboarding dispatcher and generated-agent translator entrypoints |
| ts/packages/defaultAgentProvider/src/generatedAgentTranslator.ts | Translate-only dispatcher wrapper for “Try it” (no action execution) |
| ts/packages/agents/onboarding/src/scaffolder/scaffolderHandler.ts | Strip entry-type doc comment, build agent during Scaffolder, switch deps to link/file for isolated install |
| ts/packages/agents/onboarding/src/scaffolder/cliHandlerTemplate.ts | Fix CLI handler codegen to avoid duplicating the base command tokens |
| ts/packages/agents/onboarding/src/scaffolder/cliHandler.template | Fix exhaustive switch default typing for generated handlers |
| ts/packages/agents/onboarding/src/packaging/packagingHandler.ts | Rebuild via shared isolated build helper instead of ad-hoc spawn logic |
| ts/packages/agents/onboarding/src/lib/agentBuild.ts | New shared isolated pnpm install/build helper with registry discovery |
| ts/packages/agents/onboarding/src/grammarGen/grammarGenHandler.ts | Add compile/repair loop and deterministic grammar sanitizers |
| ts/docs/plans/vscode-devx/STATUS.md | Update Gate A status to reflect wizard shell progress |
| ts/.vscode/tasks.json | Update Studio build task to run package-local esbuild build |
| dotnet/randomStub/README.md | Document demo CLI purpose and deploy instructions for Discovery |
| dotnet/randomStub/randomStub.csproj | Add demo CLI project (net8.0) with System.CommandLine dependency |
| dotnet/randomStub/Program.cs | Implement demo CLI with stable help formatting (LF newlines) |
| dotnet/randomStub/deploy.mjs | Add one-command publish-and-deploy script to a PATH directory |
Review details
- Files reviewed: 44/44 changed files
- Comments generated: 5
- Review effort level: Low
…omments Strip references to internal planning documents and work-item labels (DESIGN.md sections, Gate/journey/feature/task tags) from onboarding-wizard code comments so they stand on their own and describe the current code. Comment-only; no behavior change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Fix two doc comments that still described onboarding as in-process; it now runs in the standalone Studio service (wizardView, wizardProtocol). - dispatcherGateway: don't cache a failed onboarding-dispatcher import, so a transient failure is retryable instead of wedging onboarding until restart. - agentBuild.findFeedRegistry: make the .npmrc read best-effort (try/catch) so an unreadable file keeps walking up instead of crashing the build. - Wizard status banner: clear the transient progress line when a run finishes (post a terminal status for runPhase/rerunStale/install) or fails, so stale 'Running...' text no longer lingers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
# Conflicts: # ts/packages/agents/onboarding/README.AUTOGEN.md # ts/packages/defaultAgentProvider/README.AUTOGEN.md # ts/packages/studio-service/README.AUTOGEN.md # ts/packages/typeagent-core/README.AUTOGEN.md # ts/packages/typeagent-studio/README.AUTOGEN.md
Remove an unused eslint-disable directive in agentBuild.ts and rename the unused renderDetail parameter to _m in wizard.ts. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 73e93c12-02d7-472a-ad60-b10b6aea26e1
Reword comments in grammarGenHandler.ts to describe compiler behavior and grammar failure modes in plain language instead of citing specific onboarding runs, dates, or example integrations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 73e93c12-02d7-472a-ad60-b10b6aea26e1
Two fixes on the OpenAPI onboarding path: - phaseRunner.runDiscovery now dispatches an OpenAPI spec URL deterministically to parseOpenApiSpec, skipping the NL utterance that biased the dispatcher to crawlDocUrl and dropped the resolved base URL. Doc-URL and CLI sources keep the NL-first flow. Adds unit tests for the spec-URL route and its error path. - grammarGen's stripUnboundOutputReferences now treats a variable captured only inside an optional (...)? group as unbound, so it is dropped from the action output object. Optional OpenAPI query params (e.g. format, callback) are no longer emitted as conditionally-bound references that agc rejects, so the grammar compiles on the first attempt. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
randomStub was a demo-only fixture (a hand-built .NET System.CommandLine app plus a PATH-deploying script) used to exercise onboarding end-to-end offline. It was not part of any solution, CI build, or product code, and carried a .NET SDK build dependency plus a security-sensitive deploy script. Drop it to keep the wizard PR focused; the fixture is kept out-of-repo for local demos. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
stripEntryTypeComment now uses the TypeScript parser to locate the entry type alias instead of regex-scanning source text, so it is robust to formatting/whitespace variants. Promotes `typescript` to a runtime dependency (matching actionSchema/typeagent convention). Consolidates the duplicated el/clear/button DOM helpers into a shared webviewKit/client/domHelpers.ts; wizard.ts and impactReport.ts import from it, and traceViewerDom.ts re-exports el/clear so its render modules are unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
What if you had a schema that contains a string that is itself a schema that matches this pattern?
________________________________
From: Tal Zaccai ***@***.***>
Sent: Wednesday, July 29, 2026 9:41 PM
To: microsoft/TypeAgent ***@***.***>
Cc: Robert Gruen ***@***.***>; Review requested ***@***.***>
Subject: Re: [microsoft/TypeAgent] TypeAgent Studio: New agent wizard (PR #2754)
@TalZaccai commented on this pull request.
________________________________
In ts/packages/agents/onboarding/src/scaffolder/scaffolderHandler.ts<#2754?email_source=notifications&email_token=AGBS6WPL2ICBCMCI5IQIFZ35HLGX5A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGUZTIOBTGAYKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2K64DSL5ZGK5TJMV3V6Y3MNFRWW#discussion_r3680025643>:
@@ -517,6 +543,51 @@ function buildMainSchemaWithSubGroups(
};
}
+// Remove a documentation comment attached directly (no blank line) above the
+// entry union `export type <Pascal>Actions = ...`. The action-schema compiler
+// (asc) treats such a comment as an "entry type comment" and errors out
+// because entry-type comments are not used for prompts. Comments separated by
+// a blank line, and comments on individual action types, are preserved.
+export function stripEntryTypeComment(
Agreed that regex over TS source is inherently fragile. This one is deliberately narrow — it strips a comment block only when it sits immediately above the entry union and stops at the first blank or code line (with tests covering it) — but a TS-compiler/SchemaParser approach (locate the union node, use getLeadingCommentRanges) would be more robust. I can do that refactor; leaving open pending a scope decision on doing it in this PR vs. a follow-up.
—
Reply to this email directly, view it on GitHub<#2754?email_source=notifications&email_token=AGBS6WJTZSUIKLTTPN2PBU35HLGX5A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGUZTIOBTGAYKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2L24DSL5ZGK5TJMV3V63TPORUWM2LDMF2GS33OONPWG3DJMNVQ#discussion_r3680025643>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGBS6WLNOECFDMAMDHIVNCT5HLGX5AVCNFSNUABFKJSXA33TNF2G64TZHM4DEOJVGUZTQOJSHNEXG43VMU5TKMBQGU2DQMJUGY32C5QC>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AGBS6WPOKBEKXP7C2CRT72T5HLGX5A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGUZTIOBTGAYKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG> and Android<https://github.com/notifications/mobile/android/AGBS6WOVO3YO7LFQIKBSW3L5HLGX5A5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGUZTIOBTGAYKM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>. Download it today!
You are receiving this because your review was requested.Message ID: ***@***.***>
|
|
Curtis write a schema parser that's entirely self-contained in our repo. 🙂 No need for the dependency.
________________________________
From: Tal Zaccai ***@***.***>
Sent: Wednesday, July 29, 2026 10:21 PM
To: microsoft/TypeAgent ***@***.***>
Cc: Robert Gruen ***@***.***>; Review requested ***@***.***>
Subject: Re: [microsoft/TypeAgent] TypeAgent Studio: New agent wizard (PR #2754)
@TalZaccai commented on this pull request.
________________________________
In ts/packages/agents/onboarding/src/scaffolder/scaffolderHandler.ts<#2754?email_source=notifications&email_token=AGBS6WPD652HJBXDYSOORN35HLLOFA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGU2TOOBUG43KM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2K64DSL5ZGK5TJMV3V6Y3MNFRWW#discussion_r3680200528>:
@@ -517,6 +543,51 @@ function buildMainSchemaWithSubGroups(
};
}
+// Remove a documentation comment attached directly (no blank line) above the
+// entry union `export type <Pascal>Actions = ...`. The action-schema compiler
+// (asc) treats such a comment as an "entry type comment" and errors out
+// because entry-type comments are not used for prompts. Comments separated by
+// a blank line, and comments on individual action types, are preserved.
+export function stripEntryTypeComment(
Done in ae7dedc<ae7dedc>. Rewrote stripEntryTypeComment to use the TypeScript parser instead of regex over the source text: ts.createSourceFile locates the export type <Pascal>Actions alias, then ts.getLeadingCommentRanges walks the leading comments and strips only the block directly attached to the declaration (no blank line between them). Comments separated by a blank line and per-action comments are preserved, and it's a no-op when there's no matching union. typescript is promoted to a runtime dependency to match the actionSchema/typeagent convention for importing the compiler API.
—
Reply to this email directly, view it on GitHub<#2754?email_source=notifications&email_token=AGBS6WNH7BLJA4YK3BKBFK35HLLOHA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGU2TOOBUG43KM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2L24DSL5ZGK5TJMV3V63TPORUWM2LDMF2GS33OONPWG3DJMNVQ#discussion_r3680200528>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGBS6WKVPPDFXQ7PWTFMDJL5HLLOHAVCNFSNUABFKJSXA33TNF2G64TZHM4DEOJVGUZTQOJSHNEXG43VMU5TKMBQGU2DQMJUGY32C5QC>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AGBS6WLM6XPATP65DTLTD2T5HLLOHA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGU2TOOBUG43KM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG> and Android<https://github.com/notifications/mobile/android/AGBS6WP672TJAQTLLDWJQH35HLLOHA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTIOBRGU2TOOBUG43KM4TFMFZW63VQOJSXM2LFO5PXEZLROVSXG5DFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>. Download it today!
You are receiving this because your review was requested.Message ID: ***@***.***>
|
grammarGenHandler now issues its LLM call via a TypeChat json translator
(createTypeScriptJsonValidator + createJsonTranslator) instead of a raw
model.complete, matching the rest of the codebase's structured LLM calls.
Our prompts already carry the full instructions and JSON contract, so
createRequestPrompt is suppressed and the call is driven from our own
prompt sections (same pattern as the markdown agent). TypeChat now handles
typed extraction/validation of the { grammar } envelope, so the manual
extractGrammarContent salvage is removed. The substantive agc compile->repair
loop is unchanged.
Addresses PR #2754 review comment (robgruen).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Addresses PR #2754 review: the "entry type comment" rule is an action-schema concept (the parser and asc reject it), so the strip helper belongs in @typeagent/action-schema rather than the onboarding agent reaching for a raw `typescript` dependency. Onboarding now imports the shared helper and drops its direct `typescript` dependency; the function takes the full entry type name so it is reusable beyond the scaffolder. Behavior is unchanged (AST-based, robust against schema-looking text inside string literals). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Handled — this is exactly why moving off the regex to the TS parser matters. A string literal's contents are never parsed as a Verified in 44f9188 with a test covering precisely that: a |
Agreed — done in 44f9188. Moved |
The prior commit removed `typescript` from onboarding entirely, but it is still required as a build tool (`tsc -b`); CI failed with `tsc: command not found` (exit 127). Runtime code no longer imports the compiler API (it uses @typeagent/action-schema), so typescript belongs in devDependencies, not dependencies. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Summary
Adds the New Agent wizard to TypeAgent Studio: a VS Code webview that walks a user from an API
source (doc URL / OpenAPI spec / CLI command) to a working, packaged agent through 7 phases —
Discovery → PhraseGen → SchemaGen → GrammarGen → Scaffolder → Testing → Packaging.
Command:
typeagent-studio.newAgent.What this PR does
streams per-phase progress, ending with a "Try it" step.
channels; the extension's in-process dispatcher is removed. A service-side
phaseRunnerorchestratesthe 7 phases.
phase, so Testing and Packaging operate on a built agent (fixes the
ERR_MODULE_NOT_FOUNDgap). Thebuild runs isolated (
--ignore-workspace) so onboarding never triggers a workspace-wide install.translated (not executed) to prove the wizard produced a routable agent.
deterministically, and the CLI handler codegen template was fixed to type-check.
randomStubCLI (with a one-command deploy script) serves as asource-controlled Discovery target for the walkthrough.
Testing
onboardingPhaseRunner,utteranceProver,generatedAgentTranslator,wizardProtocol,wizardViewModel, webview bundle.randomStub: all 7 phases green (Testing 75/75, Packaging validated).File breakdown
typeagent-studio):wizardView.ts,webviewKit/{wizardProtocol,wizardViewModel}.ts,webviewKit/client/wizard.ts,media/wizard.css,esbuild.mjs; command wiring incommands.ts/extension.ts; deletesstudioRuntime.ts; talks to service viaserviceRuntimeFacade.ts/studioServiceClient.ts.typeagent-core+studio-service): onboarding channels instudioProtocol.ts/studioRuntimeCore.ts;onboarding/{phaseRunner,dispatcherGateway,utteranceProver}.ts; wired viaruntime.ts/studioRpcHandlers.ts.defaultAgentProvider):onboardingDispatcher.ts,generatedAgentTranslator.ts,serviceKeys.ts.agents/onboarding):lib/agentBuild.ts,scaffolderHandler.ts(build-in-scaffolder +isolated build),
grammarGenHandler.ts(repair loop),cliHandler.template(codegen fix),packagingHandler.ts.dotnet/randomStub):Program.cs,randomStub.csproj,deploy.mjs,README.md.Review order
Read commit-by-commit — the history is already sliced: channelization + wizard foundation → "Try it"
proof → GrammarGen reliability → build-in-scaffolder → isolated build → Try-it fix → randomStub demo.
Follow-ups (not in this PR)
packages/agents/<name>(the tracked repo, where discovery looks), but this PR builds them with an--ignore-workspaceworkaround and emitslink:deps so the build never rewrites the shared lockfileor relinks native modules while the service is running. The follow-up makes the committed agent look
like every hand-written agent —
workspace:*deps and a relative tsconfig base — and has the wizardbuild it in place by linking its
@typeagent/*deps to the already-built sibling packages (noworkspace
pnpm install, no lockfile churn). The lockfile delta is then recorded by the user's nextordinary install, like any added package.
downstream phases stale and that the diff preview reflects real artifact changes.
@typeagent create an agent for Xroute that opens the wizardpre-seeded with the description.
utterance answered, health passes, no manual edits), with both a mocked-LLM and a live variant.