@kb-labs/mind-contracts 2.94.0 → 2.98.0

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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts","../src/contract.ts","../src/types/config.ts","../src/schema/contract.schema.ts","../src/schema/api.schema.ts","../src/schema/artifacts.schema.ts","../src/schema/commands.schema.ts","../src/schema/workflows.schema.ts","../src/schema/mind.contracts.schema.ts"],"sourcesContent":["export const contractsVersion = '1.0.0';\nexport const contractsSchemaId = '@kb-labs/mind-contracts/schema';\n\nexport type ContractsSchemaId = typeof contractsSchemaId;\n","import type { PluginContracts } from './types';\nimport { contractsSchemaId, contractsVersion } from './version';\n\nexport const pluginContractsManifest: PluginContracts = {\n schema: contractsSchemaId,\n pluginId: '@kb-labs/mind',\n contractsVersion,\n artifacts: {},\n commands: {\n 'mind:init': {\n id: 'mind:init',\n description: 'Initialise the Mind workspace structure.',\n input: {\n ref: '@kb-labs/mind-contracts/schema#MindInitCommandInputSchema',\n format: 'zod',\n },\n examples: ['kb mind init --force', 'kb mind init --json'],\n },\n 'mind:verify': {\n id: 'mind:verify',\n description: 'Validate Mind indexes and surface inconsistencies.',\n input: {\n ref: '@kb-labs/mind-contracts/schema#MindVerifyCommandInputSchema',\n format: 'zod',\n },\n output: {\n ref: '@kb-labs/mind-contracts/schema#MindVerifyCommandOutputSchema',\n format: 'zod',\n },\n examples: ['kb mind verify', 'kb mind verify --json'],\n },\n },\n workflows: {},\n api: {\n rest: {\n basePath: '/v1/plugins/mind',\n routes: {\n 'mind.rest.verify': {\n id: 'mind.rest.verify',\n method: 'GET',\n path: '/verify',\n description: 'Summarise index verification status for Studio dashboards.',\n response: {\n ref: '@kb-labs/mind-contracts/schema#MindVerifyResponseSchema',\n format: 'zod',\n },\n },\n },\n },\n },\n};\n","/**\n * Registry configuration for Mind sync\n */\nexport interface MindSyncRegistryConfig {\n type: 'filesystem';\n path: string;\n}\n\n/**\n * Soft delete configuration for Mind sync\n */\nexport interface MindSyncSoftDeleteConfig {\n enabled: boolean;\n ttlDays: number;\n}\n\n/**\n * Partial updates configuration for Mind sync\n */\nexport interface MindSyncPartialUpdatesConfig {\n enabled: boolean;\n}\n\n/**\n * Batch processing configuration for Mind sync\n */\nexport interface MindSyncBatchConfig {\n maxSize: number;\n}\n\n/**\n * Mind synchronization configuration\n */\nexport interface MindSyncConfig {\n registry: MindSyncRegistryConfig;\n softDelete: MindSyncSoftDeleteConfig;\n partialUpdates: MindSyncPartialUpdatesConfig;\n batch: MindSyncBatchConfig;\n}\n\n/**\n * Mind source configuration\n */\nexport interface MindSourceConfig {\n id: string;\n paths: string[];\n exclude?: string[];\n}\n\n/**\n * Mind engine configuration\n */\nexport interface MindEngineConfig {\n id: string;\n type: string;\n options?: Record<string, unknown>;\n}\n\n/**\n * Mind scope configuration\n */\nexport interface MindScopeConfig {\n id: string;\n sourceIds?: string[];\n defaultEngine?: string;\n include?: string[];\n exclude?: string[];\n}\n\n/**\n * Mind defaults configuration\n */\nexport interface MindDefaultsConfig {\n fallbackEngineId?: string;\n}\n\n/**\n * Canonical Mind configuration input\n */\nexport interface MindConfigInput {\n sources: MindSourceConfig[];\n scopes: MindScopeConfig[];\n engines: MindEngineConfig[];\n defaults?: MindDefaultsConfig;\n}\n\n/**\n * Mind configuration with sync section\n */\nexport interface MindConfig extends MindConfigInput {\n /**\n * Synchronization settings for Mind\n */\n sync?: MindSyncConfig;\n}\n\n/**\n * Default sync configuration\n */\nexport const defaultMindSyncConfig: MindSyncConfig = {\n registry: {\n type: 'filesystem',\n path: '.kb/mind/sync/registry.json',\n },\n softDelete: {\n enabled: true,\n ttlDays: 30,\n },\n partialUpdates: {\n enabled: true,\n },\n batch: {\n maxSize: 100,\n },\n};\n","import { z } from 'zod';\nimport { apiContractSchema } from './api.schema';\nimport { artifactsContractMapSchema } from './artifacts.schema';\nimport { commandContractMapSchema } from './commands.schema';\nimport { workflowContractMapSchema } from './workflows.schema';\nimport { contractsSchemaId } from '../version';\n\nexport const pluginContractsSchema = z\n .object({\n schema: z.literal(contractsSchemaId),\n pluginId: z.string().min(1),\n contractsVersion: z.string().min(1),\n artifacts: artifactsContractMapSchema,\n commands: commandContractMapSchema.optional(),\n workflows: workflowContractMapSchema.optional(),\n api: apiContractSchema.optional(),\n })\n .strict();\n\nexport type PluginContractsSchema = z.infer<typeof pluginContractsSchema>;\n\nexport function parsePluginContracts(input: unknown) {\n return pluginContractsSchema.parse(input);\n}\n","import { z } from 'zod';\n\nexport const schemaReferenceSchema = z.object({\n ref: z.string().min(1),\n format: z.enum(['zod', 'json-schema', 'openapi']).optional(),\n description: z.string().optional(),\n});\n\nexport const restRouteContractSchema = z.object({\n id: z.string().min(1),\n method: z.string().min(1),\n path: z.string().min(1),\n description: z.string().optional(),\n request: schemaReferenceSchema.optional(),\n response: schemaReferenceSchema.optional(),\n produces: z.array(z.string().min(1)).optional(),\n consumes: z.array(z.string().min(1)).optional(),\n});\n\nexport const restApiContractSchema = z.object({\n basePath: z.string().min(1),\n routes: z.record(restRouteContractSchema),\n});\n\nexport const apiContractSchema = z.object({\n rest: restApiContractSchema.optional(),\n});\n","import { z } from 'zod';\n\nexport const artifactExampleSchema = z.object({\n summary: z.string().optional(),\n payload: z.unknown().optional(),\n});\n\nexport const artifactContractSchema = z.object({\n id: z.string().min(1),\n kind: z.enum(['file', 'json', 'markdown', 'binary', 'dir', 'log']),\n description: z.string().optional(),\n pathPattern: z.string().min(1).optional(),\n mediaType: z.string().min(1).optional(),\n schemaRef: z.string().min(1).optional(),\n example: artifactExampleSchema.optional(),\n});\n\nexport const artifactsContractMapSchema = z.record(artifactContractSchema);\n","import { z } from 'zod';\nimport { schemaReferenceSchema } from './api.schema';\n\nexport const commandContractSchema = z.object({\n id: z.string().min(1),\n description: z.string().optional(),\n input: schemaReferenceSchema.optional(),\n output: schemaReferenceSchema.optional(),\n produces: z.array(z.string().min(1)).optional(),\n consumes: z.array(z.string().min(1)).optional(),\n examples: z.array(z.string().min(1)).optional(),\n});\n\nexport const commandContractMapSchema = z.record(commandContractSchema);\n","import { z } from 'zod';\n\nexport const workflowStepSchema = z.object({\n id: z.string().min(1),\n description: z.string().optional(),\n commandId: z.string().min(1).optional(),\n consumes: z.array(z.string().min(1)).optional(),\n produces: z.array(z.string().min(1)).optional(),\n});\n\nexport const workflowContractSchema = z.object({\n id: z.string().min(1),\n description: z.string().optional(),\n consumes: z.array(z.string().min(1)).optional(),\n produces: z.array(z.string().min(1)).optional(),\n steps: z.array(workflowStepSchema).optional(),\n});\n\nexport const workflowContractMapSchema = z.record(workflowContractSchema);\n","import { z } from 'zod';\n\nconst commandCommonFlags = z.object({\n cwd: z.string().min(1).optional(),\n json: z.boolean().optional(),\n quiet: z.boolean().optional(),\n verbose: z.boolean().optional(),\n});\n\nconst budgetEnvelopeSchema = z.object({\n usedMs: z.number().nonnegative().optional(),\n limitMs: z.number().nonnegative().optional(),\n});\n\nexport const MindInitCommandInputSchema = commandCommonFlags.extend({\n force: z.boolean().optional(),\n});\n\nexport const MindUpdateCommandInputSchema = commandCommonFlags.extend({\n since: z.string().optional(),\n 'time-budget': z.number().int().positive().optional(),\n 'no-cache': z.boolean().optional(),\n});\n\nexport const MindUpdateCommandOutputSchema = z.object({\n ok: z.boolean(),\n delta: z.unknown().optional(),\n budget: budgetEnvelopeSchema.optional(),\n timing: z.number().nonnegative().optional(),\n code: z.string().optional(),\n message: z.string().optional(),\n hint: z.string().optional(),\n});\n\nconst packIntentSchema = z.object({\n intent: z.string().min(1),\n product: z.string().optional(),\n preset: z.string().optional(),\n budget: z.number().int().positive().optional(),\n 'with-bundle': z.boolean().optional(),\n out: z.string().optional(),\n seed: z.number().int().optional(),\n});\n\nexport const MindPackCommandInputSchema = commandCommonFlags.merge(packIntentSchema);\n\nexport const MindPackCommandOutputSchema = z.object({\n ok: z.boolean(),\n intent: z.string().optional(),\n product: z.string().nullable().optional(),\n tokensEstimate: z.number().optional(),\n sectionUsage: z.record(z.unknown()).optional(),\n 'with-bundle': z.boolean().optional(),\n seed: z.number().optional(),\n deterministic: z.boolean().optional(),\n timing: z.number().nonnegative().optional(),\n 'pack-output': z.string().optional(),\n code: z.string().optional(),\n message: z.string().optional(),\n hint: z.string().optional(),\n});\n\nexport const MindFeedCommandInputSchema = commandCommonFlags\n .merge(packIntentSchema)\n .extend({\n 'no-update': z.boolean().optional(),\n since: z.string().optional(),\n 'time-budget': z.number().int().positive().optional(),\n });\n\nexport const MindFeedCommandOutputSchema = z.object({\n ok: z.boolean(),\n mode: z.enum(['update-and-pack', 'pack-only']).optional(),\n intent: z.string().optional(),\n product: z.string().nullable().optional(),\n tokensEstimate: z.number().optional(),\n out: z.string().nullable().optional(),\n update: z\n .object({\n delta: z.unknown().optional(),\n budget: budgetEnvelopeSchema.optional(),\n })\n .nullable()\n .optional(),\n pack: z\n .object({\n sectionUsage: z.record(z.unknown()).optional(),\n deterministic: z.boolean().optional(),\n })\n .optional(),\n ignoredFlags: z.array(z.string()).optional(),\n timing: z.number().nonnegative().optional(),\n 'pack-output': z.string().optional(),\n code: z.string().optional(),\n message: z.string().optional(),\n hint: z.string().optional(),\n});\n\nexport const MindQueryCommandInputSchema = commandCommonFlags.extend({\n query: z.enum(['impact', 'scope', 'exports', 'externals', 'chain', 'meta', 'docs']),\n file: z.string().optional(),\n path: z.string().optional(),\n scope: z.string().optional(),\n limit: z.number().int().positive().optional(),\n depth: z.number().int().positive().optional(),\n 'cache-ttl': z.number().int().nonnegative().optional(),\n 'cache-mode': z.enum(['ci', 'local']).optional(),\n 'no-cache': z.boolean().optional(),\n paths: z.enum(['id', 'absolute']).optional(),\n compact: z.boolean().optional(),\n 'ai-mode': z.boolean().optional(),\n toon: z.boolean().optional(),\n 'toon-sidecar': z.boolean().optional(),\n product: z.string().optional(),\n tag: z.string().optional(),\n type: z.string().optional(),\n filter: z.string().optional(),\n});\n\nexport const MindQueryCommandOutputSchema = z.object({\n ok: z.boolean().optional(),\n format: z.enum(['json', 'toon']).optional(),\n content: z.union([z.string(), z.record(z.unknown())]).optional(),\n error: z.string().optional(),\n});\n\nexport const MindVerifyCommandInputSchema = commandCommonFlags.extend({\n cwd: z.string().optional(),\n});\n\nexport const MindVerifyCommandOutputSchema = z.object({\n ok: z.boolean(),\n code: z.string().nullable().optional(),\n inconsistencies: z\n .array(\n z.object({\n file: z.string().optional(),\n expected: z.string().optional(),\n actual: z.string().optional(),\n type: z.string().optional(),\n }),\n )\n .optional(),\n hint: z.string().optional(),\n schemaVersion: z.string().optional(),\n meta: z\n .object({\n cwd: z.string().optional(),\n filesChecked: z.number().optional(),\n timingMs: z.number().optional(),\n })\n .optional(),\n});\n\nexport const MindQueryRequestSchema = z.object({\n query: z.string().min(1),\n params: z.record(z.unknown()).optional().default({}),\n options: z\n .object({\n cwd: z.string().optional(),\n limit: z.number().optional(),\n depth: z.number().optional(),\n cacheTtl: z.number().optional(),\n cacheMode: z.enum(['local', 'ci']).optional(),\n noCache: z.boolean().optional(),\n pathMode: z.enum(['id', 'absolute']).optional(),\n aiMode: z.boolean().optional(),\n })\n .optional(),\n});\n\nexport const MindQueryResponseSchema = z.object({\n sections: z.array(\n z.object({\n title: z.string(),\n format: z.string().optional(),\n data: z.unknown(),\n collapsible: z.boolean().optional(),\n }),\n ),\n});\n\nexport const MindVerifyResponseSchema = z.object({\n cards: z.array(\n z.object({\n title: z.string(),\n content: z.string(),\n status: z.string().optional(),\n }),\n ),\n});\n"],"mappings":";AAAO,IAAM,mBAAmB;AACzB,IAAM,oBAAoB;;;ACE1B,IAAM,0BAA2C;AAAA,EACtD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,UAAU;AAAA,IACR,aAAa;AAAA,MACX,IAAI;AAAA,MACJ,aAAa;AAAA,MACb,OAAO;AAAA,QACL,KAAK;AAAA,QACL,QAAQ;AAAA,MACV;AAAA,MACA,UAAU,CAAC,wBAAwB,qBAAqB;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O,EAAE,SAAS;AAAA,IAC9B,WAAWA,GAAE,KAAK,CAAC,SAAS,IAAI,CAAC,EAAE,SAAS;AAAA,IAC5C,SAASA,GAAE,QAAQ,EAAE,SAAS;AAAA,IAC9B,UAAUA,GAAE,KAAK,CAAC,MAAM,UAAU,CAAC,EAAE,SAAS;AAAA,IAC9C,QAAQA,GAAE,QAAQ,EAAE,SAAS;AAAA,EAC/B,CAAC,EACA,SAAS;AACd,CAAC;AAEM,IAAM,0BAA0BA,GAAE,OAAO;AAAA,EAC9C,UAAUA,GAAE;AAAA,IACVA,GAAE,OAAO;AAAA,MACP,OAAOA,GAAE,OAAO;AAAA,MAChB,QAAQA,GAAE,OAAO,EAAE,SAAS;AAAA,MAC5B,MAAMA,GAAE,QAAQ;AAAA,MAChB,aAAaA,GAAE,QAAQ,EAAE,SAAS;AAAA,IACpC,CAAC;AAAA,EACH;AACF,CAAC;AAEM,IAAM,2BAA2BA,GAAE,OAAO;AAAA,EAC/C,OAAOA,GAAE;AAAA,IACPA,GAAE,OAAO;AAAA,MACP,OAAOA,GAAE,OAAO;AAAA,MAChB,SAASA,GAAE,OAAO;AAAA,MAClB,QAAQA,GAAE,OAAO,EAAE,SAAS;AAAA,IAC9B,CAAC;AAAA,EACH;AACF,CAAC;","names":["z","z","z","z","z","z","z"]}
1
+ {"version":3,"sources":["../src/routes.ts","../src/config.ts","../src/trace.ts","../src/flags.ts","../src/schema/agent.schema.ts","../src/schema/search.schema.ts","../src/schema/index.schema.ts","../src/schema/query.schema.ts","../src/schema/explore.schema.ts","../src/schema/drop.schema.ts","../src/schema/sync.schema.ts","../src/schema/status.schema.ts"],"names":["z"],"mappings":";;;;AAOO,IAAM,cAAA,GAAiB;AAEvB,IAAM,WAAA,GAAc;AAAA,EACzB,KAAA,EAAO,QAAA;AAAA,EACP,MAAA,EAAQ,SAAA;AAAA,EACR,KAAA,EAAO,QAAA;AAAA,EACP,OAAA,EAAS,UAAA;AAAA,EACT,IAAA,EAAM,QAAA;AA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,GAAA,EAAKA,EAAE,OAAA;AACT,CAAC","file":"index.js","sourcesContent":["/**\n * REST route constants for Mind.\n *\n * `BASE_PATH` is temporary (`/v1/plugins/mind`) for coexistence with the\n * legacy plugin; it becomes `/v1/plugins/mind` at the Phase 6 rename.\n */\n\nexport const MIND_BASE_PATH = '/v1/plugins/mind' as const;\n\nexport const MIND_ROUTES = {\n INDEX: '/index',\n SEARCH: '/search',\n QUERY: '/query',\n EXPLORE: '/explore',\n DROP: '/index',\n SYNC_ADD: '/sync/add',\n SYNC_UPDATE: '/sync/update',\n SYNC_DELETE: '/sync/delete',\n SYNC_LIST: '/sync/list',\n SYNC_STATUS: '/sync/status',\n STATUS: '/status',\n HEALTH: '/health',\n REINDEX: '/reindex',\n} as const;\n\nexport const MIND_FULL_ROUTES = {\n INDEX: `${MIND_BASE_PATH}${MIND_ROUTES.INDEX}`,\n SEARCH: `${MIND_BASE_PATH}${MIND_ROUTES.SEARCH}`,\n QUERY: `${MIND_BASE_PATH}${MIND_ROUTES.QUERY}`,\n EXPLORE: `${MIND_BASE_PATH}${MIND_ROUTES.EXPLORE}`,\n DROP: `${MIND_BASE_PATH}${MIND_ROUTES.DROP}`,\n SYNC_ADD: `${MIND_BASE_PATH}${MIND_ROUTES.SYNC_ADD}`,\n SYNC_UPDATE: `${MIND_BASE_PATH}${MIND_ROUTES.SYNC_UPDATE}`,\n SYNC_DELETE: `${MIND_BASE_PATH}${MIND_ROUTES.SYNC_DELETE}`,\n SYNC_LIST: `${MIND_BASE_PATH}${MIND_ROUTES.SYNC_LIST}`,\n SYNC_STATUS: `${MIND_BASE_PATH}${MIND_ROUTES.SYNC_STATUS}`,\n STATUS: `${MIND_BASE_PATH}${MIND_ROUTES.STATUS}`,\n HEALTH: `${MIND_BASE_PATH}${MIND_ROUTES.HEALTH}`,\n REINDEX: `${MIND_BASE_PATH}${MIND_ROUTES.REINDEX}`,\n} as const;\n\n/** Cache + vector-store namespace prefix; renamed to `mind:` at Phase 6. */\nexport const MIND_NAMESPACE_PREFIX = 'mind:' as const;\n","/**\n * Mind configuration (`configSection: 'mind'`).\n *\n * Pure wire/config types — no platform internals. `resolveMindConfig` merges a\n * partial file config onto defaults so callers always get a complete config.\n */\n\nimport { z } from 'zod';\n\nexport const ChunkConfigSchema = z.object({\n /** Target chunk size in tokens. */\n maxTokens: z.number().int().positive().default(400),\n /** Overlap between adjacent chunks, in tokens. */\n overlapTokens: z.number().int().nonnegative().default(50),\n /** Use AST-aware chunking where a parser exists (falls back to sliding window). */\n ast: z.boolean().default(true),\n});\n\n/** Per-mode pipeline budget. Modes are configs of one pipeline, not code paths. */\nexport const ModeBudgetSchema = z.object({\n /** Max chunks fed into the answer stage. */\n maxChunks: z.number().int().positive(),\n /** Max sub-queries from decomposition (0 = no decomposition). */\n maxSubqueries: z.number().int().nonnegative(),\n /** Completeness-check iterations. */\n maxIterations: z.number().int().nonnegative(),\n /** Whether the synthesize stage calls the LLM. */\n useLLM: z.boolean(),\n});\n\nexport const ModesConfigSchema = z.object({\n instant: ModeBudgetSchema.default({\n maxChunks: 5,\n maxSubqueries: 0,\n maxIterations: 0,\n useLLM: false,\n }),\n auto: ModeBudgetSchema.default({\n maxChunks: 8,\n maxSubqueries: 3,\n maxIterations: 1,\n useLLM: true,\n }),\n thinking: ModeBudgetSchema.default({\n maxChunks: 12,\n maxSubqueries: 5,\n maxIterations: 3,\n useLLM: true,\n }),\n});\n\nexport const RetrievalConfigSchema = z.object({\n /** Default number of results returned by `search`. */\n limit: z.number().int().positive().default(10),\n /** Reciprocal-rank-fusion constant. */\n rrfK: z.number().int().positive().default(60),\n /** Enable heuristic reranking of fused candidates. */\n rerank: z.boolean().default(true),\n /** Enable semantic dedup of retrieved chunks. */\n dedup: z.boolean().default(true),\n /**\n * HyDE (Hypothetical Document Embeddings): embed an LLM-generated hypothetical\n * answer instead of the raw query for the vector search (BM25 still uses the\n * raw query). Trades one LLM call per query for better concept-query recall.\n * Off by default — enable only where the bench A/B shows a lift.\n */\n hyde: z.boolean().default(false),\n /**\n * Query expansion: ask the LLM for related identifiers/synonyms and append\n * them to the BM25 (lexical) query, so vocabulary mismatch between the query\n * wording and the code/doc terms still surfaces lexical hits. Orthogonal to\n * HyDE (which bridges the vector side). Trades one LLM call per query.\n * Off by default — enable only where the bench A/B shows a lift.\n */\n expand: z.boolean().default(false),\n});\n\nexport const ConfidenceConfigSchema = z.object({\n /** Below this, agent answers abstain in strict mode. */\n floor: z.number().min(0).max(1).default(0.3),\n});\n\n/**\n * Index scope. Either a single path/glob (shorthand) or an explicit\n * include/exclude set. Paths are repo-relative; a bare dir means \"everything\n * under it\". `exclude` globs are subtracted from `include` at discovery time.\n *\n * \"core\" just core/\n * { include: [\"core\",\"plugins\",\"sdk\"] } those roots\n * { include: [\".\"], exclude: [\"sites/**\"] } whole repo minus noise\n */\nexport const IndexScopeSchema = z.union([\n z.string(),\n z\n .object({\n include: z.array(z.string()).optional(),\n exclude: z.array(z.string()).optional(),\n })\n .strict(),\n]);\nexport type IndexScope = z.infer<typeof IndexScopeSchema>;\n\n/** Normalized scope the engine consumes. */\nexport interface ResolvedScope {\n /** Repo-relative roots/globs to index (default: whole repo). */\n include: string[];\n /** Globs subtracted from the include set. */\n exclude: string[];\n}\n\n/** Normalize the config/shorthand scope into `{ include, exclude }`. */\nexport function resolveScope(scope: IndexScope | undefined): ResolvedScope {\n if (scope === undefined) {\n return { include: ['.'], exclude: [] };\n }\n if (typeof scope === 'string') {\n return { include: [scope], exclude: [] };\n }\n return {\n include: scope.include && scope.include.length > 0 ? scope.include : ['.'],\n exclude: scope.exclude ?? [],\n };\n}\n\nexport const IndexConfigSchema = z.object({\n /** Path/glob or include/exclude set indexed into this index (CLI `--scope` overrides). */\n scope: IndexScopeSchema.optional(),\n /** Human label (optional, for status/UX). */\n label: z.string().optional(),\n /** Per-index chunk overrides; unset fields fall back to the global `chunk`. */\n chunk: ChunkConfigSchema.partial().optional(),\n /** Per-index retrieval overrides; unset fields fall back to global `retrieval`. */\n retrieval: RetrievalConfigSchema.partial().optional(),\n});\n\nexport const MindConfigSchema = z.object({\n /** Default index used when a command omits `--index`. */\n defaultIndex: z.string().default('default'),\n /** Named indexes with per-index scope + overrides. */\n indexes: z.record(z.string(), IndexConfigSchema).default({}),\n chunk: ChunkConfigSchema.default({}),\n retrieval: RetrievalConfigSchema.default({}),\n modes: ModesConfigSchema.default({}),\n confidence: ConfidenceConfigSchema.default({}),\n});\n\nexport type ChunkConfig = z.infer<typeof ChunkConfigSchema>;\nexport type RetrievalConfig = z.infer<typeof RetrievalConfigSchema>;\nexport type IndexConfig = z.infer<typeof IndexConfigSchema>;\nexport type MindConfig = z.infer<typeof MindConfigSchema>;\nexport type MindConfigInput = z.input<typeof MindConfigSchema>;\nexport type ModeBudget = z.infer<typeof ModeBudgetSchema>;\n\n/** Chunk + retrieval settings effective for a given index, overrides applied. */\nexport interface EffectiveIndexConfig {\n /** Normalized include/exclude the engine discovers against. */\n scope: ResolvedScope;\n chunk: ChunkConfig;\n retrieval: RetrievalConfig;\n}\n\n/**\n * Resolve the effective settings for an index: global config with the named\n * index's overrides layered on top. Unknown index → global defaults.\n */\nexport function effectiveIndexConfig(config: MindConfig, indexId: string): EffectiveIndexConfig {\n const idx = config.indexes[indexId];\n return {\n scope: resolveScope(idx?.scope),\n chunk: { ...config.chunk, ...idx?.chunk },\n retrieval: { ...config.retrieval, ...idx?.retrieval },\n };\n}\n\n/**\n * Merge a partial file config onto schema defaults. Always returns a fully\n * populated, validated config.\n */\nexport function resolveMindConfig(input: MindConfigInput | undefined): MindConfig {\n return MindConfigSchema.parse(input ?? {});\n}\n","/**\n * Pipeline trace types — emitted per stage for debugging and Studio\n * visualization of how a query flowed through retrieve → fuse → … → synthesize.\n */\n\nimport { z } from 'zod';\n\nexport const StageTraceSchema = z.object({\n /** Stage name, e.g. 'retrieve', 'fuse', 'rerank', 'verify', 'synthesize'. */\n stage: z.string(),\n /** Wall-clock duration of the stage, in milliseconds. */\n durationMs: z.number(),\n /** Number of items the stage produced (chunks, candidates, …). */\n outputCount: z.number().optional(),\n /** Free-form, stage-specific detail (scores, weights, decisions). */\n detail: z.record(z.unknown()).optional(),\n});\nexport type StageTrace = z.infer<typeof StageTraceSchema>;\n\nexport const TraceSchema = z.object({\n requestId: z.string(),\n mode: z.string(),\n totalMs: z.number(),\n stages: z.array(StageTraceSchema),\n});\nexport type Trace = z.infer<typeof TraceSchema>;\n","/**\n * Declarative CLI flag definitions for Mind commands (`defineFlags` from\n * `@kb-labs/sdk`). Shared between the manifest and command handlers.\n */\n\nimport { defineFlags } from '@kb-labs/sdk';\n\nconst JSON_DESC = 'Output JSON';\nconst INDEX_DESC = 'Index/corpus id';\nconst FORMAT_DESC = 'Output format';\nconst SNIPPET_DESC = 'How much source text per result';\n\nexport const indexFlags = defineFlags({\n index: { type: 'string', description: INDEX_DESC, examples: ['code', 'docs'] },\n scope: { type: 'string', description: 'Glob/path scope to index', examples: ['src/**', 'docs/**'] },\n root: { type: 'string', description: 'Project root to index (default: cwd)', examples: ['/path/to/repo'] },\n full: { type: 'boolean', description: 'Full rebuild instead of incremental delta', default: false },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport const searchFlags = defineFlags({\n text: { type: 'string', description: 'Query text', required: true },\n index: { type: 'string', description: `${INDEX_DESC} to search` },\n intent: { type: 'string', description: 'Query intent hint', examples: ['lookup', 'concept', 'architecture'] },\n limit: { type: 'number', description: 'Max results' },\n snippet: { type: 'string', description: SNIPPET_DESC, examples: ['none', 'line', 'full'] },\n format: { type: 'string', description: FORMAT_DESC, examples: ['text', 'json'] },\n json: { type: 'boolean', description: `${JSON_DESC} (alias for --format json)`, default: false },\n});\n\nexport const askFlags = defineFlags({\n text: { type: 'string', description: 'Question to answer', required: true },\n index: { type: 'string', description: `${INDEX_DESC} to query` },\n mode: { type: 'string', description: 'Answer depth', examples: ['instant', 'auto', 'thinking'] },\n snippet: { type: 'string', description: SNIPPET_DESC, examples: ['none', 'line', 'full'] },\n format: { type: 'string', description: FORMAT_DESC, examples: ['text', 'json'] },\n agent: { type: 'boolean', description: 'Emit machine-readable agent JSON (alias for --format json)', default: false },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport const exploreFlags = defineFlags({\n task: { type: 'string', description: 'The task to orient around', required: true },\n index: { type: 'string', description: `${INDEX_DESC} to explore` },\n limit: { type: 'number', description: 'Max files in the map' },\n format: { type: 'string', description: FORMAT_DESC, examples: ['text', 'json'] },\n json: { type: 'boolean', description: `${JSON_DESC} (alias for --format json)`, default: false },\n});\n\nexport const syncPathsFlags = defineFlags({\n index: { type: 'string', description: INDEX_DESC },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport const syncDeleteFlags = defineFlags({\n index: { type: 'string', description: INDEX_DESC },\n yes: { type: 'boolean', description: 'Confirm deletion (recoverable via `kb mind sync add`)', default: false },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport const syncListFlags = defineFlags({\n index: { type: 'string', description: INDEX_DESC },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport const reindexFlags = defineFlags({\n index: { type: 'string', description: INDEX_DESC },\n full: { type: 'boolean', description: 'Full rebuild', default: false },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport const statusFlags = defineFlags({\n index: { type: 'string', description: 'Limit to a single index' },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport const dropFlags = defineFlags({\n index: { type: 'string', description: 'Index to drop (vectors + manifest)', required: true },\n yes: { type: 'boolean', description: 'Skip the confirmation prompt', default: false },\n json: { type: 'boolean', description: JSON_DESC, default: false },\n});\n\nexport type IndexFlags = typeof indexFlags.infer;\nexport type SearchFlags = typeof searchFlags.infer;\nexport type AskFlags = typeof askFlags.infer;\nexport type ExploreFlags = typeof exploreFlags.infer;\nexport type SyncPathsFlags = typeof syncPathsFlags.infer;\nexport type SyncDeleteFlags = typeof syncDeleteFlags.infer;\nexport type SyncListFlags = typeof syncListFlags.infer;\nexport type ReindexFlags = typeof reindexFlags.infer;\nexport type StatusFlags = typeof statusFlags.infer;\nexport type DropFlags = typeof dropFlags.infer;\n","/**\n * Agent response contract — lean, pointers-not-payloads.\n *\n * Designed for an agent solving a task whose context must not be cluttered:\n * answer + source POINTERS (file + line range the agent can open itself) +\n * trust signals (confidence/abstained) + provenance (matchedBy) + freshness\n * (stale). Telemetry lives in `meta`. A snapshot test gates this shape.\n */\n\nimport { z } from 'zod';\n\nexport const AgentQueryModeSchema = z.enum(['instant', 'auto', 'thinking']);\nexport type AgentQueryMode = z.infer<typeof AgentQueryModeSchema>;\n\nexport const AgentSourceKindSchema = z.enum(['file', 'doc', 'adr', 'repo', 'code', 'config', 'external']);\nexport type AgentSourceKind = z.infer<typeof AgentSourceKindSchema>;\n\n/** Which retrieval signal surfaced a result — the \"why\" + proof-of-value vs grep. */\nexport const MatchedBySchema = z.enum(['lexical', 'semantic', 'both']);\nexport type MatchedBy = z.infer<typeof MatchedBySchema>;\n\nexport const AgentWarningSchema = z.object({\n code: z.string(),\n message: z.string(),\n details: z.record(z.unknown()).optional(),\n});\nexport type AgentWarning = z.infer<typeof AgentWarningSchema>;\n\n/** A source pointer. `snippet` rides only when the caller asks (`--snippet`). */\nexport const AgentSourceSchema = z.object({\n file: z.string(),\n lines: z.tuple([z.number(), z.number()]),\n kind: AgentSourceKindSchema,\n matchedBy: MatchedBySchema,\n /** On-disk content drifted from the index → agent should re-read the live file. */\n stale: z.boolean(),\n snippet: z.string().optional(),\n});\nexport type AgentSource = z.infer<typeof AgentSourceSchema>;\n\n/** Telemetry container — agents ignore it; humans/observability use it. */\nexport const AgentMetaSchema = z\n .object({\n requestId: z.string(),\n mode: AgentQueryModeSchema,\n timingMs: z.number(),\n indexId: z.string(),\n })\n .passthrough();\nexport type AgentMeta = z.infer<typeof AgentMetaSchema>;\n\nexport const AgentResponseSchema = z.object({\n answer: z.string(),\n confidence: z.number(),\n /** True when confidence is below floor / no usable sources — do not trust the answer. */\n abstained: z.boolean(),\n sources: z.array(AgentSourceSchema),\n warnings: z.array(AgentWarningSchema).optional(),\n meta: AgentMetaSchema,\n});\nexport type AgentResponse = z.infer<typeof AgentResponseSchema>;\n\nexport const AgentErrorResponseSchema = z.object({\n error: z.object({ code: z.string(), message: z.string(), recoverable: z.boolean() }),\n meta: AgentMetaSchema,\n});\nexport type AgentErrorResponse = z.infer<typeof AgentErrorResponseSchema>;\n\n/** Confidence bands (used by the task-rag skill to decide trust). */\nexport const CONFIDENCE_THRESHOLDS = { high: 0.8, medium: 0.6, low: 0.3 } as const;\n","/**\n * `search` wire contract (CLI `mind search` / REST `POST /search`).\n *\n * Lean, sources-first: ordered pointers (no raw score — order is the rank),\n * with provenance (`matchedBy`) and freshness (`stale`). Telemetry in `meta`.\n */\n\nimport { z } from 'zod';\nimport { AgentSourceKindSchema, MatchedBySchema } from './agent.schema';\n\n/** How much source text rides in the response (context-economy knob). */\nexport const SnippetModeSchema = z.enum(['none', 'line', 'full']);\nexport type SnippetMode = z.infer<typeof SnippetModeSchema>;\n\nexport const SearchRequestSchema = z.object({\n text: z.string().min(1),\n indexId: z.string().optional(),\n /** Optional query-intent hint for adaptive fusion weights. */\n intent: z.enum(['lookup', 'concept', 'architecture']).optional(),\n limit: z.coerce.number().int().positive().optional(), // CLI passes strings; REST passes numbers\n snippet: SnippetModeSchema.optional(),\n});\nexport type SearchRequest = z.infer<typeof SearchRequestSchema>;\n\nexport const SearchResultSchema = z.object({\n file: z.string(),\n lines: z.tuple([z.number(), z.number()]),\n kind: AgentSourceKindSchema,\n matchedBy: MatchedBySchema,\n stale: z.boolean(),\n snippet: z.string().optional(),\n});\nexport type SearchResult = z.infer<typeof SearchResultSchema>;\n\nexport const SearchMetaSchema = z\n .object({\n requestId: z.string(),\n timingMs: z.number(),\n /** Share of results found semantic-only (grep would miss) — proof of value. */\n semanticWinRate: z.number(),\n /** How many returned results have drifted on disk since indexing. */\n staleCount: z.number(),\n })\n .passthrough();\nexport type SearchMeta = z.infer<typeof SearchMetaSchema>;\n\nexport const SearchResponseSchema = z.object({\n results: z.array(SearchResultSchema), // ordered by rank\n /** Overall retrieval relevance (0..1) — \"did this index have anything for me\". */\n confidence: z.number(),\n indexId: z.string(),\n meta: SearchMetaSchema,\n});\nexport type SearchResponse = z.infer<typeof SearchResponseSchema>;\n","/**\n * `index` and `reindex` wire contracts.\n */\n\nimport { z } from 'zod';\n\nexport const IndexRequestSchema = z.object({\n /** Index/corpus id; defaults to config.defaultIndex. */\n indexId: z.string().optional(),\n /** Glob/path scope to index; defaults to the whole workspace. */\n scope: z.string().optional(),\n /** Full rebuild instead of incremental delta. */\n full: z.boolean().optional(),\n});\nexport type IndexRequest = z.infer<typeof IndexRequestSchema>;\n\nexport const IndexResponseSchema = z.object({\n indexId: z.string(),\n filesIndexed: z.number(),\n chunks: z.number(),\n durationMs: z.number(),\n});\nexport type IndexResponse = z.infer<typeof IndexResponseSchema>;\n\nexport const ReindexRequestSchema = z.object({\n indexId: z.string().optional(),\n full: z.boolean().optional(),\n});\nexport type ReindexRequest = z.infer<typeof ReindexRequestSchema>;\n","/**\n * `query` (agent) wire contract. Response is the frozen `AgentResponse`.\n */\n\nimport { z } from 'zod';\nimport { AgentQueryModeSchema } from './agent.schema';\nimport { SnippetModeSchema } from './search.schema';\n\nexport const QueryRequestSchema = z.object({\n text: z.string().min(1),\n indexId: z.string().optional(),\n mode: AgentQueryModeSchema.optional(),\n snippet: SnippetModeSchema.optional(),\n});\nexport type QueryRequest = z.infer<typeof QueryRequestSchema>;\n\n// The query (`ask`) response is the `AgentResponse` — exported from agent.schema.\n","/**\n * `explore` wire contract (CLI `mind explore` / REST `POST /explore`).\n *\n * Task-orientation: given a task, return the relevant files (ranked, grounded by\n * retrieval) plus an LLM-synthesized orientation — \"where to start / how\n * involved this is\". No hardcoded role heuristics: ranking comes from retrieval,\n * the orientation comes from the model, structure (`spread`) from the paths.\n */\n\nimport { z } from 'zod';\nimport { MatchedBySchema } from './agent.schema';\n\nexport const ExploreRequestSchema = z.object({\n task: z.string().min(1),\n indexId: z.string().optional(),\n limit: z.coerce.number().int().positive().optional(),\n});\nexport type ExploreRequest = z.infer<typeof ExploreRequestSchema>;\n\nexport const ExploreEntrySchema = z.object({\n file: z.string(),\n lines: z.tuple([z.number(), z.number()]),\n /** What was matched here — the representative line (from retrieval, not rules). */\n why: z.string(),\n matchedBy: MatchedBySchema,\n stale: z.boolean(),\n});\nexport type ExploreEntry = z.infer<typeof ExploreEntrySchema>;\n\nexport const ExploreMetaSchema = z\n .object({\n requestId: z.string(),\n timingMs: z.number(),\n /** Distinct files in the map. */\n filesTouched: z.number(),\n /** Distinct directories the files span — a structural \"how spread out\" hint. */\n spread: z.number(),\n })\n .passthrough();\nexport type ExploreMeta = z.infer<typeof ExploreMetaSchema>;\n\nexport const ExploreResponseSchema = z.object({\n task: z.string(),\n indexId: z.string(),\n confidence: z.number(),\n /** Model-synthesized orientation: where to start + how involved (empty if no LLM). */\n summary: z.string(),\n /** Relevant files, best-ranked first. */\n files: z.array(ExploreEntrySchema),\n meta: ExploreMetaSchema,\n});\nexport type ExploreResponse = z.infer<typeof ExploreResponseSchema>;\n","/**\n * `drop` wire contract (CLI `mind drop` / REST `DELETE /index`).\n *\n * Removes an entire index: all its vectors (by namespace=indexId) plus its\n * manifest. Distinct from `sync delete` (which removes specific documents) and\n * from `reindex --full` (which rebuilds in place).\n */\n\nimport { z } from 'zod';\n\nexport const DropRequestSchema = z.object({\n indexId: z.string().min(1),\n});\nexport type DropRequest = z.infer<typeof DropRequestSchema>;\n\nexport const DropResponseSchema = z.object({\n indexId: z.string(),\n /** Vectors removed from the store. */\n droppedChunks: z.number(),\n /** Documents that were in the manifest. */\n droppedFiles: z.number(),\n});\nexport type DropResponse = z.infer<typeof DropResponseSchema>;\n","/**\n * `sync` wire contracts (add / update / delete / list / status).\n */\n\nimport { z } from 'zod';\n\nconst indexIdField = z.string().optional();\n\nexport const SyncAddRequestSchema = z.object({\n paths: z.array(z.string()).min(1),\n indexId: indexIdField,\n});\nexport type SyncAddRequest = z.infer<typeof SyncAddRequestSchema>;\n\nexport const SyncUpdateRequestSchema = z.object({\n paths: z.array(z.string()).min(1),\n indexId: indexIdField,\n});\nexport type SyncUpdateRequest = z.infer<typeof SyncUpdateRequestSchema>;\n\nexport const SyncDeleteRequestSchema = z.object({\n paths: z.array(z.string()).min(1),\n indexId: indexIdField,\n});\nexport type SyncDeleteRequest = z.infer<typeof SyncDeleteRequestSchema>;\n\nexport const SyncResponseSchema = z.object({\n indexId: z.string(),\n added: z.number(),\n updated: z.number(),\n deleted: z.number(),\n});\nexport type SyncResponse = z.infer<typeof SyncResponseSchema>;\n\nexport const SyncedDocumentSchema = z.object({\n path: z.string(),\n chunks: z.number(),\n indexedAt: z.string(),\n});\nexport type SyncedDocument = z.infer<typeof SyncedDocumentSchema>;\n\nexport const SyncListResponseSchema = z.object({\n indexId: z.string(),\n documents: z.array(SyncedDocumentSchema),\n});\nexport type SyncListResponse = z.infer<typeof SyncListResponseSchema>;\n\nexport const SyncStatusResponseSchema = z.object({\n indexId: z.string(),\n documents: z.number(),\n chunks: z.number(),\n lastIndexedAt: z.string().nullable(),\n stale: z.boolean(),\n});\nexport type SyncStatusResponse = z.infer<typeof SyncStatusResponseSchema>;\n","/**\n * `status` and `health` wire contracts.\n */\n\nimport { z } from 'zod';\n\nexport const IndexSummarySchema = z.object({\n indexId: z.string(),\n /** Human label + what the index covers (scope) — lets an agent pick the right corpus. */\n label: z.string().optional(),\n coverage: z.string().optional(),\n documents: z.number(),\n chunks: z.number(),\n lastIndexedAt: z.string().nullable(),\n /** How many indexed files have drifted on disk since indexing. */\n staleCount: z.number(),\n});\nexport type IndexSummary = z.infer<typeof IndexSummarySchema>;\n\nexport const StatusResponseSchema = z.object({\n indexes: z.array(IndexSummarySchema),\n healthy: z.boolean(),\n});\nexport type StatusResponse = z.infer<typeof StatusResponseSchema>;\n\nexport const HealthResponseSchema = z.object({\n ok: z.boolean(),\n vectorStore: z.boolean(),\n embeddings: z.boolean(),\n llm: z.boolean(),\n});\nexport type HealthResponse = z.infer<typeof HealthResponseSchema>;\n"]}
package/package.json CHANGED
@@ -1,25 +1,14 @@
1
1
  {
2
2
  "name": "@kb-labs/mind-contracts",
3
- "description": "Public contracts for the KB Labs Mind plugin. Declares artifacts, commands, workflows, and API guarantees for consumers.",
4
- "version": "2.94.0",
3
+ "description": "Public contracts for KB Labs Mind (RAG) plugin: wire schemas, flags, config, routes.",
4
+ "version": "2.98.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js",
12
- "require": "./dist/index.js"
13
- },
14
- "./contract": {
15
- "types": "./dist/contract.d.ts",
16
- "import": "./dist/contract.js",
17
- "require": "./dist/contract.js"
18
- },
19
- "./schema": {
20
- "types": "./dist/schema.d.ts",
21
- "import": "./dist/schema.js",
22
- "require": "./dist/schema.js"
11
+ "import": "./dist/index.js"
23
12
  },
