@vectros-ai/blueprints 0.5.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/README.md +11 -2
- package/dist/index.d.mts +152 -15
- package/dist/index.d.ts +152 -15
- package/dist/index.js +734 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +734 -2
- package/dist/index.mjs.map +1 -1
- package/guides/agentic-sdlc.md +210 -0
- package/package.json +3 -1
- package/prompts/agentic-sdlc-agent.md +127 -0
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/identities.ts","../src/inputs.ts","../src/blueprints/task-management.ts","../src/blueprints/coding-agent-memory.ts","../src/blueprints/second-brain.ts","../src/blueprints/clinical-intake.ts"],"sourcesContent":["/**\n * @vectros-ai/blueprints — the Blueprint format + the curated bundled\n * library. Data + structural validation only; the scope gate (enforcement)\n * lives in @vectros-ai/cli.\n */\nexport {\n BlueprintSchema,\n BlueprintValidationError,\n parseBlueprint,\n parseBlueprintJson,\n contextNameOf,\n type Blueprint,\n type BlueprintFieldDef,\n type BlueprintSchemaDef,\n type BlueprintSeedRecord,\n type BlueprintValidationRules,\n type BlueprintRenderHints,\n type BlueprintLookupField,\n type BlueprintRoleClause,\n type BlueprintRoles,\n type IdentityDecl,\n type IdentitiesDecl,\n type BlueprintIssue,\n} from './types.js';\n\nexport {\n resolveBlueprintIdentities,\n collectIdentityReferences,\n BlueprintIdentityError,\n type IdentityResolver,\n} from './identities.js';\n\nexport {\n InputsDeclSchema,\n BlueprintInputError,\n resolveBlueprintInputs,\n deriveSuffix,\n type InputDecl,\n type InputsDecl,\n type InputScalar,\n} from './inputs.js';\n\nimport type { Blueprint } from './types.js';\nimport taskManagement from './blueprints/task-management.js';\nimport codingAgentMemory from './blueprints/coding-agent-memory.js';\nimport secondBrain from './blueprints/second-brain.js';\nimport clinicalIntake from './blueprints/clinical-intake.js';\n\n/**\n * The curated blueprints bundled with the library, in menu-display order.\n * To add one: drop a `blueprints/<name>.ts` exporting a `Blueprint`\n * default, import it here, and add it to this array.\n */\nexport const BUNDLED_BLUEPRINTS: readonly Blueprint[] = [\n taskManagement,\n codingAgentMemory,\n secondBrain,\n clinicalIntake,\n];\n\n/** Names available for `--blueprint <name>`. */\nexport const BLUEPRINT_NAMES: readonly string[] = BUNDLED_BLUEPRINTS.map((b) => b.name);\n\n/** Look up a bundled blueprint by name; `undefined` if none matches. */\nexport function getBlueprint(name: string): Blueprint | undefined {\n return BUNDLED_BLUEPRINTS.find((b) => b.name === name);\n}\n","/**\n * Blueprint format + STRUCTURAL validation.\n *\n * A blueprint is a versioned, reviewed bundle: a schema set + a\n * least-privilege AccessProfile + a service principal + optional seed\n * data, all with stable identifiers so a loader re-run converges instead\n * of duplicating.\n *\n * This package owns the FORMAT + structural (zod) validation ONLY. The\n * security boundary — the scope gate that bounds a blueprint's requested\n * `allowedActions` to data-plane-only — lives in the CLI binary\n * (`@vectros-ai/cli`), NOT here: blueprints are untrusted input, and the\n * trust boundary is the binary that mints.\n *\n * The blueprint's stable id is `name` (renamed from the v0.3-internal\n * `pack` field during a later split — no shipped consumers).\n */\nimport { z } from 'zod';\n\n// AppContext contextId rule mirrors the backend (3-31 chars, starts with a\n// lowercase letter, then lowercase letters/digits/dashes).\nconst CONTEXT_ID_RE = /^[a-z][a-z0-9-]{2,30}$/;\n\n// Field-level validation rules — mirrors the platform `ValidationRules`\n// (platform/common-core/.../template/ValidationRules.java). Passed straight\n// through to `SchemaRequest.FieldDef.validation` so the backend enforces them.\n// `.strict()` so an unknown rule key is a clear authoring error, not a silent\n// no-op (the platform tolerates extra keys, but our format should teach).\nconst ValidationRulesSchema = z\n .object({\n required: z.boolean().optional(),\n minLength: z.number().int().optional(),\n maxLength: z.number().int().optional(),\n min: z.number().int().optional(),\n max: z.number().int().optional(),\n pattern: z.string().optional(),\n email: z.boolean().optional(),\n url: z.boolean().optional(),\n phone: z.boolean().optional(),\n step: z.number().int().optional(),\n multipleOf: z.number().int().optional(),\n minItems: z.number().int().optional(),\n maxItems: z.number().int().optional(),\n })\n .strict();\n\n// Per-field render hints — authored field-by-field for readability; the loader\n// pivots them into the schema-level `renderHints` map keyed by fieldId that the\n// platform `SchemaRequest.renderHints` (RenderHintDef) expects.\nconst RenderHintsSchema = z\n .object({\n label: z.string().optional(),\n widget: z.enum(['text', 'textarea', 'select', 'date', 'checkbox']).optional(),\n order: z.number().int().optional(),\n section: z.string().optional(),\n helpText: z.string().optional(),\n // Marks this field as the record's headline (display) field — the linked\n // primary column in the records list + the title on the detail view. At most\n // one per schema (the platform takes the first by order). Format passthrough →\n // SchemaRequest.renderHints[fieldId].displayField.\n displayField: z.boolean().optional(),\n })\n .strict();\n\nconst BlueprintFieldDefSchema = z\n .object({\n fieldId: z.string().min(1),\n fieldType: z.string().min(1),\n required: z.boolean().optional(),\n searchable: z.boolean().optional(),\n filterable: z.boolean().optional(),\n enumValues: z.array(z.string()).optional(),\n description: z.string().optional(),\n // NEW (format passthrough) — the loader stopped dropping these.\n validation: ValidationRulesSchema.optional(),\n renderHints: RenderHintsSchema.optional(),\n // Marks the field as sensitive (PHI/PII): the platform redacts it from\n // logs/audit/errors AT WRITE TIME, blind-indexes it for lookups, EXCLUDES it\n // from the search index, and masks it in responses unless the token carries\n // the `s` reveal scope for this record type (SchemaRequest.FieldDef.sensitive).\n // Format passthrough — the loader forwards it to createSchema. Default false.\n sensitive: z.boolean().optional(),\n // Reference-field surface — a typed foreign-key link to another record. The\n // platform (SchemaRequest.FieldDef) requires BOTH targetTypeName AND\n // targetSurface on a reference field; the blueprint format uses the SAME names\n // as the SDK so they forward 1:1, and the loader provisions a real reference.\n // (Write-time existence enforcement is on by default platform-side; the target\n // must exist when a referencing record is written — order your seed accordingly.)\n targetTypeName: z.string().min(1).optional(),\n // The field on the target record used to resolve the link; defaults (platform\n // side) to the target's externalId/lookup key when omitted. Must name a UNIQUE\n // lookup on the target type.\n targetField: z.string().min(1).optional(),\n // Which surface the target lives on. REQUIRED on a reference field: the same\n // typeName can exist on more than one surface, so this disambiguates which\n // lookup resolves the link (SchemaRequest.FieldDef.targetSurface).\n targetSurface: z.enum(['record', 'document', 'user', 'org', 'client']).optional(),\n cardinality: z.enum(['one', 'many']).optional(),\n })\n .strict()\n .superRefine((field, ctx) => {\n const isReference = field.fieldType === 'reference';\n const hasRefKeys =\n field.targetTypeName !== undefined ||\n field.targetField !== undefined ||\n field.targetSurface !== undefined ||\n field.cardinality !== undefined;\n if (isReference && field.targetTypeName === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['targetTypeName'],\n message: \"a 'reference' field requires 'targetTypeName' (the typeName it points to)\",\n });\n }\n if (isReference && field.targetSurface === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['targetSurface'],\n message:\n \"a 'reference' field requires 'targetSurface' (which surface the target lives on: record | document | user | org | client)\",\n });\n }\n if (!isReference && hasRefKeys) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['fieldType'],\n message:\n \"targetTypeName/targetField/targetSurface/cardinality are only valid on a field with fieldType: 'reference'\",\n });\n }\n });\n\n// A lookup field is either a bare field name (back-compat) or an object form\n// that can additionally declare a uniqueness constraint, an ordered range/prefix\n// index, an exact-match sort key, or an opt-in past the fast-index budget. The\n// loader normalizes both to the partner-API `LookupDef` shape ([SV5]).\nconst BlueprintLookupFieldSchema = z.union([\n z.string().min(1),\n z\n .object({\n fieldName: z.string().min(1),\n unique: z.boolean().optional(),\n // Opt this field into ordered range + prefix lookups (from/to/prefix) on\n // top of exact match. Billed at the range-index rate; not valid on a\n // sensitive field (a blind index is not orderable). Locked at create.\n rangeEnabled: z.boolean().optional(),\n // Sort key for the exact-match index: 'createdAt' (default), 'lastUpdated',\n // or a declared field on this schema. Locked at create.\n sortBy: z.string().min(1).optional(),\n // Opt a field past the fixed fast-index budget into a higher-cost\n // secondary index. No effect on a field that fits within the budget.\n allowOverflow: z.boolean().optional(),\n })\n .strict(),\n]);\n\n// Schema capabilities — today just `auditHistory` (platform default true). We\n// surface it so a blueprint's audit posture is self-documenting + reviewable.\nconst BlueprintCapabilitiesSchema = z\n .object({\n auditHistory: z.boolean().optional(),\n })\n .strict();\n\nconst BlueprintSchemaSchema = z\n .object({\n typeName: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n indexMode: z.enum(['HYBRID', 'SEMANTIC', 'TEXT']).optional(),\n fields: z.array(BlueprintFieldDefSchema).default([]),\n lookupFields: z.array(BlueprintLookupFieldSchema).max(10).optional(),\n // Which typed surfaces may bind this schema. REQUIRED + non-empty on\n // the platform `SchemaRequest` (0.23+); the loader defaults it to ['record']\n // when a blueprint omits it (blueprints provision record types + seed records).\n allowedSurfaces: z.array(z.enum(['record', 'document', 'user', 'org', 'client'])).min(1).optional(),\n // NEW (format passthrough) — mirror the platform `SchemaRequest` shape 1:1.\n capabilities: BlueprintCapabilitiesSchema.optional(),\n // Whether the schema is active; inactive schemas reject new record creation.\n active: z.boolean().optional(),\n // Schema-level ownership defaults — flat, matching `SchemaRequest`\n // userId/orgId/clientId. With a scoped token these must be consistent with\n // the profile's dataScope (a cross-consistency lint is deferred to the lint slice).\n userId: z.string().min(1).optional(),\n orgId: z.string().min(1).optional(),\n clientId: z.string().min(1).optional(),\n })\n .strict();\n\nconst BlueprintAccessProfileSchema = z\n .object({\n // Validated structurally here; the SCOPE GATE (in @vectros-ai/cli) is\n // what enforces the data-plane-only security boundary.\n allowedActions: z.array(z.string().min(1)).min(1),\n // Optional ownership binding: { userId: [...], orgId: [...], clientId: [...] }.\n // A `null` element in a value list is the documented NULL SENTINEL — it\n // grants access to TENANT-LEVEL (owner-less) records IN ADDITION to the\n // listed owner ids. `null` is the literal matched value: a tenant-level\n // record has a genuinely-null ownership field, and the platform's scope\n // matcher tests `allowedValues.contains(null)` against the tenant-level\n // null sentinel (+ ScopeClause). e.g. `{ orgId: [\"org_x\", null] }` =\n // \"org_x's records AND tenant-shared records\". Omitting null restricts to\n // the listed owners ONLY (the key will NOT see tenant-level/seed records).\n dataScope: z.record(z.array(z.union([z.string().min(1), z.null()]))).optional(),\n })\n .strict();\n\n// A single role clause — mirrors the platform/SDK ScopeClause (allowedActions +\n// optional per-clause dataScope). Multi-clause roles let one role grant several\n// (action-set, data-scope) rules at once, evaluated per-clause server-side.\n// `${{ self.* }}` placeholders are legal in a clause's dataScope: they are a\n// RUNTIME sentinel the platform resolves per-principal at request time\n// — the install-time resolver leaves them literal (see inputs.ts),\n// and a top-level lint (BlueprintSchema) confines them to here.\nconst BlueprintRoleClauseSchema = z\n .object({\n allowedActions: z.array(z.string().min(1)).min(1),\n dataScope: z.record(z.array(z.union([z.string().min(1), z.null()]))).optional(),\n })\n .strict();\n\n// Optional top-level `roles`: a map of roleId → ordered clauses. Authored in the\n// blueprint and bound to principals via `vectros access grant --role <id>`.\n// DISTINCT from `accessProfile` (the least-privilege scope the bootstrap mints\n// for the blueprint's own service-principal key). Roles are identity-agnostic,\n// reusable, multi-clause rules (architecture §6).\nconst BlueprintRolesSchema = z.record(z.array(BlueprintRoleClauseSchema).min(1));\n\n// A declared identity — a principal the blueprint expects to exist, ensured\n// (idempotently, by externalId) at APPLY time by a creds-bearing pass (the CLI\n// install orchestrator). Referenced elsewhere via `${{ identities.<name> }}`,\n// which the install-time resolver leaves literal and the apply pass substitutes\n// with the resolved principal id. The schema is FORMAT/shape only; resolution\n// (resolveBlueprintIdentities) lives in identities.ts.\nconst IdentityDeclSchema = z\n .object({\n kind: z.enum(['user', 'org', 'client']),\n externalId: z.string().min(1),\n displayName: z.string().min(1).optional(),\n metadata: z.record(z.unknown()).optional(),\n })\n .strict();\n\n// Optional top-level `identities` block — a map of local name → declaration.\n// Exported so the apply-time resolver (identities.ts) validates the block too.\nexport const IdentitiesDeclSchema = z.record(IdentityDeclSchema);\n\nconst BlueprintServicePrincipalSchema = z\n .object({\n externalId: z.string().min(1),\n displayName: z.string().min(1),\n })\n .strict();\n\nconst BlueprintSeedRecordSchema = z\n .object({\n typeName: z.string().min(1),\n externalId: z.string().min(1),\n fields: z.record(z.unknown()),\n })\n .strict();\n\n// `${{ self.* }}` is a RUNTIME per-principal placeholder (platform-resolved at\n// request time). It is only meaningful inside a role clause's\n// dataScope; anywhere else in a blueprint it would never resolve. This walk\n// confines it there (teach-by-error), running on the already-input-resolved doc\n// (the install-time resolver leaves self tokens literal — see inputs.ts).\nconst SELF_TOKEN_RE = /\\$\\{\\{\\s*self\\.[A-Za-z_]\\w*\\s*\\}\\}/;\n\nfunction lintSelfTokenPlacement(value: unknown, ctx: z.RefinementCtx): void {\n const walk = (node: unknown, path: (string | number)[], inRoleDataScope: boolean): void => {\n if (typeof node === 'string') {\n if (!inRoleDataScope && SELF_TOKEN_RE.test(node)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path,\n message:\n \"'${{ self.* }}' is a runtime per-principal placeholder — it is only valid inside a roles[].dataScope value\",\n });\n }\n return;\n }\n if (Array.isArray(node)) {\n node.forEach((v, i) => walk(v, [...path, i], inRoleDataScope));\n return;\n }\n if (node && typeof node === 'object') {\n for (const [k, v] of Object.entries(node as Record<string, unknown>)) {\n // path === ['roles', <roleId>, <clauseIndex>] and key 'dataScope' opens\n // the only subtree where self.* is allowed.\n const entering =\n inRoleDataScope || (path.length === 3 && path[0] === 'roles' && k === 'dataScope');\n walk(v, [...path, k], entering);\n }\n }\n };\n walk(value, [], false);\n}\n\n// Every `${{ identities.<name> }}` reference must point at a declared identity in\n// the top-level `identities` block — caught offline (at validate/plan), before\n// the creds-bearing apply pass tries (and fails) to resolve an unknown name.\nconst IDENTITY_REF_RE = /\\$\\{\\{\\s*identities\\.([A-Za-z_]\\w*)\\s*\\}\\}/g;\n\nfunction lintIdentityRefsDeclared(value: unknown, ctx: z.RefinementCtx): void {\n const declared = new Set(\n value && typeof value === 'object' && 'identities' in value && (value as { identities?: unknown }).identities\n ? Object.keys((value as { identities: Record<string, unknown> }).identities)\n : [],\n );\n const walk = (node: unknown, path: (string | number)[]): void => {\n if (typeof node === 'string') {\n for (const m of node.matchAll(IDENTITY_REF_RE)) {\n if (!declared.has(m[1])) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path,\n message: `'\\${{ identities.${m[1]} }}' references an undeclared identity — add '${m[1]}' to the top-level 'identities' block`,\n });\n }\n }\n return;\n }\n if (Array.isArray(node)) {\n node.forEach((v, i) => walk(v, [...path, i]));\n } else if (node && typeof node === 'object') {\n // Don't scan the declarations themselves (their values aren't token refs).\n for (const [k, v] of Object.entries(node as Record<string, unknown>)) {\n if (path.length === 0 && k === 'identities') continue;\n walk(v, [...path, k]);\n }\n }\n };\n walk(value, []);\n}\n\nexport const BlueprintSchema = z\n .object({\n /** Stable blueprint id (the `--blueprint <name>` selector + idempotency key). */\n name: z.string().min(1),\n version: z.string().min(1),\n description: z.string().min(1),\n /** The app-context the profile + scoped key bind to (e.g. \"mcp\"). */\n contextId: z.string().regex(CONTEXT_ID_RE, {\n message:\n \"contextId must be 3-31 chars, start with a lowercase letter, then lowercase letters/digits/dashes (e.g. 'mcp')\",\n }),\n /** Human-readable app-context name; defaults to `MCP — <name>` (see {@link contextNameOf}) when absent. */\n contextName: z.string().min(1).optional(),\n schemas: z.array(BlueprintSchemaSchema).default([]),\n accessProfile: BlueprintAccessProfileSchema,\n servicePrincipal: BlueprintServicePrincipalSchema,\n seed: z.array(BlueprintSeedRecordSchema).optional(),\n /** Optional multi-clause roles, bound to principals via `access grant --role`. */\n roles: BlueprintRolesSchema.optional(),\n /** Optional principals ensured-exist at apply; referenced via ${{ identities.* }}. */\n identities: IdentitiesDeclSchema.optional(),\n })\n .strict()\n .superRefine((bp, ctx) => {\n lintSelfTokenPlacement(bp, ctx);\n lintIdentityRefsDeclared(bp, ctx);\n });\n\nexport type Blueprint = z.infer<typeof BlueprintSchema>;\nexport type BlueprintFieldDef = z.infer<typeof BlueprintFieldDefSchema>;\nexport type BlueprintSchemaDef = z.infer<typeof BlueprintSchemaSchema>;\nexport type BlueprintSeedRecord = z.infer<typeof BlueprintSeedRecordSchema>;\nexport type BlueprintValidationRules = z.infer<typeof ValidationRulesSchema>;\nexport type BlueprintRenderHints = z.infer<typeof RenderHintsSchema>;\nexport type BlueprintLookupField = z.infer<typeof BlueprintLookupFieldSchema>;\nexport type BlueprintRoleClause = z.infer<typeof BlueprintRoleClauseSchema>;\nexport type BlueprintRoles = z.infer<typeof BlueprintRolesSchema>;\nexport type IdentityDecl = z.infer<typeof IdentityDeclSchema>;\nexport type IdentitiesDecl = z.infer<typeof IdentitiesDeclSchema>;\n\n/**\n * A single structural validation problem, flattened to a readable field path +\n * message. Exposed on {@link BlueprintValidationError.issues} so programmatic\n * callers (a future web authoring UI, CI annotations) get structure without\n * re-parsing the rendered message.\n */\nexport interface BlueprintIssue {\n /** Dotted/bracketed path, e.g. `schemas[0].fields[1].fieldType`, or `(root)`. */\n path: string;\n message: string;\n}\n\n/** Render a zod issue path (`['schemas', 0, 'fields', 1]`) → `schemas[0].fields[1]`. */\nfunction formatIssuePath(path: ReadonlyArray<string | number>): string {\n let out = '';\n for (const seg of path) {\n if (typeof seg === 'number') out += `[${seg}]`;\n else out += out.length ? `.${seg}` : seg;\n }\n return out.length ? out : '(root)';\n}\n\n/** Flatten a {@link z.ZodError} into readable, ordered {path, message} entries. */\nfunction toBlueprintIssues(error: z.ZodError): BlueprintIssue[] {\n return error.issues.map((i) => ({ path: formatIssuePath(i.path), message: i.message }));\n}\n\n/** Render issues into the multi-line, teach-by-error message body. */\nfunction renderIssues(issues: BlueprintIssue[]): string {\n return issues.map((i) => ` • ${i.path}: ${i.message}`).join('\\n');\n}\n\nexport class BlueprintValidationError extends Error {\n /**\n * Structured per-field issues. Populated for STRUCTURAL failures (a bad\n * shape); empty for a JSON/YAML *parse* failure (where there's no field path,\n * just a syntax error in {@link Error.message}).\n */\n readonly issues: BlueprintIssue[];\n constructor(message: string, issues: BlueprintIssue[] = []) {\n super(message);\n this.name = 'BlueprintValidationError';\n this.issues = issues;\n }\n}\n\n/**\n * Structurally parse + validate an untrusted blueprint object. Throws\n * {@link BlueprintValidationError} on a malformed shape — with a readable,\n * multi-line `path: message` body and the structured issues on `.issues`. Does\n * NOT run the scope gate — that's the CLI's job (the trust boundary).\n */\nexport function parseBlueprint(input: unknown): Blueprint {\n const result = BlueprintSchema.safeParse(input);\n if (!result.success) {\n const issues = toBlueprintIssues(result.error);\n throw new BlueprintValidationError(`Malformed blueprint:\\n${renderIssues(issues)}`, issues);\n }\n return result.data;\n}\n\n/**\n * Parse a blueprint from a JSON string (e.g. a file an agent assembled or\n * a community blueprint). Throws {@link BlueprintValidationError} on bad\n * JSON or a bad shape.\n */\nexport function parseBlueprintJson(json: string): Blueprint {\n let parsed: unknown;\n try {\n parsed = JSON.parse(json);\n } catch (err) {\n throw new BlueprintValidationError(\n `Blueprint is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n return parseBlueprint(parsed);\n}\n\n/** The app-context display name, defaulting to `MCP — <name>` when {@link Blueprint.contextName} is absent. */\nexport function contextNameOf(blueprint: Blueprint): string {\n return blueprint.contextName ?? `MCP — ${blueprint.name}`;\n}\n","/**\n * Identity resolution — the APPLY-time (creds-bearing) half of the blueprint\n * identity feature.\n *\n * A blueprint may declare a top-level `identities:` block (principals it expects\n * to exist) and reference them with `${{ identities.<name> }}` tokens anywhere a\n * principal id is valid (seed-record ownership, schema/profile dataScope, a role\n * clause). Resolution has TWO tiers — DO NOT conflate (mirrors inputs.ts):\n * - install-time (creds-free): {@link resolveBlueprintInputs} resolves\n * `${{ inputs.* }}`/`${{ vectros.* }}` and LEAVES `${{ identities.* }}` literal\n * (it is a deferred namespace).\n * - apply-time (creds): THIS module ensures each declared identity exists\n * (idempotently, by externalId — the injected `resolve` does the API call,\n * wired by the CLI install orchestrator) and substitutes the tokens with\n * the resolved principal ids.\n *\n * This module is the FORMAT half: the resolver is pure given an injected\n * `resolve` (so `plan` can dry-run/echo and tests can assert without creds). The\n * `identities` block shape lives in types.ts so {@link BlueprintSchema} validates\n * it offline (incl. the \"every reference is declared\" lint).\n */\nimport { IdentitiesDeclSchema, type IdentityDecl, type BlueprintIssue } from './types.js';\n\n/** A `${{ identities.<name> }}` reference (global, for scan/replace). */\nconst IDENTITY_TOKEN_RE = /\\$\\{\\{\\s*identities\\.([A-Za-z_]\\w*)\\s*\\}\\}/g;\n\n/** Resolves a declared identity to its concrete principal id (idempotent, by externalId). */\nexport type IdentityResolver = (name: string, decl: IdentityDecl) => Promise<string>;\n\n/** A creds-bearing identity-resolution failure (undeclared ref, bad block, resolver error). */\nexport class BlueprintIdentityError extends Error {\n readonly issues: BlueprintIssue[];\n constructor(message: string, issues: BlueprintIssue[] = []) {\n super(message);\n this.name = 'BlueprintIdentityError';\n this.issues = issues;\n }\n}\n\n/** Every distinct identity name referenced by `${{ identities.<name> }}` in the tree. */\nexport function collectIdentityReferences(value: unknown): string[] {\n const found = new Set<string>();\n const walk = (node: unknown): void => {\n if (typeof node === 'string') {\n for (const m of node.matchAll(IDENTITY_TOKEN_RE)) found.add(m[1]);\n } else if (Array.isArray(node)) {\n node.forEach(walk);\n } else if (node && typeof node === 'object') {\n Object.values(node as Record<string, unknown>).forEach(walk);\n }\n };\n walk(value);\n return [...found];\n}\n\n/** Substitute every `${{ identities.<name> }}` in the tree with `idMap[name]` (values only). */\nfunction substitute(node: unknown, idMap: Record<string, string>): unknown {\n if (typeof node === 'string') {\n return node.replace(IDENTITY_TOKEN_RE, (_full, name: string) => idMap[name]);\n }\n if (Array.isArray(node)) return node.map((v) => substitute(v, idMap));\n if (node && typeof node === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(node as Record<string, unknown>)) out[k] = substitute(v, idMap);\n return out;\n }\n return node;\n}\n\n/**\n * Resolve a blueprint's `identities:` against an injected creds-bearing resolver\n * and return the substituted tree WITH the `identities:` block stripped — ready\n * for {@link parseBlueprint}. Operates on the install-time-resolved tree (where\n * `${{ identities.* }}` tokens are still literal). Throws\n * {@link BlueprintIdentityError} on a malformed block, an undeclared reference,\n * or a resolver failure.\n *\n * EVERY declared identity is resolved (ensure-exist), not only referenced ones,\n * so a blueprint can provision a principal it doesn't token-reference. A token\n * that references an undeclared identity is an error (also caught offline by\n * {@link BlueprintSchema}).\n */\nexport async function resolveBlueprintIdentities(raw: unknown, resolve: IdentityResolver): Promise<unknown> {\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return raw;\n const { identities: rawIdentities, ...body } = raw as Record<string, unknown> & { identities?: unknown };\n\n // No block + no references → nothing to do (back-compat with non-identity blueprints).\n const refs = collectIdentityReferences(body);\n if (rawIdentities === undefined && refs.length === 0) return raw;\n\n const parsed = IdentitiesDeclSchema.safeParse(rawIdentities ?? {});\n if (!parsed.success) {\n throw new BlueprintIdentityError(\n 'Blueprint identities block is invalid',\n parsed.error.issues.map((i) => ({\n path: i.path.length ? `identities.${i.path.join('.')}` : 'identities',\n message: i.message,\n })),\n );\n }\n const declared = parsed.data;\n\n const undeclared = refs.filter((name) => !(name in declared));\n if (undeclared.length) {\n throw new BlueprintIdentityError(\n `Blueprint references undeclared identities: ${undeclared.join(', ')}`,\n undeclared.map((name) => ({\n path: `identities.${name}`,\n message: `'\\${{ identities.${name} }}' is referenced but not declared in the 'identities' block`,\n })),\n );\n }\n\n // Ensure-exist every DECLARED identity (idempotent by externalId) → id map.\n const idMap: Record<string, string> = {};\n for (const [name, decl] of Object.entries(declared)) {\n try {\n const id = await resolve(name, decl);\n if (typeof id !== 'string' || id.length === 0) {\n // Guard a misbehaving resolver — substituting undefined/'' would write the\n // literal \"undefined\"/\"\" into ownership fields silently.\n throw new Error(`resolver returned a non-string id (${JSON.stringify(id)})`);\n }\n idMap[name] = id;\n } catch (err) {\n throw new BlueprintIdentityError(\n `Failed to resolve identity '${name}' (${decl.kind} externalId=${decl.externalId}): ${\n err instanceof Error ? err.message : String(err)\n }`,\n [{ path: `identities.${name}`, message: err instanceof Error ? err.message : String(err) }],\n );\n }\n }\n\n return substitute(body, idMap);\n}\n","/**\n * Blueprint variable substitution — the install-time resolver\n * (spec `blueprint-variable-substitution`).\n *\n * A blueprint can declare a top-level `inputs:` block and reference its values\n * (and a tiny reserved `vectros.*` built-in namespace) with GitHub-Actions-style\n * `${{ inputs.x }}` tokens in any STRING value. This module resolves those\n * tokens against supplied install-time values, BEFORE structural validation —\n * so the typed {@link Blueprint}, the loader, and bootstrap never see `inputs`\n * or an unresolved token. It is the FORMAT half of the feature: pure,\n * dependency-free (no node, no IO); the CLI owns YAML parsing + `--set`/`--values`.\n *\n * Two tiers — DO NOT conflate (spec §1):\n * - install-time substitution (HERE): `${{ inputs.x }}`, `${{ vectros.* }}`,\n * resolved by the trusted loader before any API call.\n * - the runtime sentinel `$self` (agent-memory): a literal value the platform\n * resolves per-principal at use. This resolver MUST leave `$self` and ANY\n * `$`-prefixed value untouched — it only ever matches the `${{ … }}` form.\n *\n * Security (spec §3): pure string replacement, no eval/template engine → no\n * template injection. The scope gate (the CLI trust boundary) runs on the\n * RESOLVED document, so a parameter cannot smuggle a control-plane scope past\n * it. Built-ins are intentionally tiny (`context`, `suffix`) — see the\n * auto-binding invariant in the spec §4: data-record externalIds are bound to\n * `(tenant, context[, identity])` server-side, so they need no namespace; only\n * tenant-wide service-principal externalIds do, which is what `vectros.suffix`\n * is for.\n */\nimport { z } from 'zod';\nimport type { BlueprintIssue } from './types.js';\n\n/** Allowed input names: identifier-like (so they read cleanly inside `${{ inputs.x }}`). */\nconst INPUT_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n/** Scalar value types an input may declare / resolve to (V1 — no objects/arrays). */\nexport type InputScalar = string | number | boolean;\n\n/** A single declared input (one entry under the top-level `inputs:` block). */\nconst InputDeclSchema = z\n .object({\n type: z.enum(['string', 'number', 'boolean']),\n required: z.boolean().optional(),\n default: z.union([z.string(), z.number(), z.boolean()]).optional(),\n description: z.string().optional(),\n })\n .strict();\n\n/** The top-level `inputs:` declaration block — a map of name → declaration. */\nexport const InputsDeclSchema = z.record(InputDeclSchema);\n\nexport type InputDecl = z.infer<typeof InputDeclSchema>;\nexport type InputsDecl = z.infer<typeof InputsDeclSchema>;\n\n/**\n * A variable-resolution failure (declaration, missing value, unknown reference,\n * malformed token). Carries structured {@link BlueprintIssue}s — same teach-by-error\n * `path: message` shape as {@link BlueprintValidationError}.\n */\nexport class BlueprintInputError extends Error {\n readonly issues: BlueprintIssue[];\n constructor(message: string, issues: BlueprintIssue[] = []) {\n super(message);\n this.name = 'BlueprintInputError';\n this.issues = issues;\n }\n}\n\nfunction renderIssues(issues: BlueprintIssue[]): string {\n return issues.map((i) => ` • ${i.path}: ${i.message}`).join('\\n');\n}\n\nfunction scalarType(v: unknown): 'string' | 'number' | 'boolean' | 'other' {\n if (typeof v === 'string') return 'string';\n if (typeof v === 'number') return 'number';\n if (typeof v === 'boolean') return 'boolean';\n return 'other';\n}\n\n/**\n * A short, STABLE, non-cryptographic token derived from the install context id.\n * FNV-1a (32-bit) → base36. Deterministic: same contextId ⇒ same suffix ⇒\n * idempotent re-installs (matches the seeding-and-idempotency upsert contract).\n * Used ONLY to namespace tenant-wide service-principal externalIds so two\n * installs of one blueprint in the same tenant (different contexts) don't\n * collide. Not security-sensitive.\n */\nexport function deriveSuffix(contextId: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < contextId.length; i++) {\n h ^= contextId.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(36).padStart(7, '0');\n}\n\ninterface ResolveCtx {\n declared: InputsDecl;\n /** Resolved input values, by name (absent = declared but has no value). */\n values: Record<string, InputScalar>;\n /** Built-ins, or undefined when contextId is not a usable literal. */\n builtins?: { context: string; suffix: string };\n issues: BlueprintIssue[];\n}\n\n/** Matches a string that is EXACTLY one `${{ ns.name }}` token (→ type-coerced value). */\nconst WHOLE_TOKEN_RE = /^\\$\\{\\{\\s*([A-Za-z_]\\w*)\\.([A-Za-z_]\\w*)\\s*\\}\\}$/;\n/**\n * General scan, ordered alternation (longest/most-specific first):\n * 1. `$${{` the escape → literal `${{`\n * 2. `${{ … }}` a complete token (inner validated separately)\n * 3. `${{` a DANGLING opener with no close → reported, never silent\n */\nconst TOKEN_SCAN_RE = /\\$\\$\\{\\{|\\$\\{\\{([\\s\\S]*?)\\}\\}|\\$\\{\\{/g;\n/** A valid inner reference body once trimmed: `namespace.name`. */\nconst INNER_REF_RE = /^([A-Za-z_]\\w*)\\.([A-Za-z_]\\w*)$/;\n\n/**\n * Namespaces this INSTALL-TIME resolver deliberately leaves UNRESOLVED — their\n * `${{ ns.x }}` tokens are re-emitted literally so a later pass / the platform\n * resolves them. `self` is the RUNTIME per-principal sentinel (platform-resolved\n * per request; a top-level lint in types.ts confines it to role\n * dataScope). `identities` is the creds-bearing APPLY-time namespace — its tokens\n * resolve to a principal id in a later pass (resolveBlueprintIdentities), so the\n * install-time resolver leaves them literal too. A deferred token is NOT an\n * \"unknown namespace\" error — distinct from `$`-prefixed values, which are never\n * matched by the `${{ … }}` scanner at all.\n */\nconst DEFERRED_NAMESPACES = new Set(['self', 'identities']);\n\n/** Resolve one `ns.name` reference to its value, or push an issue + return undefined. */\nfunction resolveRef(ns: string, name: string, ctx: ResolveCtx, path: string): InputScalar | undefined {\n if (ns === 'inputs') {\n if (!(name in ctx.declared)) {\n ctx.issues.push({\n path,\n message: `unknown input 'inputs.${name}' — declare it in the top-level 'inputs:' block`,\n });\n return undefined;\n }\n if (!(name in ctx.values)) {\n ctx.issues.push({\n path,\n message: `input 'inputs.${name}' has no value — supply it (--set ${name}=… or --values) or give it a default`,\n });\n return undefined;\n }\n return ctx.values[name];\n }\n if (ns === 'vectros') {\n if (name !== 'context' && name !== 'suffix') {\n ctx.issues.push({\n path,\n message: `unknown built-in 'vectros.${name}' (available: vectros.context, vectros.suffix)`,\n });\n return undefined;\n }\n if (!ctx.builtins) {\n ctx.issues.push({\n path,\n message: `'vectros.${name}' is unavailable: contextId must be a literal string to derive built-ins`,\n });\n return undefined;\n }\n return ctx.builtins[name];\n }\n ctx.issues.push({\n path,\n message: `unknown namespace '${ns}' in '\\${{ ${ns}.${name} }}' (available: inputs, vectros)`,\n });\n return undefined;\n}\n\n/** Interpolate every token in a multi-token / embedded string → a STRING result. */\nfunction interpolate(str: string, ctx: ResolveCtx, path: string): string {\n let out = '';\n let last = 0;\n TOKEN_SCAN_RE.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = TOKEN_SCAN_RE.exec(str)) !== null) {\n out += str.slice(last, m.index);\n if (m[0] === '$${{') {\n out += '${{'; // escape → literal\n } else if (m[0] === '${{' && m[1] === undefined) {\n // Dangling opener (alternative 3): no closing `}}`. Report, don't drop.\n ctx.issues.push({\n path,\n message: `unterminated token '\\${{' — expected a closing '}}' (escape a literal with '$\\${{')`,\n });\n } else {\n const inner = (m[1] ?? '').trim();\n const ref = inner.match(INNER_REF_RE);\n if (!ref) {\n ctx.issues.push({\n path,\n message: `malformed reference '\\${{ ${inner} }}' — expected '\\${{ namespace.name }}' (escape a literal with '$\\${{')`,\n });\n } else if (DEFERRED_NAMESPACES.has(ref[1])) {\n out += m[0]; // deferred namespace → re-emit the token verbatim (resolved later)\n } else {\n const v = resolveRef(ref[1], ref[2], ctx, path);\n if (v !== undefined) out += String(v);\n }\n }\n last = TOKEN_SCAN_RE.lastIndex;\n }\n out += str.slice(last);\n return out;\n}\n\n/** Recursively substitute tokens through the document tree (values only, not keys). */\nfunction substituteValue(val: unknown, ctx: ResolveCtx, path: string): unknown {\n if (typeof val === 'string') {\n const whole = val.match(WHOLE_TOKEN_RE);\n if (whole) {\n // A deferred namespace (e.g. self.*) is left literal for a later pass.\n if (DEFERRED_NAMESPACES.has(whole[1])) return val;\n // Exactly one token → return the TYPED value (so a boolean input stays a\n // boolean, not the string \"true\"). undefined (on error) collapses to the\n // raw string so the doc stays parseable for downstream issue reporting.\n const v = resolveRef(whole[1], whole[2], ctx, path);\n return v === undefined ? val : v;\n }\n return interpolate(val, ctx, path);\n }\n if (Array.isArray(val)) {\n return val.map((v, i) => substituteValue(v, ctx, `${path}[${i}]`));\n }\n if (val !== null && typeof val === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(val as Record<string, unknown>)) {\n out[k] = substituteValue(v, ctx, path ? `${path}.${k}` : k);\n }\n return out;\n }\n return val;\n}\n\n/** Coerce a supplied value (string from `--set`, typed from a `--values` file) to the declared type. */\nfunction coerce(raw: unknown, type: InputDecl['type'], name: string, issues: BlueprintIssue[]): InputScalar | undefined {\n const path = `inputs.${name}`;\n if (type === 'string') {\n if (typeof raw === 'string') return raw;\n if (typeof raw === 'number' || typeof raw === 'boolean') return String(raw);\n issues.push({ path, message: `expected a string value` });\n return undefined;\n }\n if (type === 'number') {\n if (typeof raw === 'number') return raw;\n if (typeof raw === 'string') {\n const n = Number(raw.trim());\n if (raw.trim() === '' || Number.isNaN(n)) {\n issues.push({ path, message: `expected a number, got '${raw}'` });\n return undefined;\n }\n return n;\n }\n issues.push({ path, message: `expected a number` });\n return undefined;\n }\n // boolean\n if (typeof raw === 'boolean') return raw;\n if (typeof raw === 'string') {\n const t = raw.trim().toLowerCase();\n if (t === 'true') return true;\n if (t === 'false') return false;\n issues.push({ path, message: `expected a boolean ('true'|'false'), got '${raw}'` });\n return undefined;\n }\n issues.push({ path, message: `expected a boolean` });\n return undefined;\n}\n\n/** Build the resolved-values map from declarations + supplied values (precedence handled by the caller). */\nfunction resolveValues(\n declared: InputsDecl,\n supplied: Record<string, unknown>,\n issues: BlueprintIssue[],\n): Record<string, InputScalar> {\n const values: Record<string, InputScalar> = {};\n\n // Reject supplied values that aren't declared (typo / stale --set).\n for (const k of Object.keys(supplied)) {\n if (!(k in declared)) {\n issues.push({ path: `inputs.${k}`, message: `no input named '${k}' is declared (cannot set it)` });\n }\n }\n\n for (const [name, decl] of Object.entries(declared)) {\n if (name in supplied) {\n const c = coerce(supplied[name], decl.type, name, issues);\n if (c !== undefined) values[name] = c;\n } else if (decl.default !== undefined) {\n values[name] = decl.default;\n } else if (decl.required) {\n issues.push({\n path: `inputs.${name}`,\n message: `required input '${name}' was not supplied (--set ${name}=… or in --values)`,\n });\n }\n // else: optional with no default → no value; a reference to it errors at use.\n }\n return values;\n}\n\n/**\n * Resolve a blueprint's `inputs:` variables against supplied install-time\n * values and return the substituted document tree WITH the `inputs:` block\n * stripped — ready for {@link parseBlueprint}. Throws {@link BlueprintInputError}\n * (with structured `.issues`) on any declaration / value / reference problem.\n *\n * `supplied` is the merged value map (the CLI applies `--set` > `--values` >\n * declared `default` precedence before calling this; declared defaults are\n * applied here). A blueprint with no `inputs:` block and no `${{ … }}` tokens\n * passes through unchanged (back-compat) — but a stray `${{ … }}` or an unknown\n * reference is still reported (never silently empty).\n *\n * Built-ins are derived from the document's LITERAL `contextId` (it cannot\n * itself use `${{ … }}` — it is the source of `vectros.*`).\n */\nexport function resolveBlueprintInputs(raw: unknown, supplied: Record<string, unknown> = {}): unknown {\n // Not an object → not a blueprint shape; let parseBlueprint produce the\n // structural error. (Supplying values here would be meaningless.)\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return raw;\n\n const issues: BlueprintIssue[] = [];\n const { inputs: rawInputs, ...body } = raw as Record<string, unknown> & { inputs?: unknown };\n\n // 1. Validate the inputs declaration block (if present).\n let declared: InputsDecl = {};\n if (rawInputs !== undefined) {\n const parsed = InputsDeclSchema.safeParse(rawInputs);\n if (!parsed.success) {\n for (const i of parsed.error.issues) {\n const p = i.path.length ? `inputs.${i.path.join('.')}` : 'inputs';\n issues.push({ path: p, message: i.message });\n }\n } else {\n declared = parsed.data;\n for (const [name, decl] of Object.entries(declared)) {\n if (!INPUT_NAME_RE.test(name)) {\n issues.push({\n path: `inputs.${name}`,\n message: `invalid input name '${name}' — letters/digits/underscore, not starting with a digit`,\n });\n }\n if (decl.default !== undefined && scalarType(decl.default) !== decl.type) {\n issues.push({\n path: `inputs.${name}.default`,\n message: `default is a ${scalarType(decl.default)} but the declared type is '${decl.type}'`,\n });\n }\n }\n }\n }\n\n // 2. Derive built-ins from the LITERAL contextId.\n let builtins: { context: string; suffix: string } | undefined;\n const ctxId = (body as Record<string, unknown>).contextId;\n if (typeof ctxId === 'string' && ctxId.length > 0) {\n if (ctxId.includes('${{')) {\n issues.push({\n path: 'contextId',\n message: `contextId must be a literal — it cannot use '\\${{ … }}' (it is the source of vectros.* built-ins)`,\n });\n } else {\n builtins = { context: ctxId, suffix: deriveSuffix(ctxId) };\n }\n }\n // contextId missing / non-string → builtins stay undefined; parseBlueprint\n // separately reports the missing/invalid contextId.\n\n // 3. Resolve values, then substitute through the body.\n const values = resolveValues(declared, supplied, issues);\n const ctx: ResolveCtx = { declared, values, builtins, issues };\n const substituted = substituteValue(body, ctx, '');\n\n if (issues.length) {\n throw new BlueprintInputError(`Blueprint variable resolution failed:\\n${renderIssues(issues)}`, issues);\n }\n return substituted;\n}\n","/**\n * Bundled blueprint: task-management.\n *\n * The canonical first blueprint (design doc Appendix A). Structured task\n * tracking, shareable across sessions, agents, and users. Demonstrates the\n * full contract: a HYBRID-indexed schema, a data-plane-only profile that\n * passes the CLI scope gate, a service principal, and deterministic seed\n * data — all with stable identifiers so a loader re-run is idempotent.\n *\n * Bundled blueprints are TRUSTED (they ship in the reviewed packages), but\n * the CLI's scope gate still applies — `tests/blueprints.test.ts` asserts\n * this blueprint is structurally valid, and the CLI's gate test asserts it\n * stays data-plane-only.\n *\n * It is the \"copy me to start\" exemplar, so it stays a SINGLE schema — but it\n * is a complete one: it shows render hints (so the no-code UI renders a real\n * form), write-time validation, and BOTH lookup shapes — equality (enumerate a\n * project's tasks) and an ordered RANGE index on the due date (list tasks due\n * in a window). The equality-vs-range choice per field is permanent once a\n * schema is live (see the lookupFields note below), so it is made deliberately.\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r] —\n * all data-plane. Note the deliberate ABSENCE of records:d (tasks are\n * marked done, not deleted — least privilege).\n */\nimport type { Blueprint } from '../types.js';\n\nconst taskManagement: Blueprint = {\n name: 'task-management',\n version: '1.0.0',\n description: 'Structured task tracking, shareable across sessions, agents, and users.',\n\n contextId: 'task-management',\n contextName: 'Task Management',\n\n schemas: [\n {\n typeName: 'task',\n displayName: 'Task',\n indexMode: 'HYBRID', // keyword on titles + semantic on descriptions\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, section: 'Task', displayField: true },\n },\n {\n fieldId: 'description',\n fieldType: 'string',\n searchable: true,\n description: 'Free-text detail — the RAG-able body.',\n validation: { maxLength: 8000 },\n renderHints: { label: 'Description', widget: 'textarea', order: 2, section: 'Task' },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['todo', 'in_progress', 'blocked', 'done'],\n renderHints: { label: 'Status', widget: 'select', order: 3, section: 'Tracking' },\n },\n {\n fieldId: 'priority',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['low', 'medium', 'high', 'urgent'],\n // Equality, NOT range: the values are an ordinal vocabulary but they sort\n // LEXICALLY (high < low < medium < urgent), not by severity — a range\n // index here would be permanently wrong. Filter by exact priority instead.\n renderHints: { label: 'Priority', widget: 'select', order: 4, section: 'Tracking' },\n },\n {\n fieldId: 'assignee',\n fieldType: 'string',\n filterable: true,\n description: 'userId or display name.',\n renderHints: { label: 'Assignee', widget: 'text', order: 5, section: 'Tracking' },\n },\n {\n fieldId: 'project',\n fieldType: 'string',\n filterable: true,\n description: 'Grouping key for cross-session continuity.',\n renderHints: { label: 'Project', widget: 'text', order: 6, section: 'Tracking' },\n },\n {\n fieldId: 'dueDate',\n fieldType: 'date',\n description: 'ISO-8601. Range-queryable (see lookupFields) — list tasks due in a window.',\n renderHints: { label: 'Due date', widget: 'date', order: 7, section: 'Tracking' },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 8, section: 'Tracking' },\n },\n // externalId is the record's FIRST-CLASS identifier (the dedup/lookup key + the\n // value a `reference` resolves against) — not a payload field; the loader sends\n // it top-level on the RecordRequest.\n ],\n // Two lookup shapes, chosen deliberately because the equality-vs-range choice\n // per field is MIGRATION-LOCKED once the schema is live (you cannot flip a\n // field slot↔range later, even by removing and re-adding it):\n // • `project` — EQUALITY (a grouping key, not ordered): enumerate one\n // project's tasks directly, no search. Each equality lookup uses 1 of the\n // schema's 7 fast index slots.\n // • `dueDate` — RANGE: ordered `from`/`to`/`prefix` queries (\"tasks due this\n // week\", \"due in 2026-06\"). Range lookups use a relationship row, not a\n // slot, and are billed at the range rate. ISO-8601 sorts chronologically,\n // so the order is correct.\n // `externalId` has a built-in first-class finder and must NOT be redeclared here.\n lookupFields: ['project', { fieldName: 'dueDate', rangeEnabled: true }],\n },\n ],\n\n // Least-privilege profile — MUST pass the CLI scope gate.\n // r/c/u + search + schema discovery. NOT records:d (least privilege).\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r'],\n // dataScope omitted → tenant-level shared tracker. Bind to an orgId\n // for per-org isolation.\n },\n\n servicePrincipal: {\n externalId: 'task-management',\n displayName: 'Task Management',\n },\n\n seed: [\n {\n typeName: 'task',\n externalId: 'seed-welcome',\n fields: {\n title: 'Welcome to your Vectros task tracker',\n description: 'Created by the bootstrap loader. Ask your agent to add tasks.',\n status: 'todo',\n priority: 'low',\n project: 'getting-started',\n dueDate: '2026-06-30',\n },\n },\n ],\n};\n\nexport default taskManagement;\n","/**\n * Bundled blueprint: coding-agent-memory.\n *\n * Persistent, governed project memory for a coding agent (Claude Desktop,\n * Cursor, Cline…). The agent records the decisions, conventions, and gotchas\n * it learns about a codebase so they survive across sessions — instead of\n * re-asking and re-breaking the same things every cold start.\n *\n * Demonstrates the agent-memory FACTS/ENTITIES + EPISODIC flavors on the\n * Vectros substrate: schema'd records (typed facts), exact lookup (idempotent\n * upsert by a caller-stable key), HYBRID search + grounded `rag_ask` (recall by\n * meaning — \"why did we decide X?\"), version history (how a decision evolved),\n * RANGE lookups on the \"when\" of each memory (\"decisions from this quarter\"),\n * and a typed REFERENCE link between record types (a convention cites the\n * decision that established it — a small knowledge graph). It is pure no-code: a\n * `vectros bootstrap` provisions the schemas + a narrow `ssk_*`, and the agent\n * drives it through the MCP server's data-plane tools.\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r, inference:r].\n * Note the deliberate ABSENCE of records:d: decisions are SUPERSEDED (status\n * flips to `superseded`), never deleted, so the audit trail of how the project's\n * thinking changed stays intact (least privilege). `inference:r` powers the\n * grounded \"why did we do X?\" recall (`rag_ask`) over the captured rationale.\n */\nimport type { Blueprint } from '../types.js';\n\nconst codingAgentMemory: Blueprint = {\n name: 'coding-agent-memory',\n version: '1.0.0',\n description:\n 'Persistent project memory for a coding agent — decisions, conventions, and gotchas that survive across sessions.',\n\n contextId: 'coding-memory',\n contextName: 'Coding Agent — Project Memory',\n\n schemas: [\n {\n // A durable architectural/product decision: what was decided, and WHY.\n // The rationale is the high-value, RAG-able body — \"why did we do X?\"\n // is the question a cold-context agent most needs answered.\n typeName: 'decision',\n displayName: 'Decision',\n indexMode: 'HYBRID', // keyword on titles + semantic on statement/rationale\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, displayField: true },\n },\n {\n fieldId: 'statement',\n fieldType: 'string',\n searchable: true,\n description: 'What was decided, in one or two sentences.',\n renderHints: { label: 'Statement', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'rationale',\n fieldType: 'string',\n searchable: true,\n description: 'Why — the trade-offs and the context. The most-recalled field.',\n renderHints: { label: 'Rationale', widget: 'textarea', order: 3 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['proposed', 'active', 'superseded'],\n renderHints: { label: 'Status', widget: 'select', order: 4 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n description: 'Subsystem / module the decision applies to (e.g. \"auth\", \"search\").',\n renderHints: { label: 'Area', widget: 'text', order: 5 },\n },\n {\n fieldId: 'decidedOn',\n fieldType: 'date',\n description: 'ISO-8601 date. Range-queryable — \"decisions made this quarter\".',\n renderHints: { label: 'Decided on', widget: 'date', order: 6 },\n },\n // externalId is the record's FIRST-CLASS identifier (the dedup/upsert key + the\n // value a `reference` resolves against) — it is NOT a payload field, so it is not\n // declared here; the loader sends it top-level on the RecordRequest.\n ],\n // `externalId` is a first-class identifier with its own finder (exact\n // get/upsert) — look it up directly, never redeclare it as a schema lookup.\n // The choice below is MIGRATION-LOCKED once the schema is live:\n // • `area`/`status` — EQUALITY (categorical): \"list active decisions\",\n // \"all decisions in the auth area\". 2 of the 7 fast index slots.\n // • `decidedOn` — RANGE: ordered `from`/`to`/`prefix` over the date.\n lookupFields: ['area', 'status', { fieldName: 'decidedOn', rangeEnabled: true }],\n },\n {\n // A coding convention the team follows — the agent reads these before it\n // writes code so it matches the surrounding style instead of inventing one.\n typeName: 'convention',\n displayName: 'Convention',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'name',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Name', widget: 'text', order: 1, displayField: true },\n },\n {\n fieldId: 'rule',\n fieldType: 'string',\n searchable: true,\n description: 'The convention itself, stated as an imperative.',\n renderHints: { label: 'Rule', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 3 },\n },\n {\n // Parallels `decision.status` so a convention can be RETIRED rather than\n // deleted (the blueprint omits records:d — memory is superseded, not lost).\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'retired'],\n renderHints: { label: 'Status', widget: 'select', order: 4 },\n },\n {\n // A typed REFERENCE to the decision that established this convention — a\n // foreign-key link between record types (the knowledge-graph edge). The\n // platform requires both the target type AND its surface; the value is the\n // target decision's externalId (the default `targetField`). Provenance:\n // \"why does this convention exist? → open the decision behind it.\" Not\n // searchable (a foreign-key id is search noise); declared as an equality\n // lookup below so you can also enumerate \"conventions from decision X\".\n fieldId: 'establishedByDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'record',\n targetField: 'externalId',\n cardinality: 'one',\n renderHints: { label: 'Established by (decision)', order: 5 },\n },\n {\n fieldId: 'adoptedOn',\n fieldType: 'date',\n description: 'ISO-8601 — when this convention was adopted. Range-queryable.',\n renderHints: { label: 'Adopted on', widget: 'date', order: 6 },\n },\n // externalId: first-class identifier, not a payload field (see `decision`).\n ],\n // externalId has its own first-class finder for exact get — look it up\n // directly, not as a schema lookup. Locked equality-vs-range choices:\n // • `area`/`status` — EQUALITY: \"active conventions for auth\".\n // • `establishedByDecision` — EQUALITY on the reference value: enumerate\n // \"conventions established by decision X\" (a forward link query; the\n // platform has no reverse-reference index on this surface).\n // • `adoptedOn` — RANGE over the adoption date.\n // 3 equality lookups (of 7 fast slots) + 1 range row.\n lookupFields: ['area', 'status', 'establishedByDecision', { fieldName: 'adoptedOn', rangeEnabled: true }],\n },\n {\n // A gotcha / sharp edge: a symptom, its cause, and the fix. Saves the\n // agent (and the human) from re-discovering the same trap.\n typeName: 'gotcha',\n displayName: 'Gotcha',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'symptom',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 500 },\n renderHints: { label: 'Symptom', widget: 'textarea', order: 1, displayField: true },\n },\n {\n fieldId: 'cause',\n fieldType: 'string',\n searchable: true,\n renderHints: { label: 'Cause', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'fix',\n fieldType: 'string',\n searchable: true,\n renderHints: { label: 'Fix', widget: 'textarea', order: 3 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 4 },\n },\n {\n // A gotcha can be RETIRED once the underlying trap is fixed for good —\n // superseded, not deleted (the blueprint omits records:d).\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'retired'],\n renderHints: { label: 'Status', widget: 'select', order: 5 },\n },\n {\n fieldId: 'discoveredOn',\n fieldType: 'date',\n description: 'ISO-8601 — when this gotcha was first hit. Range-queryable.',\n renderHints: { label: 'Discovered on', widget: 'date', order: 6 },\n },\n // externalId: first-class identifier, not a payload field (see `decision`).\n ],\n // externalId has its own first-class finder for exact get — look it up\n // directly, not as a schema lookup. `area`/`status` EQUALITY (\"active\n // gotchas in search\"); `discoveredOn` RANGE over the discovery date.\n lookupFields: ['area', 'status', { fieldName: 'discoveredOn', rangeEnabled: true }],\n },\n ],\n\n // Least-privilege profile — MUST pass the CLI scope gate.\n // r/c/u + search + schema discovery + inference:r (grounded \"why did we do X?\"\n // recall over the captured rationale). NOT records:d: memory is superseded,\n // not deleted, so the project's decision history stays auditable.\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r', 'inference:r'],\n },\n\n servicePrincipal: {\n externalId: 'coding-agent-memory',\n displayName: 'Coding Agent — Project Memory',\n },\n\n seed: [\n {\n // Seeded FIRST so the convention below resolves its reference to it — the\n // loader creates seeds in array order, and a reference target must exist when\n // the referencing record is written.\n typeName: 'decision',\n externalId: 'seed-use-vectros-for-memory',\n fields: {\n title: 'Use Vectros as the coding agent’s project memory',\n statement:\n 'Persist decisions, conventions, and gotchas as Vectros records so they survive across agent sessions.',\n rationale:\n 'A coding agent loses context every cold start. A governed, searchable memory lets it recall prior decisions by meaning instead of re-asking — and the version history shows how the thinking evolved.',\n status: 'active',\n area: 'getting-started',\n decidedOn: '2026-06-14',\n },\n },\n {\n // Demonstrates a live typed link at bootstrap: this convention references the\n // decision above by its externalId, so \"open the decision behind this rule\"\n // works the moment the blueprint is applied.\n typeName: 'convention',\n externalId: 'seed-record-the-why',\n fields: {\n name: 'Record the why, not just the what',\n rule: 'When you record a decision or convention, always capture the rationale — the trade-offs a future session cannot re-derive from the code.',\n area: 'getting-started',\n status: 'active',\n establishedByDecision: 'seed-use-vectros-for-memory',\n adoptedOn: '2026-06-14',\n },\n },\n ],\n};\n\nexport default codingAgentMemory;\n","/**\n * Bundled blueprint: second-brain.\n *\n * A personal knowledge base — capture every note, idea, and link, then just\n * ask it. The most universally legible AI-data use case there is, and the\n * canonical exemplar of the agent-memory LONG-TERM / SEMANTIC-RECALL flavor:\n * one `note` schema, HYBRID-indexed, recalled by meaning rather than exact\n * keywords.\n *\n * Pure no-code: `vectros bootstrap` provisions the schema + a narrow `ssk_*`,\n * and you drive it through the MCP server (\"capture this thought\", \"what did I\n * note about X?\") or the generic data-plane app. Notes are archived via a\n * status flip, not deleted — so the profile omits records:d (least privilege).\n *\n * Beyond semantic recall it shows the DIRECT-access patterns an agent reaches\n * for between searches: enumerate notes by `source` (most-recent first), and a\n * `capturedAt` RANGE index for \"what did I capture last week?\". The\n * equality-vs-range choice per lookup field is permanent (see lookupFields).\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r, inference:r].\n */\nimport type { Blueprint } from '../types.js';\n\nconst secondBrain: Blueprint = {\n name: 'second-brain',\n version: '1.0.0',\n description: 'A personal knowledge base — capture notes, ideas, and links, then ask them anything.',\n\n contextId: 'second-brain',\n contextName: 'Second Brain',\n\n schemas: [\n {\n typeName: 'note',\n displayName: 'Note',\n indexMode: 'HYBRID', // keyword on title + semantic on body — recall by meaning\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, section: 'Note', displayField: true },\n },\n {\n fieldId: 'body',\n fieldType: 'string',\n searchable: true,\n description: 'The note itself — the RAG-able body you ask questions against.',\n validation: { maxLength: 20000 },\n renderHints: { label: 'Body', widget: 'textarea', order: 2, section: 'Note' },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n description: 'Freeform string labels for filtering (e.g. \"idea\", \"reading\", \"work\").',\n renderHints: { label: 'Tags', order: 3, section: 'Organize' },\n },\n {\n // An enum (not freeform) so enumeration-by-source is reliable — a\n // `record_query` lookup on `source` only works if values are consistent.\n // `other` keeps it from being a straitjacket for a personal brain-dump.\n fieldId: 'source',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['thought', 'web', 'meeting', 'book', 'article', 'other'],\n description: 'Where it came from.',\n renderHints: { label: 'Source', widget: 'select', order: 4, section: 'Organize' },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'archived'],\n description: 'Archive instead of delete, so nothing is ever lost.',\n renderHints: { label: 'Status', widget: 'select', order: 5, section: 'Organize' },\n },\n {\n fieldId: 'capturedAt',\n fieldType: 'date',\n description: 'ISO-8601 capture date. Range-queryable — \"notes from last week\".',\n renderHints: { label: 'Captured', widget: 'date', order: 6, section: 'Organize' },\n },\n // externalId is the record's FIRST-CLASS identifier (the dedup/upsert key + the\n // value a `reference` resolves against) — not a payload field; the loader sends\n // it top-level on the RecordRequest.\n ],\n // Lookup shapes are MIGRATION-LOCKED once the schema is live (a field cannot\n // flip equality↔range later), so each is chosen on purpose:\n // • `source` — EQUALITY, sorted by `lastUpdated`: enumerate notes from one\n // source, most-recently-touched first. `lastUpdated` is always present, so\n // the sort never drops a note (sorting an equality lookup by an OPTIONAL\n // field would silently exclude rows that lack it).\n // • `status` — EQUALITY: \"show archived notes\".\n // • `capturedAt` — RANGE: ordered `from`/`to`/`prefix` (\"captured in 2026-06\").\n // `externalId` has a built-in first-class finder — look it up directly, never\n // redeclare it here. Equality lookups use the 7 fast index slots (2 used here);\n // range lookups use a relationship row, billed at the range rate.\n lookupFields: [\n { fieldName: 'source', sortBy: 'lastUpdated' },\n 'status',\n { fieldName: 'capturedAt', rangeEnabled: true },\n ],\n },\n ],\n\n // Least-privilege profile — r/c/u + search + schema discovery + inference:r\n // (so the agent can `rag_ask` a grounded, cited question over your notes). No\n // records:d: notes are archived (status → 'archived'), never deleted.\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r', 'inference:r'],\n },\n\n servicePrincipal: {\n externalId: 'second-brain',\n displayName: 'Second Brain',\n },\n\n seed: [\n {\n typeName: 'note',\n externalId: 'seed-welcome',\n fields: {\n title: 'Welcome to your Second Brain',\n body: 'Capture anything here — ideas, links, meeting notes — then ask your agent things like \"what did I note about onboarding?\" and it recalls by meaning, not just keywords.',\n tags: ['getting-started'],\n source: 'thought',\n status: 'active',\n capturedAt: '2026-06-14',\n },\n },\n ],\n};\n\nexport default secondBrain;\n","/**\n * Bundled blueprint: clinical-intake.\n *\n * A behavioral-health intake record — the healthcare-lead exemplar. It exists\n * to make Vectros's compliance posture VISIBLE in a no-code demo: fields marked\n * `sensitive` (PHI) are, by the platform, redacted from audit history AT WRITE\n * TIME (destroyed, not masked — unrecoverable regardless of scope), excluded\n * from the search index, blind-indexed for exact lookup, and masked in\n * responses unless the token carries the `s` reveal scope.\n *\n * The \"aha\" walkthrough: bootstrap → create an intake with a `sensitive` SSN\n * and clinical note → open the record's version history (in app.vectros.ai or\n * via the MCP server) and see the sensitive fields show `[redacted]` in EVERY\n * historical row → search for a phrase from the note and get zero hits → AND\n * STILL find the record by exact client name via the blind-index lookup\n * (the value is HMAC'd into the index, never stored in the clear). The\n * compliance story you can run in 60 seconds, on synthetic data only.\n *\n * `capabilities.auditHistory: true` is explicit (it is the platform default,\n * but a compliance exemplar should self-document its audit posture).\n *\n * PHI HYGIENE: the seed and every example use SYNTHETIC data only. Never enter\n * real PHI into a demo tenant.\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r].\n * Deliberately NO records:d (intake records are retained, not deleted) and NO\n * `s` reveal scope — so the bootstrapped key itself cannot un-redact sensitive\n * fields, which is the point of the demo. No `inference:r` either: a PHI corpus\n * is the one place we do NOT hand the demo key a RAG capability.\n */\nimport type { Blueprint } from '../types.js';\n\nconst clinicalIntake: Blueprint = {\n name: 'clinical-intake',\n version: '1.0.0',\n description:\n 'Behavioral-health intake with PHI fields — demonstrates redact-at-write, audit history, blind-index lookup, and search exclusion. Synthetic data only.',\n\n contextId: 'clinical-intake',\n contextName: 'Clinical Intake',\n\n schemas: [\n {\n typeName: 'intake',\n displayName: 'Intake',\n indexMode: 'HYBRID',\n capabilities: { auditHistory: true }, // self-documenting compliance posture\n fields: [\n // --- Non-sensitive, searchable/filterable working fields ---\n {\n fieldId: 'caseId',\n fieldType: 'string',\n required: true,\n description: 'Caller-stable intake id; the dedup/lookup key.',\n validation: { minLength: 1, maxLength: 64 },\n renderHints: { label: 'Case ID', widget: 'text', order: 1, section: 'Intake', displayField: true },\n },\n {\n fieldId: 'presentingConcern',\n fieldType: 'string',\n searchable: true,\n description: 'Non-PHI summary of the presenting concern — safe to index + search.',\n validation: { maxLength: 2000 },\n renderHints: { label: 'Presenting concern', widget: 'textarea', order: 2, section: 'Intake' },\n },\n {\n fieldId: 'program',\n fieldType: 'string',\n filterable: true,\n description: 'Program / service line the intake is routed to.',\n renderHints: { label: 'Program', widget: 'text', order: 3, section: 'Intake' },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['new', 'in_review', 'scheduled', 'closed'],\n renderHints: { label: 'Status', widget: 'select', order: 4, section: 'Intake' },\n },\n {\n fieldId: 'submittedAt',\n fieldType: 'date',\n description: 'ISO-8601. Range-queryable — a coordinator can pull \"intakes submitted this week\".',\n renderHints: { label: 'Submitted', widget: 'date', order: 5, section: 'Intake' },\n },\n\n // --- Sensitive (PHI) fields: redacted-at-write, search-excluded, masked-on-read ---\n {\n fieldId: 'clientName',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI. Blind-indexed for EXACT lookup (a lookup field below); never in the search index or audit log.',\n renderHints: { label: 'Client name', widget: 'text', order: 10, section: 'Client (PHI)' },\n },\n {\n fieldId: 'dateOfBirth',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI. ISO-8601. Redacted from audit history at write time.',\n renderHints: { label: 'Date of birth', widget: 'date', order: 11, section: 'Client (PHI)' },\n },\n {\n fieldId: 'ssn',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI. Destroyed before the audit snapshot is written — unrecoverable.',\n validation: { pattern: '^\\\\d{3}-\\\\d{2}-\\\\d{4}$' },\n renderHints: { label: 'SSN', widget: 'text', order: 12, section: 'Client (PHI)' },\n },\n {\n fieldId: 'clinicalNote',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI free-text. Excluded from search so a note phrase never leaks via results.',\n renderHints: { label: 'Clinical note', widget: 'textarea', order: 13, section: 'Client (PHI)' },\n },\n ],\n // Lookup fields back access patterns without a search. The equality-vs-range\n // (and sensitive-blind-index) choice per field is MIGRATION-LOCKED once the\n // schema is live — chosen deliberately:\n // • `caseId` (unique) — EQUALITY: exact get by the stable intake id.\n // • `program`/`status` — EQUALITY (categorical): a coordinator ENUMERATES a\n // worklist (\"all outpatient-counseling intakes\", \"all new intakes\").\n // • `clientName` — a SENSITIVE equality lookup: the value is HMAC'd into a\n // per-tenant BLIND INDEX, so \"find the intake for this exact client name\"\n // works WITHOUT the name ever being stored in the clear or entering search.\n // A sensitive lookup is equality-only — a blind hash is not orderable, so\n // it can never be range-enabled.\n // • `submittedAt` — RANGE: ordered `from`/`to`/`prefix` for a date worklist.\n // 4 equality lookups (of 7 fast slots) + 1 range row. The OTHER PHI fields\n // (dateOfBirth/ssn/clinicalNote) are deliberately NOT lookups here.\n lookupFields: [\n { fieldName: 'caseId', unique: true },\n 'program',\n 'status',\n 'clientName',\n { fieldName: 'submittedAt', rangeEnabled: true },\n ],\n },\n ],\n\n // Least-privilege, data-plane only. No records:d (retain intakes), NO `s`\n // reveal qualifier (the demo key literally cannot un-redact the PHI fields),\n // and NO inference:r (we never point a RAG capability at a PHI corpus here).\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r'],\n },\n\n servicePrincipal: {\n externalId: 'clinical-intake',\n displayName: 'Clinical Intake',\n },\n\n seed: [\n {\n typeName: 'intake',\n externalId: 'seed-synthetic-intake',\n fields: {\n caseId: 'seed-synthetic-intake',\n presentingConcern: 'Sleep difficulty and low mood over the past month; seeking counseling.',\n program: 'outpatient-counseling',\n status: 'new',\n submittedAt: '2026-06-14',\n // SYNTHETIC PHI — illustrative only, not a real person.\n clientName: 'Jordan Sample',\n dateOfBirth: '1990-01-01',\n ssn: '000-00-0000',\n clinicalNote:\n 'Synthetic note for demonstration. Reports difficulty sleeping; no acute safety concerns noted.',\n },\n },\n ],\n};\n\nexport default clinicalIntake;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBA,iBAAkB;AAIlB,IAAM,gBAAgB;AAOtB,IAAM,wBAAwB,aAC3B,OAAO;AAAA,EACN,UAAU,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC/B,WAAW,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACrC,WAAW,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACrC,KAAK,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC/B,KAAK,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC/B,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,OAAO,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC5B,KAAK,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC1B,OAAO,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC5B,MAAM,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAChC,YAAY,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACtC,UAAU,aAAE,OAAO,EAAE,IAAI,EAAE,S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M,EAAE,SAAS,IAAI;AACvD;","names":["import_zod","renderIssues"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/types.ts","../src/identities.ts","../src/inputs.ts","../src/blueprints/task-management.ts","../src/blueprints/coding-agent-memory.ts","../src/blueprints/agentic-sdlc.ts","../src/blueprints/second-brain.ts","../src/blueprints/clinical-intake.ts"],"sourcesContent":["/**\n * @vectros-ai/blueprints — the Blueprint format + the curated bundled\n * library. Data + structural validation only; the scope gate (enforcement)\n * lives in @vectros-ai/cli.\n */\nexport {\n BlueprintSchema,\n BlueprintValidationError,\n parseBlueprint,\n parseBlueprintJson,\n contextNameOf,\n type Blueprint,\n type BlueprintFieldDef,\n type BlueprintSchemaDef,\n type BlueprintSeed,\n type BlueprintRecordSeed,\n type BlueprintDocumentSeed,\n type BlueprintSeedRecord,\n type BlueprintValidationRules,\n type BlueprintRenderHints,\n type BlueprintLookupField,\n type BlueprintRoleClause,\n type BlueprintRoles,\n type IdentityDecl,\n type IdentitiesDecl,\n type BlueprintIssue,\n} from './types.js';\n\nexport {\n resolveBlueprintIdentities,\n collectIdentityReferences,\n BlueprintIdentityError,\n type IdentityResolver,\n} from './identities.js';\n\nexport {\n InputsDeclSchema,\n BlueprintInputError,\n resolveBlueprintInputs,\n deriveSuffix,\n type InputDecl,\n type InputsDecl,\n type InputScalar,\n} from './inputs.js';\n\nimport type { Blueprint } from './types.js';\nimport taskManagement from './blueprints/task-management.js';\nimport codingAgentMemory from './blueprints/coding-agent-memory.js';\nimport agenticSdlc from './blueprints/agentic-sdlc.js';\nimport secondBrain from './blueprints/second-brain.js';\nimport clinicalIntake from './blueprints/clinical-intake.js';\n\n/**\n * The curated blueprints bundled with the library, in menu-display order.\n * To add one: drop a `blueprints/<name>.ts` exporting a `Blueprint`\n * default, import it here, and add it to this array.\n */\nexport const BUNDLED_BLUEPRINTS: readonly Blueprint[] = [\n taskManagement,\n codingAgentMemory,\n agenticSdlc,\n secondBrain,\n clinicalIntake,\n];\n\n/** Names available for `--blueprint <name>`. */\nexport const BLUEPRINT_NAMES: readonly string[] = BUNDLED_BLUEPRINTS.map((b) => b.name);\n\n/** Look up a bundled blueprint by name; `undefined` if none matches. */\nexport function getBlueprint(name: string): Blueprint | undefined {\n return BUNDLED_BLUEPRINTS.find((b) => b.name === name);\n}\n","/**\n * Blueprint format + STRUCTURAL validation.\n *\n * A blueprint is a versioned, reviewed bundle: a schema set + a\n * least-privilege AccessProfile + a service principal + optional seed\n * data, all with stable identifiers so a loader re-run converges instead\n * of duplicating.\n *\n * This package owns the FORMAT + structural (zod) validation ONLY. The\n * security boundary — the scope gate that bounds a blueprint's requested\n * `allowedActions` to data-plane-only — lives in the CLI binary\n * (`@vectros-ai/cli`), NOT here: blueprints are untrusted input, and the\n * trust boundary is the binary that mints.\n *\n * The blueprint's stable id is `name` (renamed from the v0.3-internal\n * `pack` field during a later split — no shipped consumers).\n */\nimport { z } from 'zod';\n\n// AppContext contextId rule mirrors the backend (3-31 chars, starts with a\n// lowercase letter, then lowercase letters/digits/dashes).\nconst CONTEXT_ID_RE = /^[a-z][a-z0-9-]{2,30}$/;\n\n// Field-level validation rules — mirrors the platform `ValidationRules`\n// (platform/common-core/.../template/ValidationRules.java). Passed straight\n// through to `SchemaRequest.FieldDef.validation` so the backend enforces them.\n// `.strict()` so an unknown rule key is a clear authoring error, not a silent\n// no-op (the platform tolerates extra keys, but our format should teach).\nconst ValidationRulesSchema = z\n .object({\n required: z.boolean().optional(),\n minLength: z.number().int().optional(),\n maxLength: z.number().int().optional(),\n min: z.number().int().optional(),\n max: z.number().int().optional(),\n pattern: z.string().optional(),\n email: z.boolean().optional(),\n url: z.boolean().optional(),\n phone: z.boolean().optional(),\n step: z.number().int().optional(),\n multipleOf: z.number().int().optional(),\n minItems: z.number().int().optional(),\n maxItems: z.number().int().optional(),\n })\n .strict();\n\n// Per-field render hints — authored field-by-field for readability; the loader\n// pivots them into the schema-level `renderHints` map keyed by fieldId that the\n// platform `SchemaRequest.renderHints` (RenderHintDef) expects.\nconst RenderHintsSchema = z\n .object({\n label: z.string().optional(),\n widget: z.enum(['text', 'textarea', 'select', 'date', 'checkbox']).optional(),\n order: z.number().int().optional(),\n section: z.string().optional(),\n helpText: z.string().optional(),\n // Marks this field as the record's headline (display) field — the linked\n // primary column in the records list + the title on the detail view. At most\n // one per schema (the platform takes the first by order). Format passthrough →\n // SchemaRequest.renderHints[fieldId].displayField.\n displayField: z.boolean().optional(),\n })\n .strict();\n\nconst BlueprintFieldDefSchema = z\n .object({\n fieldId: z.string().min(1),\n fieldType: z.string().min(1),\n required: z.boolean().optional(),\n searchable: z.boolean().optional(),\n filterable: z.boolean().optional(),\n enumValues: z.array(z.string()).optional(),\n description: z.string().optional(),\n // NEW (format passthrough) — the loader stopped dropping these.\n validation: ValidationRulesSchema.optional(),\n renderHints: RenderHintsSchema.optional(),\n // Marks the field as sensitive (PHI/PII): the platform redacts it from\n // logs/audit/errors AT WRITE TIME, blind-indexes it for lookups, EXCLUDES it\n // from the search index, and masks it in responses unless the token carries\n // the `s` reveal scope for this record type (SchemaRequest.FieldDef.sensitive).\n // Format passthrough — the loader forwards it to createSchema. Default false.\n sensitive: z.boolean().optional(),\n // Reference-field surface — a typed foreign-key link to another record. The\n // platform (SchemaRequest.FieldDef) requires BOTH targetTypeName AND\n // targetSurface on a reference field; the blueprint format uses the SAME names\n // as the SDK so they forward 1:1, and the loader provisions a real reference.\n // (Write-time existence enforcement is on by default platform-side; the target\n // must exist when a referencing record is written — order your seed accordingly.)\n targetTypeName: z.string().min(1).optional(),\n // The field on the target record used to resolve the link; defaults (platform\n // side) to the target's externalId/lookup key when omitted. Must name a UNIQUE\n // lookup on the target type.\n targetField: z.string().min(1).optional(),\n // Which surface the target lives on. REQUIRED on a reference field: the same\n // typeName can exist on more than one surface, so this disambiguates which\n // lookup resolves the link (SchemaRequest.FieldDef.targetSurface).\n targetSurface: z.enum(['record', 'document', 'user', 'org', 'client']).optional(),\n cardinality: z.enum(['one', 'many']).optional(),\n })\n .strict()\n .superRefine((field, ctx) => {\n const isReference = field.fieldType === 'reference';\n const hasRefKeys =\n field.targetTypeName !== undefined ||\n field.targetField !== undefined ||\n field.targetSurface !== undefined ||\n field.cardinality !== undefined;\n if (isReference && field.targetTypeName === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['targetTypeName'],\n message: \"a 'reference' field requires 'targetTypeName' (the typeName it points to)\",\n });\n }\n if (isReference && field.targetSurface === undefined) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['targetSurface'],\n message:\n \"a 'reference' field requires 'targetSurface' (which surface the target lives on: record | document | user | org | client)\",\n });\n }\n if (!isReference && hasRefKeys) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['fieldType'],\n message:\n \"targetTypeName/targetField/targetSurface/cardinality are only valid on a field with fieldType: 'reference'\",\n });\n }\n });\n\n// A lookup field is either a bare field name (back-compat) or an object form\n// that can additionally declare a uniqueness constraint, an ordered range/prefix\n// index, an exact-match sort key, or an opt-in past the fast-index budget. The\n// loader normalizes both to the partner-API `LookupDef` shape ([SV5]).\nconst BlueprintLookupFieldSchema = z.union([\n z.string().min(1),\n z\n .object({\n fieldName: z.string().min(1),\n unique: z.boolean().optional(),\n // Opt this field into ordered range + prefix lookups (from/to/prefix) on\n // top of exact match. Billed at the range-index rate; not valid on a\n // sensitive field (a blind index is not orderable). Locked at create.\n rangeEnabled: z.boolean().optional(),\n // Sort key for the exact-match index: 'createdAt' (default), 'lastUpdated',\n // or a declared field on this schema. Locked at create.\n sortBy: z.string().min(1).optional(),\n // Opt a field past the fixed fast-index budget into a higher-cost\n // secondary index. No effect on a field that fits within the budget.\n allowOverflow: z.boolean().optional(),\n })\n .strict(),\n]);\n\n// Schema capabilities — today just `auditHistory` (platform default true). We\n// surface it so a blueprint's audit posture is self-documenting + reviewable.\nconst BlueprintCapabilitiesSchema = z\n .object({\n auditHistory: z.boolean().optional(),\n })\n .strict();\n\nconst BlueprintSchemaSchema = z\n .object({\n typeName: z.string().min(1),\n displayName: z.string().min(1),\n description: z.string().optional(),\n indexMode: z.enum(['HYBRID', 'SEMANTIC', 'TEXT']).optional(),\n fields: z.array(BlueprintFieldDefSchema).default([]),\n lookupFields: z.array(BlueprintLookupFieldSchema).max(10).optional(),\n // Which typed surfaces may bind this schema. REQUIRED + non-empty on\n // the platform `SchemaRequest` (0.23+); the loader defaults it to ['record']\n // when a blueprint omits it (blueprints provision record types + seed records).\n allowedSurfaces: z.array(z.enum(['record', 'document', 'user', 'org', 'client'])).min(1).optional(),\n // NEW (format passthrough) — mirror the platform `SchemaRequest` shape 1:1.\n capabilities: BlueprintCapabilitiesSchema.optional(),\n // Whether the schema is active; inactive schemas reject new record creation.\n active: z.boolean().optional(),\n // Schema-level ownership defaults — flat, matching `SchemaRequest`\n // userId/orgId/clientId. With a scoped token these must be consistent with\n // the profile's dataScope (a cross-consistency lint is deferred to the lint slice).\n userId: z.string().min(1).optional(),\n orgId: z.string().min(1).optional(),\n clientId: z.string().min(1).optional(),\n })\n .strict();\n\nconst BlueprintAccessProfileSchema = z\n .object({\n // Validated structurally here; the SCOPE GATE (in @vectros-ai/cli) is\n // what enforces the data-plane-only security boundary.\n allowedActions: z.array(z.string().min(1)).min(1),\n // Optional ownership binding: { userId: [...], orgId: [...], clientId: [...] }.\n // A `null` element in a value list is the documented NULL SENTINEL — it\n // grants access to TENANT-LEVEL (owner-less) records IN ADDITION to the\n // listed owner ids. `null` is the literal matched value: a tenant-level\n // record has a genuinely-null ownership field, and the platform's scope\n // matcher tests `allowedValues.contains(null)` against the tenant-level\n // null sentinel (+ ScopeClause). e.g. `{ orgId: [\"org_x\", null] }` =\n // \"org_x's records AND tenant-shared records\". Omitting null restricts to\n // the listed owners ONLY (the key will NOT see tenant-level/seed records).\n dataScope: z.record(z.array(z.union([z.string().min(1), z.null()]))).optional(),\n })\n .strict();\n\n// A single role clause — mirrors the platform/SDK ScopeClause (allowedActions +\n// optional per-clause dataScope). Multi-clause roles let one role grant several\n// (action-set, data-scope) rules at once, evaluated per-clause server-side.\n// `${{ self.* }}` placeholders are legal in a clause's dataScope: they are a\n// RUNTIME sentinel the platform resolves per-principal at request time\n// — the install-time resolver leaves them literal (see inputs.ts),\n// and a top-level lint (BlueprintSchema) confines them to here.\nconst BlueprintRoleClauseSchema = z\n .object({\n allowedActions: z.array(z.string().min(1)).min(1),\n dataScope: z.record(z.array(z.union([z.string().min(1), z.null()]))).optional(),\n })\n .strict();\n\n// Optional top-level `roles`: a map of roleId → ordered clauses. Authored in the\n// blueprint and bound to principals via `vectros access grant --role <id>`.\n// DISTINCT from `accessProfile` (the least-privilege scope the bootstrap mints\n// for the blueprint's own service-principal key). Roles are identity-agnostic,\n// reusable, multi-clause rules (architecture §6).\nconst BlueprintRolesSchema = z.record(z.array(BlueprintRoleClauseSchema).min(1));\n\n// A declared identity — a principal the blueprint expects to exist, ensured\n// (idempotently, by externalId) at APPLY time by a creds-bearing pass (the CLI\n// install orchestrator). Referenced elsewhere via `${{ identities.<name> }}`,\n// which the install-time resolver leaves literal and the apply pass substitutes\n// with the resolved principal id. The schema is FORMAT/shape only; resolution\n// (resolveBlueprintIdentities) lives in identities.ts.\nconst IdentityDeclSchema = z\n .object({\n kind: z.enum(['user', 'org', 'client']),\n externalId: z.string().min(1),\n displayName: z.string().min(1).optional(),\n metadata: z.record(z.unknown()).optional(),\n })\n .strict();\n\n// Optional top-level `identities` block — a map of local name → declaration.\n// Exported so the apply-time resolver (identities.ts) validates the block too.\nexport const IdentitiesDeclSchema = z.record(IdentityDeclSchema);\n\nconst BlueprintServicePrincipalSchema = z\n .object({\n externalId: z.string().min(1),\n displayName: z.string().min(1),\n })\n .strict();\n\n// A seed pre-populates the context at bootstrap. It is a DISCRIMINATED union on\n// `surface`, because the two surfaces are genuinely different shapes — not the\n// same object with a couple of optional extras:\n// • a RECORD seed (`surface: 'record'`) carries its data in `fields` (the payload).\n// • a DOCUMENT seed (`surface: 'document'`) is text-ingested: the platform's\n// ingest path REQUIRES a first-class `title` and non-empty `text`, with optional\n// structured `fields` (payload) bound to the schema. `title`/`text` are document\n// attributes DISTINCT from payload — a record schema may itself declare a payload\n// field literally named `title` (the bundled `decision` type does), so they can't\n// be reserved keys inside `fields`.\n// `surface` is REQUIRED on every seed so each entry states its surface explicitly;\n// the discriminator routes the CLI loader to `createRecord` vs `ingestDocument` and\n// gives precise per-variant validation errors.\nconst SeedCommonShape = {\n /** The schema typeName this seed instantiates (should match a declared schema). */\n typeName: z.string().min(1),\n /**\n * Stable, caller-supplied id — the loader's idempotency key AND the value other\n * seeds resolve a `reference` against (across surfaces: a record seed may\n * reference a document seed by its externalId, and vice versa).\n */\n externalId: z.string().min(1),\n} as const;\n\nconst RecordSeedSchema = z\n .object({\n surface: z.literal('record'),\n ...SeedCommonShape,\n /** The record payload, validated against the bound schema. */\n fields: z.record(z.unknown()),\n })\n .strict();\n\nconst DocumentSeedSchema = z\n .object({\n surface: z.literal('document'),\n ...SeedCommonShape,\n /** Human-readable document title — REQUIRED by the text-ingest path. */\n title: z.string().min(1),\n /** Raw text content to ingest + index — REQUIRED and non-empty (the platform rejects a blank ingest). */\n text: z.string().min(1),\n /** Optional structured payload bound to the schema (the document's `fields`). */\n fields: z.record(z.unknown()).optional(),\n })\n .strict();\n\nconst BlueprintSeedRecordSchema = z.discriminatedUnion('surface', [\n RecordSeedSchema,\n DocumentSeedSchema,\n]);\n\n// `${{ self.* }}` is a RUNTIME per-principal placeholder (platform-resolved at\n// request time). It is only meaningful inside a role clause's\n// dataScope; anywhere else in a blueprint it would never resolve. This walk\n// confines it there (teach-by-error), running on the already-input-resolved doc\n// (the install-time resolver leaves self tokens literal — see inputs.ts).\nconst SELF_TOKEN_RE = /\\$\\{\\{\\s*self\\.[A-Za-z_]\\w*\\s*\\}\\}/;\n\nfunction lintSelfTokenPlacement(value: unknown, ctx: z.RefinementCtx): void {\n const walk = (node: unknown, path: (string | number)[], inRoleDataScope: boolean): void => {\n if (typeof node === 'string') {\n if (!inRoleDataScope && SELF_TOKEN_RE.test(node)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path,\n message:\n \"'${{ self.* }}' is a runtime per-principal placeholder — it is only valid inside a roles[].dataScope value\",\n });\n }\n return;\n }\n if (Array.isArray(node)) {\n node.forEach((v, i) => walk(v, [...path, i], inRoleDataScope));\n return;\n }\n if (node && typeof node === 'object') {\n for (const [k, v] of Object.entries(node as Record<string, unknown>)) {\n // path === ['roles', <roleId>, <clauseIndex>] and key 'dataScope' opens\n // the only subtree where self.* is allowed.\n const entering =\n inRoleDataScope || (path.length === 3 && path[0] === 'roles' && k === 'dataScope');\n walk(v, [...path, k], entering);\n }\n }\n };\n walk(value, [], false);\n}\n\n// Every `${{ identities.<name> }}` reference must point at a declared identity in\n// the top-level `identities` block — caught offline (at validate/plan), before\n// the creds-bearing apply pass tries (and fails) to resolve an unknown name.\nconst IDENTITY_REF_RE = /\\$\\{\\{\\s*identities\\.([A-Za-z_]\\w*)\\s*\\}\\}/g;\n\nfunction lintIdentityRefsDeclared(value: unknown, ctx: z.RefinementCtx): void {\n const declared = new Set(\n value && typeof value === 'object' && 'identities' in value && (value as { identities?: unknown }).identities\n ? Object.keys((value as { identities: Record<string, unknown> }).identities)\n : [],\n );\n const walk = (node: unknown, path: (string | number)[]): void => {\n if (typeof node === 'string') {\n for (const m of node.matchAll(IDENTITY_REF_RE)) {\n if (!declared.has(m[1])) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path,\n message: `'\\${{ identities.${m[1]} }}' references an undeclared identity — add '${m[1]}' to the top-level 'identities' block`,\n });\n }\n }\n return;\n }\n if (Array.isArray(node)) {\n node.forEach((v, i) => walk(v, [...path, i]));\n } else if (node && typeof node === 'object') {\n // Don't scan the declarations themselves (their values aren't token refs).\n for (const [k, v] of Object.entries(node as Record<string, unknown>)) {\n if (path.length === 0 && k === 'identities') continue;\n walk(v, [...path, k]);\n }\n }\n };\n walk(value, []);\n}\n\n// A seed's `surface` must be one the bound schema actually allows — e.g. a\n// `surface: 'document'` seed of a record-only type would fail the surface bind at\n// apply time. Caught offline (validate/plan) instead. A seed whose typeName has\n// no declared schema is NOT flagged here: the loader warns + skips it at apply,\n// and a blueprint may legitimately seed a pre-existing (un-redeclared) type.\nfunction lintSeedSurfaces(value: unknown, ctx: z.RefinementCtx): void {\n const bp = value as { schemas?: Array<{ typeName?: string; allowedSurfaces?: string[] }>; seed?: Array<{ typeName?: string; externalId?: string; surface?: string }> };\n if (!Array.isArray(bp.seed)) return;\n const byType = new Map((bp.schemas ?? []).map((s) => [s.typeName, s]));\n bp.seed.forEach((seed, i) => {\n const schema = byType.get(seed.typeName);\n if (!schema) return;\n const allowed = schema.allowedSurfaces ?? ['record'];\n if (!allowed.includes(seed.surface ?? 'record')) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['seed', i, 'surface'],\n message: `seed '${seed.externalId}' uses surface '${seed.surface ?? 'record'}', but schema '${seed.typeName}' allows only [${allowed.join(', ')}]`,\n });\n }\n });\n}\n\nexport const BlueprintSchema = z\n .object({\n /** Stable blueprint id (the `--blueprint <name>` selector + idempotency key). */\n name: z.string().min(1),\n version: z.string().min(1),\n description: z.string().min(1),\n /** The app-context the profile + scoped key bind to (e.g. \"mcp\"). */\n contextId: z.string().regex(CONTEXT_ID_RE, {\n message:\n \"contextId must be 3-31 chars, start with a lowercase letter, then lowercase letters/digits/dashes (e.g. 'mcp')\",\n }),\n /** Human-readable app-context name; defaults to `MCP — <name>` (see {@link contextNameOf}) when absent. */\n contextName: z.string().min(1).optional(),\n schemas: z.array(BlueprintSchemaSchema).default([]),\n accessProfile: BlueprintAccessProfileSchema,\n servicePrincipal: BlueprintServicePrincipalSchema,\n seed: z.array(BlueprintSeedRecordSchema).optional(),\n /** Optional multi-clause roles, bound to principals via `access grant --role`. */\n roles: BlueprintRolesSchema.optional(),\n /** Optional principals ensured-exist at apply; referenced via ${{ identities.* }}. */\n identities: IdentitiesDeclSchema.optional(),\n })\n .strict()\n .superRefine((bp, ctx) => {\n lintSelfTokenPlacement(bp, ctx);\n lintIdentityRefsDeclared(bp, ctx);\n lintSeedSurfaces(bp, ctx);\n });\n\nexport type Blueprint = z.infer<typeof BlueprintSchema>;\nexport type BlueprintFieldDef = z.infer<typeof BlueprintFieldDefSchema>;\nexport type BlueprintSchemaDef = z.infer<typeof BlueprintSchemaSchema>;\n/** A single seed entry — a record seed OR a document seed (discriminated on `surface`). */\nexport type BlueprintSeed = z.infer<typeof BlueprintSeedRecordSchema>;\n/** The record-surface seed variant (`surface: 'record'`; the default). */\nexport type BlueprintRecordSeed = z.infer<typeof RecordSeedSchema>;\n/** The document-surface seed variant (`surface: 'document'`; carries `title` + `text`). */\nexport type BlueprintDocumentSeed = z.infer<typeof DocumentSeedSchema>;\n/** @deprecated The element type of `seed[]`, now a union — use {@link BlueprintSeed}. */\nexport type BlueprintSeedRecord = BlueprintSeed;\nexport type BlueprintValidationRules = z.infer<typeof ValidationRulesSchema>;\nexport type BlueprintRenderHints = z.infer<typeof RenderHintsSchema>;\nexport type BlueprintLookupField = z.infer<typeof BlueprintLookupFieldSchema>;\nexport type BlueprintRoleClause = z.infer<typeof BlueprintRoleClauseSchema>;\nexport type BlueprintRoles = z.infer<typeof BlueprintRolesSchema>;\nexport type IdentityDecl = z.infer<typeof IdentityDeclSchema>;\nexport type IdentitiesDecl = z.infer<typeof IdentitiesDeclSchema>;\n\n/**\n * A single structural validation problem, flattened to a readable field path +\n * message. Exposed on {@link BlueprintValidationError.issues} so programmatic\n * callers (a future web authoring UI, CI annotations) get structure without\n * re-parsing the rendered message.\n */\nexport interface BlueprintIssue {\n /** Dotted/bracketed path, e.g. `schemas[0].fields[1].fieldType`, or `(root)`. */\n path: string;\n message: string;\n}\n\n/** Render a zod issue path (`['schemas', 0, 'fields', 1]`) → `schemas[0].fields[1]`. */\nfunction formatIssuePath(path: ReadonlyArray<string | number>): string {\n let out = '';\n for (const seg of path) {\n if (typeof seg === 'number') out += `[${seg}]`;\n else out += out.length ? `.${seg}` : seg;\n }\n return out.length ? out : '(root)';\n}\n\n/** Flatten a {@link z.ZodError} into readable, ordered {path, message} entries. */\nfunction toBlueprintIssues(error: z.ZodError): BlueprintIssue[] {\n return error.issues.map((i) => ({ path: formatIssuePath(i.path), message: i.message }));\n}\n\n/** Render issues into the multi-line, teach-by-error message body. */\nfunction renderIssues(issues: BlueprintIssue[]): string {\n return issues.map((i) => ` • ${i.path}: ${i.message}`).join('\\n');\n}\n\nexport class BlueprintValidationError extends Error {\n /**\n * Structured per-field issues. Populated for STRUCTURAL failures (a bad\n * shape); empty for a JSON/YAML *parse* failure (where there's no field path,\n * just a syntax error in {@link Error.message}).\n */\n readonly issues: BlueprintIssue[];\n constructor(message: string, issues: BlueprintIssue[] = []) {\n super(message);\n this.name = 'BlueprintValidationError';\n this.issues = issues;\n }\n}\n\n/**\n * Structurally parse + validate an untrusted blueprint object. Throws\n * {@link BlueprintValidationError} on a malformed shape — with a readable,\n * multi-line `path: message` body and the structured issues on `.issues`. Does\n * NOT run the scope gate — that's the CLI's job (the trust boundary).\n */\nexport function parseBlueprint(input: unknown): Blueprint {\n const result = BlueprintSchema.safeParse(input);\n if (!result.success) {\n const issues = toBlueprintIssues(result.error);\n throw new BlueprintValidationError(`Malformed blueprint:\\n${renderIssues(issues)}`, issues);\n }\n return result.data;\n}\n\n/**\n * Parse a blueprint from a JSON string (e.g. a file an agent assembled or\n * a community blueprint). Throws {@link BlueprintValidationError} on bad\n * JSON or a bad shape.\n */\nexport function parseBlueprintJson(json: string): Blueprint {\n let parsed: unknown;\n try {\n parsed = JSON.parse(json);\n } catch (err) {\n throw new BlueprintValidationError(\n `Blueprint is not valid JSON: ${err instanceof Error ? err.message : String(err)}`,\n );\n }\n return parseBlueprint(parsed);\n}\n\n/** The app-context display name, defaulting to `MCP — <name>` when {@link Blueprint.contextName} is absent. */\nexport function contextNameOf(blueprint: Blueprint): string {\n return blueprint.contextName ?? `MCP — ${blueprint.name}`;\n}\n","/**\n * Identity resolution — the APPLY-time (creds-bearing) half of the blueprint\n * identity feature.\n *\n * A blueprint may declare a top-level `identities:` block (principals it expects\n * to exist) and reference them with `${{ identities.<name> }}` tokens anywhere a\n * principal id is valid (seed-record ownership, schema/profile dataScope, a role\n * clause). Resolution has TWO tiers — DO NOT conflate (mirrors inputs.ts):\n * - install-time (creds-free): {@link resolveBlueprintInputs} resolves\n * `${{ inputs.* }}`/`${{ vectros.* }}` and LEAVES `${{ identities.* }}` literal\n * (it is a deferred namespace).\n * - apply-time (creds): THIS module ensures each declared identity exists\n * (idempotently, by externalId — the injected `resolve` does the API call,\n * wired by the CLI install orchestrator) and substitutes the tokens with\n * the resolved principal ids.\n *\n * This module is the FORMAT half: the resolver is pure given an injected\n * `resolve` (so `plan` can dry-run/echo and tests can assert without creds). The\n * `identities` block shape lives in types.ts so {@link BlueprintSchema} validates\n * it offline (incl. the \"every reference is declared\" lint).\n */\nimport { IdentitiesDeclSchema, type IdentityDecl, type BlueprintIssue } from './types.js';\n\n/** A `${{ identities.<name> }}` reference (global, for scan/replace). */\nconst IDENTITY_TOKEN_RE = /\\$\\{\\{\\s*identities\\.([A-Za-z_]\\w*)\\s*\\}\\}/g;\n\n/** Resolves a declared identity to its concrete principal id (idempotent, by externalId). */\nexport type IdentityResolver = (name: string, decl: IdentityDecl) => Promise<string>;\n\n/** A creds-bearing identity-resolution failure (undeclared ref, bad block, resolver error). */\nexport class BlueprintIdentityError extends Error {\n readonly issues: BlueprintIssue[];\n constructor(message: string, issues: BlueprintIssue[] = []) {\n super(message);\n this.name = 'BlueprintIdentityError';\n this.issues = issues;\n }\n}\n\n/** Every distinct identity name referenced by `${{ identities.<name> }}` in the tree. */\nexport function collectIdentityReferences(value: unknown): string[] {\n const found = new Set<string>();\n const walk = (node: unknown): void => {\n if (typeof node === 'string') {\n for (const m of node.matchAll(IDENTITY_TOKEN_RE)) found.add(m[1]);\n } else if (Array.isArray(node)) {\n node.forEach(walk);\n } else if (node && typeof node === 'object') {\n Object.values(node as Record<string, unknown>).forEach(walk);\n }\n };\n walk(value);\n return [...found];\n}\n\n/** Substitute every `${{ identities.<name> }}` in the tree with `idMap[name]` (values only). */\nfunction substitute(node: unknown, idMap: Record<string, string>): unknown {\n if (typeof node === 'string') {\n return node.replace(IDENTITY_TOKEN_RE, (_full, name: string) => idMap[name]);\n }\n if (Array.isArray(node)) return node.map((v) => substitute(v, idMap));\n if (node && typeof node === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(node as Record<string, unknown>)) out[k] = substitute(v, idMap);\n return out;\n }\n return node;\n}\n\n/**\n * Resolve a blueprint's `identities:` against an injected creds-bearing resolver\n * and return the substituted tree WITH the `identities:` block stripped — ready\n * for {@link parseBlueprint}. Operates on the install-time-resolved tree (where\n * `${{ identities.* }}` tokens are still literal). Throws\n * {@link BlueprintIdentityError} on a malformed block, an undeclared reference,\n * or a resolver failure.\n *\n * EVERY declared identity is resolved (ensure-exist), not only referenced ones,\n * so a blueprint can provision a principal it doesn't token-reference. A token\n * that references an undeclared identity is an error (also caught offline by\n * {@link BlueprintSchema}).\n */\nexport async function resolveBlueprintIdentities(raw: unknown, resolve: IdentityResolver): Promise<unknown> {\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return raw;\n const { identities: rawIdentities, ...body } = raw as Record<string, unknown> & { identities?: unknown };\n\n // No block + no references → nothing to do (back-compat with non-identity blueprints).\n const refs = collectIdentityReferences(body);\n if (rawIdentities === undefined && refs.length === 0) return raw;\n\n const parsed = IdentitiesDeclSchema.safeParse(rawIdentities ?? {});\n if (!parsed.success) {\n throw new BlueprintIdentityError(\n 'Blueprint identities block is invalid',\n parsed.error.issues.map((i) => ({\n path: i.path.length ? `identities.${i.path.join('.')}` : 'identities',\n message: i.message,\n })),\n );\n }\n const declared = parsed.data;\n\n const undeclared = refs.filter((name) => !(name in declared));\n if (undeclared.length) {\n throw new BlueprintIdentityError(\n `Blueprint references undeclared identities: ${undeclared.join(', ')}`,\n undeclared.map((name) => ({\n path: `identities.${name}`,\n message: `'\\${{ identities.${name} }}' is referenced but not declared in the 'identities' block`,\n })),\n );\n }\n\n // Ensure-exist every DECLARED identity (idempotent by externalId) → id map.\n const idMap: Record<string, string> = {};\n for (const [name, decl] of Object.entries(declared)) {\n try {\n const id = await resolve(name, decl);\n if (typeof id !== 'string' || id.length === 0) {\n // Guard a misbehaving resolver — substituting undefined/'' would write the\n // literal \"undefined\"/\"\" into ownership fields silently.\n throw new Error(`resolver returned a non-string id (${JSON.stringify(id)})`);\n }\n idMap[name] = id;\n } catch (err) {\n throw new BlueprintIdentityError(\n `Failed to resolve identity '${name}' (${decl.kind} externalId=${decl.externalId}): ${\n err instanceof Error ? err.message : String(err)\n }`,\n [{ path: `identities.${name}`, message: err instanceof Error ? err.message : String(err) }],\n );\n }\n }\n\n return substitute(body, idMap);\n}\n","/**\n * Blueprint variable substitution — the install-time resolver\n * (spec `blueprint-variable-substitution`).\n *\n * A blueprint can declare a top-level `inputs:` block and reference its values\n * (and a tiny reserved `vectros.*` built-in namespace) with GitHub-Actions-style\n * `${{ inputs.x }}` tokens in any STRING value. This module resolves those\n * tokens against supplied install-time values, BEFORE structural validation —\n * so the typed {@link Blueprint}, the loader, and bootstrap never see `inputs`\n * or an unresolved token. It is the FORMAT half of the feature: pure,\n * dependency-free (no node, no IO); the CLI owns YAML parsing + `--set`/`--values`.\n *\n * Two tiers — DO NOT conflate (spec §1):\n * - install-time substitution (HERE): `${{ inputs.x }}`, `${{ vectros.* }}`,\n * resolved by the trusted loader before any API call.\n * - the runtime sentinel `$self` (agent-memory): a literal value the platform\n * resolves per-principal at use. This resolver MUST leave `$self` and ANY\n * `$`-prefixed value untouched — it only ever matches the `${{ … }}` form.\n *\n * Security (spec §3): pure string replacement, no eval/template engine → no\n * template injection. The scope gate (the CLI trust boundary) runs on the\n * RESOLVED document, so a parameter cannot smuggle a control-plane scope past\n * it. Built-ins are intentionally tiny (`context`, `suffix`) — see the\n * auto-binding invariant in the spec §4: data-record externalIds are bound to\n * `(tenant, context[, identity])` server-side, so they need no namespace; only\n * tenant-wide service-principal externalIds do, which is what `vectros.suffix`\n * is for.\n */\nimport { z } from 'zod';\nimport type { BlueprintIssue } from './types.js';\n\n/** Allowed input names: identifier-like (so they read cleanly inside `${{ inputs.x }}`). */\nconst INPUT_NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n/** Scalar value types an input may declare / resolve to (V1 — no objects/arrays). */\nexport type InputScalar = string | number | boolean;\n\n/** A single declared input (one entry under the top-level `inputs:` block). */\nconst InputDeclSchema = z\n .object({\n type: z.enum(['string', 'number', 'boolean']),\n required: z.boolean().optional(),\n default: z.union([z.string(), z.number(), z.boolean()]).optional(),\n description: z.string().optional(),\n })\n .strict();\n\n/** The top-level `inputs:` declaration block — a map of name → declaration. */\nexport const InputsDeclSchema = z.record(InputDeclSchema);\n\nexport type InputDecl = z.infer<typeof InputDeclSchema>;\nexport type InputsDecl = z.infer<typeof InputsDeclSchema>;\n\n/**\n * A variable-resolution failure (declaration, missing value, unknown reference,\n * malformed token). Carries structured {@link BlueprintIssue}s — same teach-by-error\n * `path: message` shape as {@link BlueprintValidationError}.\n */\nexport class BlueprintInputError extends Error {\n readonly issues: BlueprintIssue[];\n constructor(message: string, issues: BlueprintIssue[] = []) {\n super(message);\n this.name = 'BlueprintInputError';\n this.issues = issues;\n }\n}\n\nfunction renderIssues(issues: BlueprintIssue[]): string {\n return issues.map((i) => ` • ${i.path}: ${i.message}`).join('\\n');\n}\n\nfunction scalarType(v: unknown): 'string' | 'number' | 'boolean' | 'other' {\n if (typeof v === 'string') return 'string';\n if (typeof v === 'number') return 'number';\n if (typeof v === 'boolean') return 'boolean';\n return 'other';\n}\n\n/**\n * A short, STABLE, non-cryptographic token derived from the install context id.\n * FNV-1a (32-bit) → base36. Deterministic: same contextId ⇒ same suffix ⇒\n * idempotent re-installs (matches the seeding-and-idempotency upsert contract).\n * Used ONLY to namespace tenant-wide service-principal externalIds so two\n * installs of one blueprint in the same tenant (different contexts) don't\n * collide. Not security-sensitive.\n */\nexport function deriveSuffix(contextId: string): string {\n let h = 0x811c9dc5;\n for (let i = 0; i < contextId.length; i++) {\n h ^= contextId.charCodeAt(i);\n h = Math.imul(h, 0x01000193);\n }\n return (h >>> 0).toString(36).padStart(7, '0');\n}\n\ninterface ResolveCtx {\n declared: InputsDecl;\n /** Resolved input values, by name (absent = declared but has no value). */\n values: Record<string, InputScalar>;\n /** Built-ins, or undefined when contextId is not a usable literal. */\n builtins?: { context: string; suffix: string };\n issues: BlueprintIssue[];\n}\n\n/** Matches a string that is EXACTLY one `${{ ns.name }}` token (→ type-coerced value). */\nconst WHOLE_TOKEN_RE = /^\\$\\{\\{\\s*([A-Za-z_]\\w*)\\.([A-Za-z_]\\w*)\\s*\\}\\}$/;\n/**\n * General scan, ordered alternation (longest/most-specific first):\n * 1. `$${{` the escape → literal `${{`\n * 2. `${{ … }}` a complete token (inner validated separately)\n * 3. `${{` a DANGLING opener with no close → reported, never silent\n */\nconst TOKEN_SCAN_RE = /\\$\\$\\{\\{|\\$\\{\\{([\\s\\S]*?)\\}\\}|\\$\\{\\{/g;\n/** A valid inner reference body once trimmed: `namespace.name`. */\nconst INNER_REF_RE = /^([A-Za-z_]\\w*)\\.([A-Za-z_]\\w*)$/;\n\n/**\n * Namespaces this INSTALL-TIME resolver deliberately leaves UNRESOLVED — their\n * `${{ ns.x }}` tokens are re-emitted literally so a later pass / the platform\n * resolves them. `self` is the RUNTIME per-principal sentinel (platform-resolved\n * per request; a top-level lint in types.ts confines it to role\n * dataScope). `identities` is the creds-bearing APPLY-time namespace — its tokens\n * resolve to a principal id in a later pass (resolveBlueprintIdentities), so the\n * install-time resolver leaves them literal too. A deferred token is NOT an\n * \"unknown namespace\" error — distinct from `$`-prefixed values, which are never\n * matched by the `${{ … }}` scanner at all.\n */\nconst DEFERRED_NAMESPACES = new Set(['self', 'identities']);\n\n/** Resolve one `ns.name` reference to its value, or push an issue + return undefined. */\nfunction resolveRef(ns: string, name: string, ctx: ResolveCtx, path: string): InputScalar | undefined {\n if (ns === 'inputs') {\n if (!(name in ctx.declared)) {\n ctx.issues.push({\n path,\n message: `unknown input 'inputs.${name}' — declare it in the top-level 'inputs:' block`,\n });\n return undefined;\n }\n if (!(name in ctx.values)) {\n ctx.issues.push({\n path,\n message: `input 'inputs.${name}' has no value — supply it (--set ${name}=… or --values) or give it a default`,\n });\n return undefined;\n }\n return ctx.values[name];\n }\n if (ns === 'vectros') {\n if (name !== 'context' && name !== 'suffix') {\n ctx.issues.push({\n path,\n message: `unknown built-in 'vectros.${name}' (available: vectros.context, vectros.suffix)`,\n });\n return undefined;\n }\n if (!ctx.builtins) {\n ctx.issues.push({\n path,\n message: `'vectros.${name}' is unavailable: contextId must be a literal string to derive built-ins`,\n });\n return undefined;\n }\n return ctx.builtins[name];\n }\n ctx.issues.push({\n path,\n message: `unknown namespace '${ns}' in '\\${{ ${ns}.${name} }}' (available: inputs, vectros)`,\n });\n return undefined;\n}\n\n/** Interpolate every token in a multi-token / embedded string → a STRING result. */\nfunction interpolate(str: string, ctx: ResolveCtx, path: string): string {\n let out = '';\n let last = 0;\n TOKEN_SCAN_RE.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = TOKEN_SCAN_RE.exec(str)) !== null) {\n out += str.slice(last, m.index);\n if (m[0] === '$${{') {\n out += '${{'; // escape → literal\n } else if (m[0] === '${{' && m[1] === undefined) {\n // Dangling opener (alternative 3): no closing `}}`. Report, don't drop.\n ctx.issues.push({\n path,\n message: `unterminated token '\\${{' — expected a closing '}}' (escape a literal with '$\\${{')`,\n });\n } else {\n const inner = (m[1] ?? '').trim();\n const ref = inner.match(INNER_REF_RE);\n if (!ref) {\n ctx.issues.push({\n path,\n message: `malformed reference '\\${{ ${inner} }}' — expected '\\${{ namespace.name }}' (escape a literal with '$\\${{')`,\n });\n } else if (DEFERRED_NAMESPACES.has(ref[1])) {\n out += m[0]; // deferred namespace → re-emit the token verbatim (resolved later)\n } else {\n const v = resolveRef(ref[1], ref[2], ctx, path);\n if (v !== undefined) out += String(v);\n }\n }\n last = TOKEN_SCAN_RE.lastIndex;\n }\n out += str.slice(last);\n return out;\n}\n\n/** Recursively substitute tokens through the document tree (values only, not keys). */\nfunction substituteValue(val: unknown, ctx: ResolveCtx, path: string): unknown {\n if (typeof val === 'string') {\n const whole = val.match(WHOLE_TOKEN_RE);\n if (whole) {\n // A deferred namespace (e.g. self.*) is left literal for a later pass.\n if (DEFERRED_NAMESPACES.has(whole[1])) return val;\n // Exactly one token → return the TYPED value (so a boolean input stays a\n // boolean, not the string \"true\"). undefined (on error) collapses to the\n // raw string so the doc stays parseable for downstream issue reporting.\n const v = resolveRef(whole[1], whole[2], ctx, path);\n return v === undefined ? val : v;\n }\n return interpolate(val, ctx, path);\n }\n if (Array.isArray(val)) {\n return val.map((v, i) => substituteValue(v, ctx, `${path}[${i}]`));\n }\n if (val !== null && typeof val === 'object') {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(val as Record<string, unknown>)) {\n out[k] = substituteValue(v, ctx, path ? `${path}.${k}` : k);\n }\n return out;\n }\n return val;\n}\n\n/** Coerce a supplied value (string from `--set`, typed from a `--values` file) to the declared type. */\nfunction coerce(raw: unknown, type: InputDecl['type'], name: string, issues: BlueprintIssue[]): InputScalar | undefined {\n const path = `inputs.${name}`;\n if (type === 'string') {\n if (typeof raw === 'string') return raw;\n if (typeof raw === 'number' || typeof raw === 'boolean') return String(raw);\n issues.push({ path, message: `expected a string value` });\n return undefined;\n }\n if (type === 'number') {\n if (typeof raw === 'number') return raw;\n if (typeof raw === 'string') {\n const n = Number(raw.trim());\n if (raw.trim() === '' || Number.isNaN(n)) {\n issues.push({ path, message: `expected a number, got '${raw}'` });\n return undefined;\n }\n return n;\n }\n issues.push({ path, message: `expected a number` });\n return undefined;\n }\n // boolean\n if (typeof raw === 'boolean') return raw;\n if (typeof raw === 'string') {\n const t = raw.trim().toLowerCase();\n if (t === 'true') return true;\n if (t === 'false') return false;\n issues.push({ path, message: `expected a boolean ('true'|'false'), got '${raw}'` });\n return undefined;\n }\n issues.push({ path, message: `expected a boolean` });\n return undefined;\n}\n\n/** Build the resolved-values map from declarations + supplied values (precedence handled by the caller). */\nfunction resolveValues(\n declared: InputsDecl,\n supplied: Record<string, unknown>,\n issues: BlueprintIssue[],\n): Record<string, InputScalar> {\n const values: Record<string, InputScalar> = {};\n\n // Reject supplied values that aren't declared (typo / stale --set).\n for (const k of Object.keys(supplied)) {\n if (!(k in declared)) {\n issues.push({ path: `inputs.${k}`, message: `no input named '${k}' is declared (cannot set it)` });\n }\n }\n\n for (const [name, decl] of Object.entries(declared)) {\n if (name in supplied) {\n const c = coerce(supplied[name], decl.type, name, issues);\n if (c !== undefined) values[name] = c;\n } else if (decl.default !== undefined) {\n values[name] = decl.default;\n } else if (decl.required) {\n issues.push({\n path: `inputs.${name}`,\n message: `required input '${name}' was not supplied (--set ${name}=… or in --values)`,\n });\n }\n // else: optional with no default → no value; a reference to it errors at use.\n }\n return values;\n}\n\n/**\n * Resolve a blueprint's `inputs:` variables against supplied install-time\n * values and return the substituted document tree WITH the `inputs:` block\n * stripped — ready for {@link parseBlueprint}. Throws {@link BlueprintInputError}\n * (with structured `.issues`) on any declaration / value / reference problem.\n *\n * `supplied` is the merged value map (the CLI applies `--set` > `--values` >\n * declared `default` precedence before calling this; declared defaults are\n * applied here). A blueprint with no `inputs:` block and no `${{ … }}` tokens\n * passes through unchanged (back-compat) — but a stray `${{ … }}` or an unknown\n * reference is still reported (never silently empty).\n *\n * Built-ins are derived from the document's LITERAL `contextId` (it cannot\n * itself use `${{ … }}` — it is the source of `vectros.*`).\n */\nexport function resolveBlueprintInputs(raw: unknown, supplied: Record<string, unknown> = {}): unknown {\n // Not an object → not a blueprint shape; let parseBlueprint produce the\n // structural error. (Supplying values here would be meaningless.)\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return raw;\n\n const issues: BlueprintIssue[] = [];\n const { inputs: rawInputs, ...body } = raw as Record<string, unknown> & { inputs?: unknown };\n\n // 1. Validate the inputs declaration block (if present).\n let declared: InputsDecl = {};\n if (rawInputs !== undefined) {\n const parsed = InputsDeclSchema.safeParse(rawInputs);\n if (!parsed.success) {\n for (const i of parsed.error.issues) {\n const p = i.path.length ? `inputs.${i.path.join('.')}` : 'inputs';\n issues.push({ path: p, message: i.message });\n }\n } else {\n declared = parsed.data;\n for (const [name, decl] of Object.entries(declared)) {\n if (!INPUT_NAME_RE.test(name)) {\n issues.push({\n path: `inputs.${name}`,\n message: `invalid input name '${name}' — letters/digits/underscore, not starting with a digit`,\n });\n }\n if (decl.default !== undefined && scalarType(decl.default) !== decl.type) {\n issues.push({\n path: `inputs.${name}.default`,\n message: `default is a ${scalarType(decl.default)} but the declared type is '${decl.type}'`,\n });\n }\n }\n }\n }\n\n // 2. Derive built-ins from the LITERAL contextId.\n let builtins: { context: string; suffix: string } | undefined;\n const ctxId = (body as Record<string, unknown>).contextId;\n if (typeof ctxId === 'string' && ctxId.length > 0) {\n if (ctxId.includes('${{')) {\n issues.push({\n path: 'contextId',\n message: `contextId must be a literal — it cannot use '\\${{ … }}' (it is the source of vectros.* built-ins)`,\n });\n } else {\n builtins = { context: ctxId, suffix: deriveSuffix(ctxId) };\n }\n }\n // contextId missing / non-string → builtins stay undefined; parseBlueprint\n // separately reports the missing/invalid contextId.\n\n // 3. Resolve values, then substitute through the body.\n const values = resolveValues(declared, supplied, issues);\n const ctx: ResolveCtx = { declared, values, builtins, issues };\n const substituted = substituteValue(body, ctx, '');\n\n if (issues.length) {\n throw new BlueprintInputError(`Blueprint variable resolution failed:\\n${renderIssues(issues)}`, issues);\n }\n return substituted;\n}\n","/**\n * Bundled blueprint: task-management.\n *\n * The canonical first blueprint (design doc Appendix A). Structured task\n * tracking, shareable across sessions, agents, and users. Demonstrates the\n * full contract: a HYBRID-indexed schema, a data-plane-only profile that\n * passes the CLI scope gate, a service principal, and deterministic seed\n * data — all with stable identifiers so a loader re-run is idempotent.\n *\n * Bundled blueprints are TRUSTED (they ship in the reviewed packages), but\n * the CLI's scope gate still applies — `tests/blueprints.test.ts` asserts\n * this blueprint is structurally valid, and the CLI's gate test asserts it\n * stays data-plane-only.\n *\n * It is the \"copy me to start\" exemplar, so it stays a SINGLE schema — but it\n * is a complete one: it shows render hints (so the no-code UI renders a real\n * form), write-time validation, and BOTH lookup shapes — equality (enumerate a\n * project's tasks) and an ordered RANGE index on the due date (list tasks due\n * in a window). The equality-vs-range choice per field is permanent once a\n * schema is live (see the lookupFields note below), so it is made deliberately.\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r] —\n * all data-plane. Note the deliberate ABSENCE of records:d (tasks are\n * marked done, not deleted — least privilege).\n */\nimport type { Blueprint } from '../types.js';\n\nconst taskManagement: Blueprint = {\n name: 'task-management',\n version: '1.0.0',\n description: 'Structured task tracking, shareable across sessions, agents, and users.',\n\n contextId: 'task-management',\n contextName: 'Task Management',\n\n schemas: [\n {\n typeName: 'task',\n displayName: 'Task',\n indexMode: 'HYBRID', // keyword on titles + semantic on descriptions\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, section: 'Task', displayField: true },\n },\n {\n fieldId: 'description',\n fieldType: 'string',\n searchable: true,\n description: 'Free-text detail — the RAG-able body.',\n validation: { maxLength: 8000 },\n renderHints: { label: 'Description', widget: 'textarea', order: 2, section: 'Task' },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['todo', 'in_progress', 'blocked', 'done'],\n renderHints: { label: 'Status', widget: 'select', order: 3, section: 'Tracking' },\n },\n {\n fieldId: 'priority',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['low', 'medium', 'high', 'urgent'],\n // Equality, NOT range: the values are an ordinal vocabulary but they sort\n // LEXICALLY (high < low < medium < urgent), not by severity — a range\n // index here would be permanently wrong. Filter by exact priority instead.\n renderHints: { label: 'Priority', widget: 'select', order: 4, section: 'Tracking' },\n },\n {\n fieldId: 'assignee',\n fieldType: 'string',\n filterable: true,\n description: 'userId or display name.',\n renderHints: { label: 'Assignee', widget: 'text', order: 5, section: 'Tracking' },\n },\n {\n fieldId: 'project',\n fieldType: 'string',\n filterable: true,\n description: 'Grouping key for cross-session continuity.',\n renderHints: { label: 'Project', widget: 'text', order: 6, section: 'Tracking' },\n },\n {\n fieldId: 'dueDate',\n fieldType: 'date',\n description: 'ISO-8601. Range-queryable (see lookupFields) — list tasks due in a window.',\n renderHints: { label: 'Due date', widget: 'date', order: 7, section: 'Tracking' },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 8, section: 'Tracking' },\n },\n // externalId is the record's FIRST-CLASS identifier (the dedup/lookup key + the\n // value a `reference` resolves against) — not a payload field; the loader sends\n // it top-level on the RecordRequest.\n ],\n // Two lookup shapes, chosen deliberately because the equality-vs-range choice\n // per field is MIGRATION-LOCKED once the schema is live (you cannot flip a\n // field slot↔range later, even by removing and re-adding it):\n // • `project` — EQUALITY (a grouping key, not ordered): enumerate one\n // project's tasks directly, no search. Each equality lookup uses 1 of the\n // schema's 7 fast index slots.\n // • `dueDate` — RANGE: ordered `from`/`to`/`prefix` queries (\"tasks due this\n // week\", \"due in 2026-06\"). Range lookups use a relationship row, not a\n // slot, and are billed at the range rate. ISO-8601 sorts chronologically,\n // so the order is correct.\n // `externalId` has a built-in first-class finder and must NOT be redeclared here.\n lookupFields: ['project', { fieldName: 'dueDate', rangeEnabled: true }],\n },\n ],\n\n // Least-privilege profile — MUST pass the CLI scope gate.\n // r/c/u + search + schema discovery. NOT records:d (least privilege).\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r'],\n // dataScope omitted → tenant-level shared tracker. Bind to an orgId\n // for per-org isolation.\n },\n\n servicePrincipal: {\n externalId: 'task-management',\n displayName: 'Task Management',\n },\n\n seed: [\n {\n surface: 'record',\n typeName: 'task',\n externalId: 'seed-welcome',\n fields: {\n title: 'Welcome to your Vectros task tracker',\n description: 'Created by the bootstrap loader. Ask your agent to add tasks.',\n status: 'todo',\n priority: 'low',\n project: 'getting-started',\n dueDate: '2026-06-30',\n },\n },\n ],\n};\n\nexport default taskManagement;\n","/**\n * Bundled blueprint: coding-agent-memory.\n *\n * Persistent, governed project memory for a coding agent (Claude Desktop,\n * Cursor, Cline…). The agent records the decisions, conventions, and gotchas\n * it learns about a codebase so they survive across sessions — instead of\n * re-asking and re-breaking the same things every cold start.\n *\n * Demonstrates the agent-memory FACTS/ENTITIES + EPISODIC flavors on the\n * Vectros substrate: schema'd records (typed facts), exact lookup (idempotent\n * upsert by a caller-stable key), HYBRID search + grounded `rag_ask` (recall by\n * meaning — \"why did we decide X?\"), version history (how a decision evolved),\n * RANGE lookups on the \"when\" of each memory (\"decisions from this quarter\"),\n * and a typed REFERENCE link between record types (a convention cites the\n * decision that established it — a small knowledge graph). It is pure no-code: a\n * `vectros bootstrap` provisions the schemas + a narrow `ssk_*`, and the agent\n * drives it through the MCP server's data-plane tools.\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r, inference:r].\n * Note the deliberate ABSENCE of records:d: decisions are SUPERSEDED (status\n * flips to `superseded`), never deleted, so the audit trail of how the project's\n * thinking changed stays intact (least privilege). `inference:r` powers the\n * grounded \"why did we do X?\" recall (`rag_ask`) over the captured rationale.\n */\nimport type { Blueprint } from '../types.js';\n\nconst codingAgentMemory: Blueprint = {\n name: 'coding-agent-memory',\n version: '1.0.0',\n description:\n 'Persistent project memory for a coding agent — decisions, conventions, and gotchas that survive across sessions.',\n\n contextId: 'coding-memory',\n contextName: 'Coding Agent — Project Memory',\n\n schemas: [\n {\n // A durable architectural/product decision: what was decided, and WHY.\n // The rationale is the high-value, RAG-able body — \"why did we do X?\"\n // is the question a cold-context agent most needs answered.\n typeName: 'decision',\n displayName: 'Decision',\n indexMode: 'HYBRID', // keyword on titles + semantic on statement/rationale\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, displayField: true },\n },\n {\n fieldId: 'statement',\n fieldType: 'string',\n searchable: true,\n description: 'What was decided, in one or two sentences.',\n renderHints: { label: 'Statement', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'rationale',\n fieldType: 'string',\n searchable: true,\n description: 'Why — the trade-offs and the context. The most-recalled field.',\n renderHints: { label: 'Rationale', widget: 'textarea', order: 3 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['proposed', 'active', 'superseded'],\n renderHints: { label: 'Status', widget: 'select', order: 4 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n description: 'Subsystem / module the decision applies to (e.g. \"auth\", \"search\").',\n renderHints: { label: 'Area', widget: 'text', order: 5 },\n },\n {\n fieldId: 'decidedOn',\n fieldType: 'date',\n description: 'ISO-8601 date. Range-queryable — \"decisions made this quarter\".',\n renderHints: { label: 'Decided on', widget: 'date', order: 6 },\n },\n // externalId is the record's FIRST-CLASS identifier (the dedup/upsert key + the\n // value a `reference` resolves against) — it is NOT a payload field, so it is not\n // declared here; the loader sends it top-level on the RecordRequest.\n ],\n // `externalId` is a first-class identifier with its own finder (exact\n // get/upsert) — look it up directly, never redeclare it as a schema lookup.\n // The choice below is MIGRATION-LOCKED once the schema is live:\n // • `area`/`status` — EQUALITY (categorical): \"list active decisions\",\n // \"all decisions in the auth area\". 2 of the 7 fast index slots.\n // • `decidedOn` — RANGE: ordered `from`/`to`/`prefix` over the date.\n lookupFields: ['area', 'status', { fieldName: 'decidedOn', rangeEnabled: true }],\n },\n {\n // A coding convention the team follows — the agent reads these before it\n // writes code so it matches the surrounding style instead of inventing one.\n typeName: 'convention',\n displayName: 'Convention',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'name',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Name', widget: 'text', order: 1, displayField: true },\n },\n {\n fieldId: 'rule',\n fieldType: 'string',\n searchable: true,\n description: 'The convention itself, stated as an imperative.',\n renderHints: { label: 'Rule', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 3 },\n },\n {\n // Parallels `decision.status` so a convention can be RETIRED rather than\n // deleted (the blueprint omits records:d — memory is superseded, not lost).\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'retired'],\n renderHints: { label: 'Status', widget: 'select', order: 4 },\n },\n {\n // A typed REFERENCE to the decision that established this convention — a\n // foreign-key link between record types (the knowledge-graph edge). The\n // platform requires both the target type AND its surface; the value is the\n // target decision's externalId (the default `targetField`). Provenance:\n // \"why does this convention exist? → open the decision behind it.\" Not\n // searchable (a foreign-key id is search noise); declared as an equality\n // lookup below so you can also enumerate \"conventions from decision X\".\n fieldId: 'establishedByDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'record',\n targetField: 'externalId',\n cardinality: 'one',\n renderHints: { label: 'Established by (decision)', order: 5 },\n },\n {\n fieldId: 'adoptedOn',\n fieldType: 'date',\n description: 'ISO-8601 — when this convention was adopted. Range-queryable.',\n renderHints: { label: 'Adopted on', widget: 'date', order: 6 },\n },\n // externalId: first-class identifier, not a payload field (see `decision`).\n ],\n // externalId has its own first-class finder for exact get — look it up\n // directly, not as a schema lookup. Locked equality-vs-range choices:\n // • `area`/`status` — EQUALITY: \"active conventions for auth\".\n // • `establishedByDecision` — EQUALITY on the reference value: enumerate\n // \"conventions established by decision X\" (a forward link query; the\n // platform has no reverse-reference index on this surface).\n // • `adoptedOn` — RANGE over the adoption date.\n // 3 equality lookups (of 7 fast slots) + 1 range row.\n lookupFields: ['area', 'status', 'establishedByDecision', { fieldName: 'adoptedOn', rangeEnabled: true }],\n },\n {\n // A gotcha / sharp edge: a symptom, its cause, and the fix. Saves the\n // agent (and the human) from re-discovering the same trap.\n typeName: 'gotcha',\n displayName: 'Gotcha',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'symptom',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 500 },\n renderHints: { label: 'Symptom', widget: 'textarea', order: 1, displayField: true },\n },\n {\n fieldId: 'cause',\n fieldType: 'string',\n searchable: true,\n renderHints: { label: 'Cause', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'fix',\n fieldType: 'string',\n searchable: true,\n renderHints: { label: 'Fix', widget: 'textarea', order: 3 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 4 },\n },\n {\n // A gotcha can be RETIRED once the underlying trap is fixed for good —\n // superseded, not deleted (the blueprint omits records:d).\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'retired'],\n renderHints: { label: 'Status', widget: 'select', order: 5 },\n },\n {\n fieldId: 'discoveredOn',\n fieldType: 'date',\n description: 'ISO-8601 — when this gotcha was first hit. Range-queryable.',\n renderHints: { label: 'Discovered on', widget: 'date', order: 6 },\n },\n // externalId: first-class identifier, not a payload field (see `decision`).\n ],\n // externalId has its own first-class finder for exact get — look it up\n // directly, not as a schema lookup. `area`/`status` EQUALITY (\"active\n // gotchas in search\"); `discoveredOn` RANGE over the discovery date.\n lookupFields: ['area', 'status', { fieldName: 'discoveredOn', rangeEnabled: true }],\n },\n ],\n\n // Least-privilege profile — MUST pass the CLI scope gate.\n // r/c/u + search + schema discovery + inference:r (grounded \"why did we do X?\"\n // recall over the captured rationale). NOT records:d: memory is superseded,\n // not deleted, so the project's decision history stays auditable.\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r', 'inference:r'],\n },\n\n servicePrincipal: {\n externalId: 'coding-agent-memory',\n displayName: 'Coding Agent — Project Memory',\n },\n\n seed: [\n {\n // Seeded FIRST so the convention below resolves its reference to it — the\n // loader creates seeds in array order, and a reference target must exist when\n // the referencing record is written.\n surface: 'record',\n typeName: 'decision',\n externalId: 'seed-use-vectros-for-memory',\n fields: {\n title: 'Use Vectros as the coding agent’s project memory',\n statement:\n 'Persist decisions, conventions, and gotchas as Vectros records so they survive across agent sessions.',\n rationale:\n 'A coding agent loses context every cold start. A governed, searchable memory lets it recall prior decisions by meaning instead of re-asking — and the version history shows how the thinking evolved.',\n status: 'active',\n area: 'getting-started',\n decidedOn: '2026-06-14',\n },\n },\n {\n // Demonstrates a live typed link at bootstrap: this convention references the\n // decision above by its externalId, so \"open the decision behind this rule\"\n // works the moment the blueprint is applied.\n surface: 'record',\n typeName: 'convention',\n externalId: 'seed-record-the-why',\n fields: {\n name: 'Record the why, not just the what',\n rule: 'When you record a decision or convention, always capture the rationale — the trade-offs a future session cannot re-derive from the code.',\n area: 'getting-started',\n status: 'active',\n establishedByDecision: 'seed-use-vectros-for-memory',\n adoptedOn: '2026-06-14',\n },\n },\n ],\n};\n\nexport default codingAgentMemory;\n","/**\n * Bundled blueprint: agentic-sdlc.\n *\n * A system of record for the whole software-delivery lifecycle,\n * built for an AI development team. It primarily serves AGENTS working on behalf\n * of humans (and the humans themselves) — the durable, governed, searchable\n * memory a coding/ops agent needs so it stops re-deriving decisions and\n * re-breaking the same things every cold start.\n *\n * The organizing principle is CONTENT vs STRUCTURE:\n * - DOCUMENTS are content-dominant — the markdown body IS the artifact, and the\n * typed metadata supports recall + the graph. ADRs, design docs, reference\n * guides, runbooks, and post-mortems are documents (you read them; you ask\n * them questions). They bind a schema on the `document` surface, are ingested\n * via `document_ingest`, and their prose is what hybrid search + `rag_ask`\n * answer over.\n * - RECORDS are structure-dominant — the typed fields ARE the artifact. Controls\n * (compliance rows), conventions (operating rules), gotchas (symptom/cause/fix),\n * and glossary terms are records: short, exact-queryable, enumerable.\n *\n * The knowledge graph deliberately CROSSES surfaces: a `control` (record) is\n * proven by a `runbook` (document); a `convention` (record) cites the `decision`\n * (document) that established it; a `term` (record) links to the `decision` that\n * defines it; and documents reference documents (a design → its decision, a\n * runbook → the post-mortem it was born from, an ADR → the one it supersedes).\n * Record→document and document→document typed references are the showcase — typed\n * documents are first-class graph nodes, not opaque blobs.\n *\n * Agent memory is a first-class concern here, but it is NOT a separate \"memory\"\n * type: the durable, shareable things a team teaches its agents ARE operating\n * rules (`convention`), how-tos (`reference`), traps (`gotcha`), and decisions\n * (`decision`). Per-user PRIVATE/isolated memory (userId-scoped) is a deliberate\n * future chapter, not in this version.\n *\n * No bundled SEED in this version: the content artifacts live on the document\n * surface and the cross-surface graph is populated by the ingest agent (the\n * `document_ingest` / `record_create` path), not the bootstrap seed step — so the\n * context provisions empty and is filled from your corpus. (Production contexts\n * use `vectros bootstrap --no-seed` regardless.)\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r,\n * inference:r, documents:r, documents:c, folders:r, folders:c].\n * Knowledge is SUPERSEDED / RETIRED via a status flip, never deleted (no :d).\n */\nimport type { Blueprint } from '../types.js';\n\nconst agenticSdlc: Blueprint = {\n name: 'agentic-sdlc',\n version: '1.0.0',\n description:\n \"A whole-SDLC system of record for an AI development team — decisions, designs, references, runbooks, post-mortems (as documents) plus controls, conventions, gotchas, and a glossary (as records), cross-linked and recalled by meaning.\",\n\n contextId: 'agentic-sdlc',\n contextName: 'Agentic SDLC Knowledge Base',\n\n schemas: [\n // ============================ DOCUMENTS ============================\n // Content-dominant: the markdown body is the artifact; fields are metadata.\n // Each binds the `document` surface and is ingested via `document_ingest`.\n\n {\n // An architecture/product DECISION (an ADR). The body is the prose —\n // Context / Decision / Consequences — and is what `rag_ask` answers over;\n // the fields below are filter/sort metadata + the supersede chain. The\n // anchor of the graph: most other types link back to a decision.\n typeName: 'decision',\n displayName: 'Decision (ADR)',\n indexMode: 'HYBRID',\n allowedSurfaces: ['document'],\n // A document carries an INTRINSIC title (the ingest title) + body; the schema\n // declares only the metadata BEYOND those. (No typed `title` field — that\n // would duplicate the document's own title.)\n fields: [\n {\n fieldId: 'summary',\n fieldType: 'string',\n searchable: true,\n description: 'A one-paragraph abstract of the decision. The full reasoning is the document body.',\n renderHints: { label: 'Summary', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['proposed', 'accepted', 'superseded', 'deprecated'],\n renderHints: { label: 'Status', widget: 'select', order: 3 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n description: 'Subsystem the decision applies to (e.g. \"search\", \"auth\", \"billing\").',\n renderHints: { label: 'Area', widget: 'text', order: 4 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n description: 'Freeform labels (e.g. \"security\", \"schema\"). Search-side filter.',\n renderHints: { label: 'Tags', order: 5 },\n },\n {\n // Self-reference (document → document): the decision this one supersedes.\n fieldId: 'supersedes',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The decision this one supersedes (by externalId).',\n renderHints: { label: 'Supersedes', order: 6 },\n },\n {\n fieldId: 'date',\n fieldType: 'date',\n description: 'ISO-8601 decision date. Range-queryable / sortable.',\n renderHints: { label: 'Date', widget: 'date', order: 7 },\n },\n ],\n lookupFields: ['status', 'area', 'supersedes', { fieldName: 'date', rangeEnabled: true }],\n },\n {\n // A DESIGN doc or spec — the exploration that drives a decision. Distinct\n // from `decision` (a different browse genre + it links to the decision it\n // informs). Body = the design narrative.\n typeName: 'design',\n displayName: 'Design',\n indexMode: 'HYBRID',\n allowedSurfaces: ['document'],\n // Intrinsic title + body; schema = metadata beyond those (no typed `title`).\n fields: [\n {\n fieldId: 'summary',\n fieldType: 'string',\n searchable: true,\n description: 'A one-paragraph abstract. The full design is the document body.',\n renderHints: { label: 'Summary', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['draft', 'active', 'implemented', 'superseded'],\n renderHints: { label: 'Status', widget: 'select', order: 3 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 4 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 5 },\n },\n {\n // Cross-document edge: the decision this design informs/produces.\n fieldId: 'relatedDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The decision this design informs (by externalId).',\n renderHints: { label: 'Related decision', order: 6 },\n },\n {\n // Self-reference: a design supersedes an earlier design/spec.\n fieldId: 'supersedes',\n fieldType: 'reference',\n targetTypeName: 'design',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The design this one supersedes (by externalId).',\n renderHints: { label: 'Supersedes', order: 7 },\n },\n {\n fieldId: 'updatedOn',\n fieldType: 'date',\n description: 'ISO-8601 — when last revised. Range-queryable.',\n renderHints: { label: 'Updated on', widget: 'date', order: 8 },\n },\n ],\n lookupFields: ['status', 'area', 'relatedDecision', 'supersedes', { fieldName: 'updatedOn', rangeEnabled: true }],\n },\n {\n // A REFERENCE doc — maintained \"how it works / how to\": guides, onboarding,\n // API docs, process docs. Body = the prose. Distinct shape: a `category`\n // (DRY sub-labels — onboarding/api/process are same shape) and `lastReviewed`\n // (freshness is the whole game for reference material).\n typeName: 'reference',\n displayName: 'Reference',\n indexMode: 'HYBRID',\n allowedSurfaces: ['document'],\n // Intrinsic title + body; schema = metadata beyond those (no typed `title`).\n fields: [\n {\n fieldId: 'summary',\n fieldType: 'string',\n searchable: true,\n description: 'A one-paragraph abstract. The full reference is the document body.',\n renderHints: { label: 'Summary', widget: 'textarea', order: 2 },\n },\n {\n // The sub-kind, as a filterable field (not a separate schema — these are\n // the same shape, differing only by label, so a field is the DRY choice).\n fieldId: 'category',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['guide', 'onboarding', 'api', 'process', 'other'],\n renderHints: { label: 'Category', widget: 'select', order: 3 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 4 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 5 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'superseded'],\n renderHints: { label: 'Status', widget: 'select', order: 6 },\n },\n {\n // Optional cross-document edge: the decision behind this reference.\n fieldId: 'relatedDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The decision behind this reference, if any (by externalId).',\n renderHints: { label: 'Related decision', order: 7 },\n },\n {\n // Freshness — \"references not reviewed since X\". The reference-doc signal.\n fieldId: 'lastReviewed',\n fieldType: 'date',\n description: 'ISO-8601 — when this reference was last verified current. Range-queryable.',\n renderHints: { label: 'Last reviewed', widget: 'date', order: 8 },\n },\n ],\n lookupFields: ['category', 'area', 'status', 'relatedDecision', { fieldName: 'lastReviewed', rangeEnabled: true }],\n },\n {\n // A RUNBOOK — a step-by-step operational procedure (deploy, release, recover).\n // Body = the procedure. Distinct browse genre, and often BORN FROM a\n // post-mortem (its resolution, codified) — a cross-document edge.\n typeName: 'runbook',\n displayName: 'Runbook',\n indexMode: 'HYBRID',\n allowedSurfaces: ['document'],\n // Intrinsic title + body; schema = metadata beyond those (no typed `title`).\n fields: [\n {\n fieldId: 'summary',\n fieldType: 'string',\n searchable: true,\n description: 'When to use this runbook — the trigger. The steps are the document body.',\n renderHints: { label: 'Summary', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 3 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 4 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'retired'],\n renderHints: { label: 'Status', widget: 'select', order: 5 },\n },\n {\n // Cross-document edge: the post-mortem whose resolution this runbook codifies.\n fieldId: 'bornFrom',\n fieldType: 'reference',\n targetTypeName: 'postmortem',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The post-mortem this runbook was codified from (by externalId).',\n renderHints: { label: 'Born from (post-mortem)', order: 6 },\n },\n {\n fieldId: 'relatedDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'A decision this runbook implements, if any (by externalId).',\n renderHints: { label: 'Related decision', order: 7 },\n },\n {\n fieldId: 'updatedOn',\n fieldType: 'date',\n description: 'ISO-8601 — when last revised. Range-queryable.',\n renderHints: { label: 'Updated on', widget: 'date', order: 8 },\n },\n ],\n lookupFields: ['area', 'status', 'bornFrom', 'relatedDecision', { fieldName: 'updatedOn', rangeEnabled: true }],\n },\n {\n // A POST-MORTEM — what broke and the durable lesson. Body = the writeup\n // (impact / root cause / resolution / lesson). Distinct shape: `severity` +\n // `occurredOn` (the incident timeline). \"Have we hit this before?\" lives here.\n typeName: 'postmortem',\n displayName: 'Post-mortem',\n indexMode: 'HYBRID',\n allowedSurfaces: ['document'],\n // Intrinsic title + body; schema = metadata beyond those (no typed `title`).\n fields: [\n {\n fieldId: 'summary',\n fieldType: 'string',\n searchable: true,\n description: 'What happened, in brief. The full analysis (impact/root cause/resolution/lesson) is the body.',\n renderHints: { label: 'Summary', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'severity',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['low', 'medium', 'high', 'critical'],\n renderHints: { label: 'Severity', widget: 'select', order: 3 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['open', 'mitigated', 'resolved'],\n renderHints: { label: 'Status', widget: 'select', order: 4 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 5 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 6 },\n },\n {\n fieldId: 'relatedDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'A decision implicated in or addressed by this incident (by externalId).',\n renderHints: { label: 'Related decision', order: 7 },\n },\n {\n fieldId: 'occurredOn',\n fieldType: 'date',\n description: 'ISO-8601 — when it happened. Range-queryable — \"incidents this month\".',\n renderHints: { label: 'Occurred on', widget: 'date', order: 8 },\n },\n ],\n lookupFields: ['severity', 'status', 'area', 'relatedDecision', { fieldName: 'occurredOn', rangeEnabled: true }],\n },\n\n // ============================= RECORDS =============================\n // Structure-dominant: the typed fields are the artifact. Short, exact-queryable.\n\n {\n // A governance CONTROL — a policy/standard/control the codebase must satisfy,\n // WITH its evidence. The compliance instrument: it records what enforces it\n // (`evidence`), the runbook that VERIFIES it (cross-surface → document), and\n // the decision that mandates it. \"Which critical controls are active, and how\n // is each proven?\"\n typeName: 'control',\n displayName: 'Control',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, displayField: true },\n },\n {\n fieldId: 'statement',\n fieldType: 'string',\n searchable: true,\n description: 'The requirement — what must always hold.',\n renderHints: { label: 'Statement', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'rationale',\n fieldType: 'string',\n searchable: true,\n description: 'Why the control exists — the risk it prevents.',\n renderHints: { label: 'Rationale', widget: 'textarea', order: 3 },\n },\n {\n // The policy → implementation spectrum in one filterable field.\n fieldId: 'kind',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['policy', 'standard', 'control'],\n renderHints: { label: 'Kind', widget: 'select', order: 4 },\n },\n {\n // Ordinal, but EQUALITY (range/prefix order is lexical, so low<critical\n // would sort alphabetically). Enumerate \"all critical controls\" by equality.\n fieldId: 'criticality',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['low', 'medium', 'high', 'critical'],\n renderHints: { label: 'Criticality', widget: 'select', order: 5 },\n },\n {\n fieldId: 'evidence',\n fieldType: 'string',\n searchable: true,\n description: 'What enforces or proves the control inline (e.g. an architecture test or gate).',\n renderHints: { label: 'Evidence', widget: 'textarea', order: 6 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['draft', 'active', 'retired'],\n renderHints: { label: 'Status', widget: 'select', order: 7 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 8 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 9 },\n },\n {\n // Cross-surface edge (record → document): the runbook that proves the control.\n fieldId: 'verifiedBy',\n fieldType: 'reference',\n targetTypeName: 'runbook',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The runbook that verifies this control (by externalId).',\n renderHints: { label: 'Verified by (runbook)', order: 10 },\n },\n {\n // Cross-surface edge (record → document): the decision that mandates it.\n fieldId: 'relatedDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The decision that mandates this control (by externalId).',\n renderHints: { label: 'Related decision', order: 11 },\n },\n {\n fieldId: 'reviewedOn',\n fieldType: 'date',\n description: 'ISO-8601 last-reviewed date. Range-queryable.',\n renderHints: { label: 'Reviewed on', widget: 'date', order: 12 },\n },\n ],\n lookupFields: [\n 'kind',\n 'criticality',\n 'status',\n 'area',\n 'verifiedBy',\n 'relatedDecision',\n { fieldName: 'reviewedOn', rangeEnabled: true },\n ],\n },\n {\n // A CONVENTION — a must-follow operating rule the team teaches its agents. The\n // durable, shareable operating-memory. Distinct fields capture how we actually\n // write these: the `rule` (imperative), the `why` (rationale), and `howToApply`\n // (the concrete application) are SEPARATE fields, not one blob — so an agent can\n // recall the rule, the reasoning, and the how independently.\n typeName: 'convention',\n displayName: 'Convention',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, displayField: true },\n },\n {\n fieldId: 'rule',\n fieldType: 'string',\n searchable: true,\n description: 'The convention itself, stated as an imperative.',\n renderHints: { label: 'Rule', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'why',\n fieldType: 'string',\n searchable: true,\n description: 'Why it matters — the trade-off / the antipattern it prevents.',\n renderHints: { label: 'Why', widget: 'textarea', order: 3 },\n },\n {\n fieldId: 'howToApply',\n fieldType: 'string',\n searchable: true,\n description: 'How to comply in practice — the concrete application steps.',\n renderHints: { label: 'How to apply', widget: 'textarea', order: 4 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 5 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'retired'],\n renderHints: { label: 'Status', widget: 'select', order: 6 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 7 },\n },\n {\n // Cross-surface edge (record → document): the decision that established it.\n fieldId: 'establishedBy',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'The decision that established this convention (by externalId).',\n renderHints: { label: 'Established by (decision)', order: 8 },\n },\n {\n fieldId: 'updatedOn',\n fieldType: 'date',\n description: 'ISO-8601 — when last revised. Range-queryable.',\n renderHints: { label: 'Updated on', widget: 'date', order: 9 },\n },\n ],\n lookupFields: ['area', 'status', 'establishedBy', { fieldName: 'updatedOn', rangeEnabled: true }],\n },\n {\n // A GOTCHA / sharp edge: a symptom, its cause, and the fix. A tight typed\n // triple — found by meaning (semantic search on the symptom) + area/status.\n // The most standalone type; no typed edge.\n typeName: 'gotcha',\n displayName: 'Gotcha',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'symptom',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 500 },\n renderHints: { label: 'Symptom', widget: 'textarea', order: 1, displayField: true },\n },\n {\n fieldId: 'cause',\n fieldType: 'string',\n searchable: true,\n renderHints: { label: 'Cause', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'fix',\n fieldType: 'string',\n searchable: true,\n renderHints: { label: 'Fix', widget: 'textarea', order: 3 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 4 },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'resolved'],\n renderHints: { label: 'Status', widget: 'select', order: 5 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 6 },\n },\n {\n fieldId: 'discoveredOn',\n fieldType: 'date',\n description: 'ISO-8601 — when first hit. Range-queryable.',\n renderHints: { label: 'Discovered on', widget: 'date', order: 7 },\n },\n ],\n lookupFields: ['area', 'status', { fieldName: 'discoveredOn', rangeEnabled: true }],\n },\n {\n // A glossary TERM — a definition keyed by the term itself. Structure-dominant:\n // `term` is a UNIQUE exact-lookup key (the showcase of a uniqueness constraint),\n // `definition` is the RAG body, `aliases` catch alternate names. Links to the\n // decision that defines/establishes the concept where there is one.\n typeName: 'term',\n displayName: 'Glossary term',\n indexMode: 'HYBRID',\n fields: [\n {\n fieldId: 'term',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Term', widget: 'text', order: 1, displayField: true },\n },\n {\n fieldId: 'definition',\n fieldType: 'string',\n searchable: true,\n description: 'What the term means — the RAG-able body.',\n renderHints: { label: 'Definition', widget: 'textarea', order: 2 },\n },\n {\n fieldId: 'aliases',\n fieldType: 'array',\n filterable: true,\n description: 'Alternate names / abbreviations for the same concept.',\n renderHints: { label: 'Aliases', order: 3 },\n },\n {\n fieldId: 'area',\n fieldType: 'string',\n filterable: true,\n renderHints: { label: 'Area', widget: 'text', order: 4 },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n renderHints: { label: 'Tags', order: 5 },\n },\n {\n fieldId: 'relatedDecision',\n fieldType: 'reference',\n targetTypeName: 'decision',\n targetSurface: 'document',\n targetField: 'externalId',\n cardinality: 'one',\n description: 'A decision that defines or establishes this term (by externalId).',\n renderHints: { label: 'Related decision', order: 6 },\n },\n {\n fieldId: 'updatedOn',\n fieldType: 'date',\n description: 'ISO-8601 — when last revised. Range-queryable.',\n renderHints: { label: 'Updated on', widget: 'date', order: 7 },\n },\n ],\n // `term` is a UNIQUE equality lookup — exact \"define X\" + a one-per-term\n // guarantee. `area`/`relatedDecision` enumerate; `updatedOn` is the range row.\n lookupFields: [\n { fieldName: 'term', unique: true },\n 'area',\n 'relatedDecision',\n { fieldName: 'updatedOn', rangeEnabled: true },\n ],\n },\n ],\n\n // Least-privilege, data-plane only. r/c/u records + search + schema discovery +\n // inference:r (grounded recall over the document bodies) + document/folder r/c\n // (the content artifacts are documents). NO :d — knowledge is superseded/retired\n // via a status flip, so the trail of how the team's thinking evolved stays intact.\n accessProfile: {\n allowedActions: [\n 'records:r',\n 'records:c',\n 'records:u',\n 'search:r',\n 'schemas:r',\n 'inference:r',\n 'documents:r',\n 'documents:c',\n 'folders:r',\n 'folders:c',\n ],\n },\n\n servicePrincipal: {\n externalId: 'agentic-sdlc',\n displayName: 'Agentic SDLC Knowledge Base',\n },\n\n // No bundled seed in this version: the content artifacts live on the document\n // surface and the cross-surface graph is populated by the ingest agent\n // (document_ingest / record_create), not the bootstrap seed step. Production\n // contexts provision with `vectros bootstrap --no-seed` regardless.\n};\n\nexport default agenticSdlc;\n","/**\n * Bundled blueprint: second-brain.\n *\n * A personal knowledge base — capture every note, idea, and link, then just\n * ask it. The most universally legible AI-data use case there is, and the\n * canonical exemplar of the agent-memory LONG-TERM / SEMANTIC-RECALL flavor:\n * one `note` schema, HYBRID-indexed, recalled by meaning rather than exact\n * keywords.\n *\n * Pure no-code: `vectros bootstrap` provisions the schema + a narrow `ssk_*`,\n * and you drive it through the MCP server (\"capture this thought\", \"what did I\n * note about X?\") or the generic data-plane app. Notes are archived via a\n * status flip, not deleted — so the profile omits records:d (least privilege).\n *\n * Beyond semantic recall it shows the DIRECT-access patterns an agent reaches\n * for between searches: enumerate notes by `source` (most-recent first), and a\n * `capturedAt` RANGE index for \"what did I capture last week?\". The\n * equality-vs-range choice per lookup field is permanent (see lookupFields).\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r, inference:r].\n */\nimport type { Blueprint } from '../types.js';\n\nconst secondBrain: Blueprint = {\n name: 'second-brain',\n version: '1.0.0',\n description: 'A personal knowledge base — capture notes, ideas, and links, then ask them anything.',\n\n contextId: 'second-brain',\n contextName: 'Second Brain',\n\n schemas: [\n {\n typeName: 'note',\n displayName: 'Note',\n indexMode: 'HYBRID', // keyword on title + semantic on body — recall by meaning\n fields: [\n {\n fieldId: 'title',\n fieldType: 'string',\n required: true,\n searchable: true,\n validation: { minLength: 1, maxLength: 200 },\n renderHints: { label: 'Title', widget: 'text', order: 1, section: 'Note', displayField: true },\n },\n {\n fieldId: 'body',\n fieldType: 'string',\n searchable: true,\n description: 'The note itself — the RAG-able body you ask questions against.',\n validation: { maxLength: 20000 },\n renderHints: { label: 'Body', widget: 'textarea', order: 2, section: 'Note' },\n },\n {\n fieldId: 'tags',\n fieldType: 'array',\n filterable: true,\n description: 'Freeform string labels for filtering (e.g. \"idea\", \"reading\", \"work\").',\n renderHints: { label: 'Tags', order: 3, section: 'Organize' },\n },\n {\n // An enum (not freeform) so enumeration-by-source is reliable — a\n // `record_query` lookup on `source` only works if values are consistent.\n // `other` keeps it from being a straitjacket for a personal brain-dump.\n fieldId: 'source',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['thought', 'web', 'meeting', 'book', 'article', 'other'],\n description: 'Where it came from.',\n renderHints: { label: 'Source', widget: 'select', order: 4, section: 'Organize' },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['active', 'archived'],\n description: 'Archive instead of delete, so nothing is ever lost.',\n renderHints: { label: 'Status', widget: 'select', order: 5, section: 'Organize' },\n },\n {\n fieldId: 'capturedAt',\n fieldType: 'date',\n description: 'ISO-8601 capture date. Range-queryable — \"notes from last week\".',\n renderHints: { label: 'Captured', widget: 'date', order: 6, section: 'Organize' },\n },\n // externalId is the record's FIRST-CLASS identifier (the dedup/upsert key + the\n // value a `reference` resolves against) — not a payload field; the loader sends\n // it top-level on the RecordRequest.\n ],\n // Lookup shapes are MIGRATION-LOCKED once the schema is live (a field cannot\n // flip equality↔range later), so each is chosen on purpose:\n // • `source` — EQUALITY, sorted by `lastUpdated`: enumerate notes from one\n // source, most-recently-touched first. `lastUpdated` is always present, so\n // the sort never drops a note (sorting an equality lookup by an OPTIONAL\n // field would silently exclude rows that lack it).\n // • `status` — EQUALITY: \"show archived notes\".\n // • `capturedAt` — RANGE: ordered `from`/`to`/`prefix` (\"captured in 2026-06\").\n // `externalId` has a built-in first-class finder — look it up directly, never\n // redeclare it here. Equality lookups use the 7 fast index slots (2 used here);\n // range lookups use a relationship row, billed at the range rate.\n lookupFields: [\n { fieldName: 'source', sortBy: 'lastUpdated' },\n 'status',\n { fieldName: 'capturedAt', rangeEnabled: true },\n ],\n },\n ],\n\n // Least-privilege profile — r/c/u + search + schema discovery + inference:r\n // (so the agent can `rag_ask` a grounded, cited question over your notes). No\n // records:d: notes are archived (status → 'archived'), never deleted.\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r', 'inference:r'],\n },\n\n servicePrincipal: {\n externalId: 'second-brain',\n displayName: 'Second Brain',\n },\n\n seed: [\n {\n surface: 'record',\n typeName: 'note',\n externalId: 'seed-welcome',\n fields: {\n title: 'Welcome to your Second Brain',\n body: 'Capture anything here — ideas, links, meeting notes — then ask your agent things like \"what did I note about onboarding?\" and it recalls by meaning, not just keywords.',\n tags: ['getting-started'],\n source: 'thought',\n status: 'active',\n capturedAt: '2026-06-14',\n },\n },\n ],\n};\n\nexport default secondBrain;\n","/**\n * Bundled blueprint: clinical-intake.\n *\n * A behavioral-health intake record — the healthcare-lead exemplar. It exists\n * to make Vectros's compliance posture VISIBLE in a no-code demo: fields marked\n * `sensitive` (PHI) are, by the platform, redacted from audit history AT WRITE\n * TIME (destroyed, not masked — unrecoverable regardless of scope), excluded\n * from the search index, blind-indexed for exact lookup, and masked in\n * responses unless the token carries the `s` reveal scope.\n *\n * The \"aha\" walkthrough: bootstrap → create an intake with a `sensitive` SSN\n * and clinical note → open the record's version history (in app.vectros.ai or\n * via the MCP server) and see the sensitive fields show `[redacted]` in EVERY\n * historical row → search for a phrase from the note and get zero hits → AND\n * STILL find the record by exact client name via the blind-index lookup\n * (the value is HMAC'd into the index, never stored in the clear). The\n * compliance story you can run in 60 seconds, on synthetic data only.\n *\n * `capabilities.auditHistory: true` is explicit (it is the platform default,\n * but a compliance exemplar should self-document its audit posture).\n *\n * PHI HYGIENE: the seed and every example use SYNTHETIC data only. Never enter\n * real PHI into a demo tenant.\n *\n * allowedActions = [records:r, records:c, records:u, search:r, schemas:r].\n * Deliberately NO records:d (intake records are retained, not deleted) and NO\n * `s` reveal scope — so the bootstrapped key itself cannot un-redact sensitive\n * fields, which is the point of the demo. No `inference:r` either: a PHI corpus\n * is the one place we do NOT hand the demo key a RAG capability.\n */\nimport type { Blueprint } from '../types.js';\n\nconst clinicalIntake: Blueprint = {\n name: 'clinical-intake',\n version: '1.0.0',\n description:\n 'Behavioral-health intake with PHI fields — demonstrates redact-at-write, audit history, blind-index lookup, and search exclusion. Synthetic data only.',\n\n contextId: 'clinical-intake',\n contextName: 'Clinical Intake',\n\n schemas: [\n {\n typeName: 'intake',\n displayName: 'Intake',\n indexMode: 'HYBRID',\n capabilities: { auditHistory: true }, // self-documenting compliance posture\n fields: [\n // --- Non-sensitive, searchable/filterable working fields ---\n {\n fieldId: 'caseId',\n fieldType: 'string',\n required: true,\n description: 'Caller-stable intake id; the dedup/lookup key.',\n validation: { minLength: 1, maxLength: 64 },\n renderHints: { label: 'Case ID', widget: 'text', order: 1, section: 'Intake', displayField: true },\n },\n {\n fieldId: 'presentingConcern',\n fieldType: 'string',\n searchable: true,\n description: 'Non-PHI summary of the presenting concern — safe to index + search.',\n validation: { maxLength: 2000 },\n renderHints: { label: 'Presenting concern', widget: 'textarea', order: 2, section: 'Intake' },\n },\n {\n fieldId: 'program',\n fieldType: 'string',\n filterable: true,\n description: 'Program / service line the intake is routed to.',\n renderHints: { label: 'Program', widget: 'text', order: 3, section: 'Intake' },\n },\n {\n fieldId: 'status',\n fieldType: 'enum',\n filterable: true,\n enumValues: ['new', 'in_review', 'scheduled', 'closed'],\n renderHints: { label: 'Status', widget: 'select', order: 4, section: 'Intake' },\n },\n {\n fieldId: 'submittedAt',\n fieldType: 'date',\n description: 'ISO-8601. Range-queryable — a coordinator can pull \"intakes submitted this week\".',\n renderHints: { label: 'Submitted', widget: 'date', order: 5, section: 'Intake' },\n },\n\n // --- Sensitive (PHI) fields: redacted-at-write, search-excluded, masked-on-read ---\n {\n fieldId: 'clientName',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI. Blind-indexed for EXACT lookup (a lookup field below); never in the search index or audit log.',\n renderHints: { label: 'Client name', widget: 'text', order: 10, section: 'Client (PHI)' },\n },\n {\n fieldId: 'dateOfBirth',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI. ISO-8601. Redacted from audit history at write time.',\n renderHints: { label: 'Date of birth', widget: 'date', order: 11, section: 'Client (PHI)' },\n },\n {\n fieldId: 'ssn',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI. Destroyed before the audit snapshot is written — unrecoverable.',\n validation: { pattern: '^\\\\d{3}-\\\\d{2}-\\\\d{4}$' },\n renderHints: { label: 'SSN', widget: 'text', order: 12, section: 'Client (PHI)' },\n },\n {\n fieldId: 'clinicalNote',\n fieldType: 'string',\n sensitive: true,\n description: 'PHI free-text. Excluded from search so a note phrase never leaks via results.',\n renderHints: { label: 'Clinical note', widget: 'textarea', order: 13, section: 'Client (PHI)' },\n },\n ],\n // Lookup fields back access patterns without a search. The equality-vs-range\n // (and sensitive-blind-index) choice per field is MIGRATION-LOCKED once the\n // schema is live — chosen deliberately:\n // • `caseId` (unique) — EQUALITY: exact get by the stable intake id.\n // • `program`/`status` — EQUALITY (categorical): a coordinator ENUMERATES a\n // worklist (\"all outpatient-counseling intakes\", \"all new intakes\").\n // • `clientName` — a SENSITIVE equality lookup: the value is HMAC'd into a\n // per-tenant BLIND INDEX, so \"find the intake for this exact client name\"\n // works WITHOUT the name ever being stored in the clear or entering search.\n // A sensitive lookup is equality-only — a blind hash is not orderable, so\n // it can never be range-enabled.\n // • `submittedAt` — RANGE: ordered `from`/`to`/`prefix` for a date worklist.\n // 4 equality lookups (of 7 fast slots) + 1 range row. The OTHER PHI fields\n // (dateOfBirth/ssn/clinicalNote) are deliberately NOT lookups here.\n lookupFields: [\n { fieldName: 'caseId', unique: true },\n 'program',\n 'status',\n 'clientName',\n { fieldName: 'submittedAt', rangeEnabled: true },\n ],\n },\n ],\n\n // Least-privilege, data-plane only. No records:d (retain intakes), NO `s`\n // reveal qualifier (the demo key literally cannot un-redact the PHI fields),\n // and NO inference:r (we never point a RAG capability at a PHI corpus here).\n accessProfile: {\n allowedActions: ['records:r', 'records:c', 'records:u', 'search:r', 'schemas:r'],\n },\n\n servicePrincipal: {\n externalId: 'clinical-intake',\n displayName: 'Clinical Intake',\n },\n\n seed: [\n {\n surface: 'record',\n typeName: 'intake',\n externalId: 'seed-synthetic-intake',\n fields: {\n caseId: 'seed-synthetic-intake',\n presentingConcern: 'Sleep difficulty and low mood over the past month; seeking counseling.',\n program: 'outpatient-counseling',\n status: 'new',\n submittedAt: '2026-06-14',\n // SYNTHETIC PHI — illustrative only, not a real person.\n clientName: 'Jordan Sample',\n dateOfBirth: '1990-01-01',\n ssn: '000-00-0000',\n clinicalNote:\n 'Synthetic note for demonstration. Reports difficulty sleeping; no acute safety concerns noted.',\n },\n },\n ],\n};\n\nexport default clinicalIntake;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACiBA,iBAAkB;AAIlB,IAAM,gBAAgB;AAOtB,IAAM,wBAAwB,aAC3B,OAAO;AAAA,EACN,UAAU,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC/B,WAAW,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACrC,WAAW,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACrC,KAAK,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC/B,KAAK,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAC/B,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,OAAO,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC5B,KAAK,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC1B,OAAO,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC5B,MAAM,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EAChC,YAAY,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACtC,UAAU,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACpC,UAAU,aAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AACtC,CAAC,EACA,OAAO;AAKV,IAAM,oBAAoB,aACvB,OAAO;AAAA,EACN,OAAO,aAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,QAAQ,aAAE,KAAK,CAAC,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