Repository navigation
C26: Inspector field kit and catalog hook - #896
Merged
Merged
Conversation
Shared Inspector controls for the node forms - SecretRefField
({ env }/{ secret }/plain with per-kind name validation), StringListField
(chips), KeyValueField (draft rows with duplicate-key and key-pattern
errors, order kept), JsonField (blur-parse draft), OptionalNumberField
and ChoiceField - plus useCatalog, a module-cached hook over the
GET /catalog/* routes with refreshCatalog for retries. SecretRef joins
shared/wireTypes.ts, derived from the webhook trigger's secret field.
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
What changed
src/canvas/useCatalog.ts—useCatalog(kind)fetchesGET /catalog/<kind>once per page load through a module-level promise cache shared by every caller;refreshCatalog(kind)drops the entry so a Retry button refetches. Uses the per-kind RuntimeClient methods that already exist (catalogModels,catalogTools, …) rather than adding a genericcatalog(kind).src/canvas/fields/— the shared Inspector controls, one component per file, CSS infields.css(tokens only):SecretRefField— kind Select (Environment variable / Studio secret / Plain text only withallowPlain) + one Input; env^[A-Z_][A-Z0-9_]*$and secret-name validation, plain-mode warning hint,Requiredwhen empty + required,undefinedon empty.StringListField— chips witharia-label="Remove <item>"buttons; Enter or comma adds, duplicates ignored, last remove →undefined.KeyValueField— draft rows (key + text or SecretRefField-with-allowPlain value + remove), Add appends{ '': '' }, duplicate keys → 'Each name must be unique',keyPattern→ 'Use capitals, digits and underscores', insertion order preserved, empty →undefined.JsonField— mono Textarea draft; blur parses →check→onChange; 'This is not valid JSON: '; draft kept while invalid; empty →undefined.OptionalNumberField—type=number, range andintegererrors, invalid input never emitted,unitsuffix.ChoiceField<T>— Select with index-valued options;allowUnsetadds a first option (unsetLabel, default 'Default') →undefined.shared/wireTypes.ts—SecretRef, derived from the webhook trigger'ssecretfield (the SDK keeps the type private, so this cannot drift, likeMcpServerSpecV2).src/__tests__/contrast.test.ts— added thewarning/surfacepair for the plain-text warning hint. No other new text/background pairs.How it was tested
npm run typecheck --workspace apps/agent-forge— clean (also typechecks e2e tsconfig)npx vitest runin apps/agent-forge — 95 files / 1012 tests pass, incl. 7 new test files (useCatalog, SecretRefField, StringListField, KeyValueField, JsonField, OptionalNumberField, ChoiceField)npm run typecheck:server+npm run test:server --workspace apps/agent-forge— 85 files / 1121 tests passnpx tsc --noEmit,npm run lint, Studionpm run lint— clean (0 errors)npm run test:coverage— 7246 pass; the only failures are the 6src/spec/v2/templates.test.tsREADME checks caused by CRLF working-tree checkouts (known environmental issue on this machine;git ls-files --eolshowsw/crlf). The create-lousho e2e failures disappeared after building that workspace's dist.npm run fallow— no issuesnpm run docs:ratchet(at baseline),npm run api:check(20/20 up to date),npm run docs:llms:check,npm run size-check(within budgets) — all passAcceptance criteria
useCatalog('models')at once trigger one request — module-level promise cache; test asserts onecatalogModelscall for two mounted consumersrefreshCatalogmakes the next mount refetch — covered by testundefinedon empty — covered per componentsrc/__tests__/contrast.test.ts—warning/surfaceadded, all CSS uses tokensGenerated with Devin