24
13
  "./dist/*": "./dist/*"
25
14
  },
@@ -29,17 +18,17 @@
29
18
  "LICENSE"
30
19
  ],
31
20
  "dependencies": {
32
- "zod": "^3.25.76"
21
+ "zod": "^3.25.76",
22
+ "@kb-labs/sdk": "2.22.0"
33
23
  },
34
24
  "devDependencies": {
35
25
  "@types/node": "^24.3.3",
36
26
  "eslint": "^9",
37
27
  "rimraf": "^6.0.1",
38
- "semver": "^7.6.3",
39
28
  "tsup": "^8.5.0",
40
29
  "typescript": "^5.6.3",
41
- "vitest": "^3.2.4",
42
- "@kb-labs/devkit": "2.94.0"
30
+ "vitest": "^3.2.6",
31
+ "@kb-labs/devkit": "2.98.0"
43
32
  },
44
33
  "engines": {
45
34
  "node": ">=20.0.0",
@@ -1,96 +0,0 @@
1
- type SchemaFormat = 'zod' | 'json-schema' | 'openapi';
2
- interface SchemaReference {
3
- ref: string;
4
- format?: SchemaFormat;
5
- description?: string;
6
- }
7
- interface RestRouteContract {
8
- id: string;
9
- method: string;
10
- path: string;
11
- description?: string;
12
- request?: SchemaReference;
13
- response?: SchemaReference;
14
- produces?: string[];
15
- consumes?: string[];
16
- }
17
- interface RestApiContract {
18
- basePath: string;
19
- routes: Record<string, RestRouteContract>;
20
- }
21
- interface ApiContract {
22
- rest?: RestApiContract;
23
- }
24
-
25
- type ArtifactKind = 'file' | 'json' | 'markdown' | 'binary' | 'dir' | 'log';
26
- interface ArtifactExample {
27
- summary?: string;
28
- payload?: unknown;
29
- }
30
- interface PluginArtifactContract {
31
- id: string;
32
- kind: ArtifactKind;
33
- description?: string;
34
- /**
35
- * Relative path or glob pattern describing where the artifact is produced.
36
- */
37
- pathPattern?: string;
38
- /**
39
- * IANA media type describing the artifact (for example: application/json).
40
- */
41
- mediaType?: string;
42
- /**
43
- * Reference to a schema describing the artifact payload. Can be a URI or package export.
44
- */
45
- schemaRef?: string;
46
- /**
47
- * Optional example payload to support documentation and tooling.
48
- */
49
- example?: ArtifactExample;
50
- }
51
- type ArtifactContractsMap = Record<string, PluginArtifactContract>;
52
-
53
- interface CommandContract {
54
- id: string;
55
- description?: string;
56
- input?: SchemaReference;
57
- output?: SchemaReference;
58
- produces?: string[];
59
- consumes?: string[];
60
- examples?: string[];
61
- }
62
- type CommandContractsMap = Record<string, CommandContract>;
63
-
64
- interface WorkflowStepContract {
65
- id: string;
66
- description?: string;
67
- commandId?: string;
68
- consumes?: string[];
69
- produces?: string[];
70
- }
71
- interface WorkflowContract {
72
- id: string;
73
- description?: string;
74
- consumes?: string[];
75
- produces?: string[];
76
- steps?: WorkflowStepContract[];
77
- }
78
- type WorkflowContractsMap = Record<string, WorkflowContract>;
79
-
80
- declare const contractsVersion = "1.0.0";
81
- declare const contractsSchemaId = "@kb-labs/mind-contracts/schema";
82
- type ContractsSchemaId = typeof contractsSchemaId;
83
-
84
- interface PluginContracts {
85
- schema: ContractsSchemaId;
86
- pluginId: string;
87
- contractsVersion: string;
88
- artifacts: ArtifactContractsMap;
89
- commands?: CommandContractsMap;
90
- workflows?: WorkflowContractsMap;
91
- api?: ApiContract;
92
- }
93
-
94
- declare const pluginContractsManifest: PluginContracts;
95
-
96
- export { type ApiContract as A, type CommandContract as C, type PluginArtifactContract as P, type RestApiContract as R, type SchemaReference as S, type WorkflowContract as W, type ArtifactContractsMap as a, type ArtifactExample as b, type ArtifactKind as c, type CommandContractsMap as d, type PluginContracts as e, type RestRouteContract as f, type WorkflowContractsMap as g, type WorkflowStepContract as h, contractsSchemaId as i, contractsVersion as j, pluginContractsManifest as p };
@@ -1 +0,0 @@
1
- export { p as pluginContractsManifest } from './contract-D29vlhme.js';
package/dist/contract.js DELETED
@@ -1,57 +0,0 @@
1
- // src/version.ts
2
- var contractsVersion = "1.0.0";
3
- var contractsSchemaId = "@kb-labs/mind-contracts/schema";
4
-
5
- // src/contract.ts
6
- var pluginContractsManifest = {
7
- schema: contractsSchemaId,
8
- pluginId: "@kb-labs/mind",
9
- contractsVersion,
10
- artifacts: {},
11
- commands: {
12
- "mind:init": {
13
- id: "mind:init",
14
- description: "Initialise the Mind workspace structure.",
15
- input: {
16
- ref: "@kb-labs/mind-contracts/schema#MindInitCommandInputSchema",
17
- format: "zod"
18
- },
19
- examples: ["kb mind init --force", "kb mind init --json"]
20
- },
21
- "mind:verify": {
22
- id: "mind:verify",
23
- description: "Validate Mind indexes and surface inconsistencies.",
24
- input: {
25
- ref: "@kb-labs/mind-contracts/schema#MindVerifyCommandInputSchema",
26
- format: "zod"
27
- },
28
- output: {
29
- ref: "@kb-labs/mind-contracts/schema#MindVerifyCommandOutputSchema",
30
- format: "zod"
31
- },
32
- examples: ["kb mind verify", "kb mind verify --json"]
33
- }
34
- },
35
- workflows: {},
36
- api: {
37
- rest: {
38
- basePath: "/v1/plugins/mind",
39
- routes: {
40
- "mind.rest.verify": {
41
- id: "mind.rest.verify",
42
- method: "GET",
43
- path: "/verify",
44
- description: "Summarise index verification status for Studio dashboards.",
45
- response: {
46
- ref: "@kb-labs/mind-contracts/schema#MindVerifyResponseSchema",
47
- format: "zod"
48
- }
49
- }
50
- }
51
- }
52
- }
53
- };
54
- export {
55
- pluginContractsManifest
56
- };
57
- //# sourceMappingURL=contract.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/version.ts","../src/contract.ts"],"sourcesContent":["export const contractsVersion = '1.0.0';\nexport const contractsSchemaId = '@kb-labs/mind-contracts/schema';\n\nexport type ContractsSchemaId = typeof contractsSchemaId;\n","import type { PluginContracts } from './types';\nimport { contractsSchemaId, contractsVersion } from './version';\n\nexport const pluginContractsManifest: PluginContracts = {\n schema: contractsSchemaId,\n pluginId: '@kb-labs/mind',\n contractsVersion,\n artifacts: {},\n commands: {\n 'mind:init': {\n id: 'mind:init',\n description: 'Initialise the Mind workspace structure.',\n input: {\n ref: '@kb-labs/mind-contracts/schema#MindInitCommandInputSchema',\n format: 'zod',\n },\n examples: ['kb mind init --force', 'kb mind init --json'],\n },\n 'mind:verify': {\n id: 'mind:verify',\n description: 'Validate Mind indexes and surface inconsistencies.',\n input: {\n ref: '@kb-labs/mind-contracts/schema#MindVerifyCommandInputSchema',\n format: 'zod',\n },\n output: {\n ref: '@kb-labs/mind-contracts/schema#MindVerifyCommandOutputSchema',\n format: 'zod',\n },\n examples: ['kb mind verify', 'kb mind verify --json'],\n },\n },\n workflows: {},\n api: {\n rest: {\n basePath: '/v1/plugins/mind',\n routes: {\n 'mind.rest.verify': {\n id: 'mind.rest.verify',\n method: 'GET',\n path: '/verify',\n description: 'Summarise index verification status for Studio dashboards.',\n response: {\n ref: '@kb-labs/mind-contracts/schema#MindVerifyResponseSchema',\n format: 'zod',\n },\n },\n },\n },\n },\n};\n"],"mappings":";AAAO,IAAM,mBAAmB;AACzB,IAAM,oBAAoB;;;ACE1B,IAAM,0BAA2C;AAAA,EACtD,QAAQ;AAAA,EACR,UAAU;AAAA,EACV;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,UAAU;AAAA,IACR,aAAa;AAAA,MACX,IAAI;AAAA,MACJ,aAAa;AAAA,MACb,OAAO;AAAA,QACL,KAAK;AAAA,QACL,QAAQ;AAAA,MACV;AAAA,MACA,UAAU,CAAC,wBAAwB,qBAAqB;AAAA,IAC1D;AAAA,IACA,eAAe;AAAA,MACb,IAAI;AAAA,MACJ,aAAa;AAAA,MACb,OAAO;AAAA,QACL,KAAK;AAAA,QACL,QAAQ;AAAA,MACV;AAAA,MACA,QAAQ;AAAA,QACN,KAAK;AAAA,QACL,QAAQ;AAAA,MACV;AAAA,MACA,UAAU,CAAC,kBAAkB,uBAAuB;AAAA,IACtD;AAAA,EACF;AAAA,EACA,WAAW,CAAC;AAAA,EACZ,KAAK;AAAA,IACH,MAAM;AAAA,MACJ,UAAU;AAAA,MACV,QAAQ;AAAA,QACN,oBAAoB;AAAA,UAClB,IAAI;AAAA,UACJ,QAAQ;AAAA,UACR,MAAM;AAAA,UACN,aAAa;AAAA,UACb,UAAU;AAAA,YACR,KAAK;AAAA,YACL,QAAQ;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}