@wildo-ai/wildo-cli 1.1.12 → 1.1.13
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/src/commands/config/sync.command.d.ts.map +1 -1
- package/dist/src/commands/config/sync.command.js +1 -0
- package/dist/src/commands/config/sync.command.js.map +1 -1
- package/dist/src/commands/context/journey.command.d.ts.map +1 -1
- package/dist/src/commands/context/journey.command.js +8 -0
- package/dist/src/commands/context/journey.command.js.map +1 -1
- package/dist/src/commands/creation/drive.command.d.ts.map +1 -1
- package/dist/src/commands/creation/drive.command.js +2 -0
- package/dist/src/commands/creation/drive.command.js.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
- package/dist/src/commands/fwk/publish-all.command.js +8 -0
- package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
- package/dist/src/commands/local/dev.command.d.ts +68 -0
- package/dist/src/commands/local/dev.command.d.ts.map +1 -1
- package/dist/src/commands/local/dev.command.js +216 -8
- package/dist/src/commands/local/dev.command.js.map +1 -1
- package/dist/src/commands/local/doctor.command.d.ts +22 -9
- package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
- package/dist/src/commands/local/doctor.command.js +45 -42
- package/dist/src/commands/local/doctor.command.js.map +1 -1
- package/dist/src/commands/providers/connect.command.d.ts.map +1 -1
- package/dist/src/commands/providers/connect.command.js +11 -1
- package/dist/src/commands/providers/connect.command.js.map +1 -1
- package/dist/src/commands/seal/currency.command.d.ts +13 -0
- package/dist/src/commands/seal/currency.command.d.ts.map +1 -0
- package/dist/src/commands/seal/currency.command.js +52 -0
- package/dist/src/commands/seal/currency.command.js.map +1 -0
- package/dist/src/commands/seal/seal-admin-door.utils.d.ts.map +1 -1
- package/dist/src/commands/seal/seal-admin-door.utils.js +2 -0
- package/dist/src/commands/seal/seal-admin-door.utils.js.map +1 -1
- package/dist/src/commands/seal/verify.command.d.ts +5 -0
- package/dist/src/commands/seal/verify.command.d.ts.map +1 -1
- package/dist/src/commands/seal/verify.command.js +26 -2
- package/dist/src/commands/seal/verify.command.js.map +1 -1
- package/dist/src/services/application/content-guardrail-classifier.service.d.ts +19 -0
- package/dist/src/services/application/content-guardrail-classifier.service.d.ts.map +1 -1
- package/dist/src/services/application/content-guardrail-classifier.service.js +75 -11
- package/dist/src/services/application/content-guardrail-classifier.service.js.map +1 -1
- package/dist/src/services/application/local-provider-doubles.service.d.ts +98 -0
- package/dist/src/services/application/local-provider-doubles.service.d.ts.map +1 -0
- package/dist/src/services/application/local-provider-doubles.service.js +214 -0
- package/dist/src/services/application/local-provider-doubles.service.js.map +1 -0
- package/dist/src/services/application/system-of-record-simulators.service.d.ts +21 -2
- package/dist/src/services/application/system-of-record-simulators.service.d.ts.map +1 -1
- package/dist/src/services/application/system-of-record-simulators.service.js +21 -12
- package/dist/src/services/application/system-of-record-simulators.service.js.map +1 -1
- package/dist/src/services/companion/creation-drive.service.d.ts +32 -2
- package/dist/src/services/companion/creation-drive.service.d.ts.map +1 -1
- package/dist/src/services/companion/creation-drive.service.js +61 -4
- package/dist/src/services/companion/creation-drive.service.js.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.d.ts +6 -0
- package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
- package/dist/src/services/credentials/credentials.schemas.js +7 -1
- package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
- package/dist/src/services/credentials/provider-env-vars.utils.js +11 -3
- package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.d.ts +9 -0
- package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
- package/dist/src/services/data-services/data-services.schemas.js +9 -0
- package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js +7 -2
- package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.js +22 -1
- package/dist/src/services/deployment/local-dev-session-lease.service.js.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-config.utils.js +1 -0
- package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
- package/dist/src/services/environment/authored-infra-member-authority.d.ts.map +1 -1
- package/dist/src/services/environment/authored-infra-member-authority.js +5 -0
- package/dist/src/services/environment/authored-infra-member-authority.js.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-configuration-generator.service.js +6 -3
- package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.d.ts +6 -0
- package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
- package/dist/src/services/environment/env-vars-builder.service.js +24 -1
- package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
- package/dist/src/services/environment/environment-hydration.utils.js +1 -0
- package/dist/src/services/environment/environment-hydration.utils.js.map +1 -1
- package/dist/src/services/environment/environment.schemas.d.ts +7 -1
- package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
- package/dist/src/services/environment/environment.schemas.js.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts +2 -0
- package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
- package/dist/src/services/environment/runtime-bootstrap.service.js +4 -0
- package/dist/src/services/environment/runtime-bootstrap.service.js.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.d.ts +13 -0
- package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
- package/dist/src/services/framework/framework-docker-publish.service.js +24 -7
- package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
- package/dist/src/services/registry/provider-connect.service.d.ts +57 -1
- package/dist/src/services/registry/provider-connect.service.d.ts.map +1 -1
- package/dist/src/services/registry/provider-connect.service.js +63 -2
- package/dist/src/services/registry/provider-connect.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/scripts/app-dependency-alignment/propagated-engine-overrides.json +1 -1
- package/wildo-framework.info.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.command.js","sourceRoot":"","sources":["../../../../src/commands/providers/connect.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,EAChC,wBAAwB,GAEzB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,2CAA2C,EAC3C,gCAAgC,GACjC,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG,OAAO,EAAE,mCAAmC,EAAE,yCAAyC,EAAE,MAAM,oEAAoE,CAAC;AAEpK,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,UAAU,GAAG,OAAO,CAAC;AAC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AAC,CAAC;YAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;YACrD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,EAAE,OAAO,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;CACF","sourcesContent":["import * as path from 'node:path';\n\nimport { input, password } from '@inquirer/prompts';\nimport { MODULE_BOUNDARY_LAYER_ROOTS, ProviderModuleFacet } from '@wildo-ai/platform-config-lib';\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { parseCsvFlag } from '~wildo-cli/kernel/flag-utils';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\nimport {\n PROVIDER_CONNECT_DEFAULT_PORT,\n PROVIDERS_REGISTRY_HOME,\n ProviderConnectRedirectHost,\n connectProviderOAuth2,\n connectProviderSlots,\n loadProviderConnectSubject,\n openInBrowser,\n providerConnectRunsOAuth2Consent,\n resolveProviderModuleDir,\n type ProviderConnectPrompts,\n} from '~wildo-cli/services/registry/provider-connect.service';\nimport {\n ProviderProbeCredentialStore,\n assertProviderProbeCredentialStoreIsIgnored,\n providerProbeCredentialStorePath,\n} from '~wildo-cli/services/registry/provider-probe-credentials.service';\nimport { readDeclaredProcessingRegions } from '~wildo-cli/services/registry/provider-probe.service';\nimport type { ApplicationProviderConnectionClient } from '~wildo-cli/services/registry/application-provider-connection.service';\nimport { APPLICATION_CONNECTION_TARGET_FLAGS, openApplicationConnectionSessionFromFlags } from '~wildo-cli/commands/providers/application-connection-session.utils';\n\nconst FLAG_MODULE = 'module';\nconst FLAG_PARAM = 'param';\nconst FLAG_PORT = 'port';\nconst FLAG_REDIRECT_HOST = 'redirect-host';\nconst FLAG_SLOTS = 'slots';\nconst FLAG_PROCESSING_REGION = 'processing-region';\nconst FLAG_APPLICATION = 'application';\nconst FLAG_SCOPES = 'scopes';\nconst FLAG_PRINT_URL = 'print-url';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_APPLICATION]: {\n type: 'boolean',\n description:\n 'Connect the RUNNING application\\'s own vendor account instead (#3579): sign in to it as its local administrator, start the '\n + 'connection with an application target, and open the vendor\\'s consent. The browser must be signed in to the application '\n + 'as the same administrator: the application completes the connection there and stores the grant itself. Run from the '\n + 'application root, or name a deployed one with --api-url. See `wildo providers connections --application` and '\n + '`wildo providers disconnect <ref> --application`.',\n default: false,\n },\n [FLAG_SCOPES]: {\n type: 'string[]',\n description: 'With --application: the scopes to request, a subset of those the provider declares. Default: all of them.',\n },\n [FLAG_PRINT_URL]: {\n type: 'boolean',\n description: 'With --application: do not open the consent URL in the default browser (it is always printed).',\n default: false,\n },\n ...APPLICATION_CONNECTION_TARGET_FLAGS,\n [FLAG_MODULE]: {\n type: 'string',\n description: 'The module directory (`providers-registry/<ref>` or an application\\'s `providers/<ref>`). Defaults to the framework checkout\\'s, then the current application\\'s.',\n },\n [FLAG_PARAM]: {\n type: 'string[]',\n description: 'A connection parameter the vendor\\'s sign-in needs, `name=value` (`--param subdomain=acme`). Asked for when absent.',\n },\n [FLAG_PORT]: {\n type: 'number',\n description: `The loopback port the consent returns to. Register \\`http://localhost:<port>/callback\\` at the vendor. Default ${PROVIDER_CONNECT_DEFAULT_PORT}.`,\n },\n [FLAG_REDIRECT_HOST]: {\n type: 'string',\n description: 'The redirect URI\\'s host: `localhost` (default, what most vendor consoles accept) or `127.0.0.1`.',\n },\n [FLAG_PROCESSING_REGION]: {\n type: 'string',\n description:\n 'The processing region an application would declare for this provider (`providerComplianceChoices.<ref>.processingRegion`). '\n + 'The module is bound to it as a host binds it at startup, so the consent and the stored host answers are that region\\'s: an endpoint region\\'s host, its account host answer, or its request parameter. '\n + 'A region the provider cannot be reached in is refused. Default: run from an application root, the region it declares '\n + '(a flag naming another is refused); elsewhere, the module as declared (its default host).',\n },\n [FLAG_SLOTS]: {\n type: 'string[]',\n description: 'For a module with no OAuth2 consent (or whose application connection mints its token from client credentials): the slots to type, by env var name or slug. Default: its credential and host slots.',\n },\n};\n\n/**\n * A variadic flag's values as given, NOT split on commas (`parseCsvFlag` would): a value may hold one (`--param\n * name=a,b`).\n */\nfunction flagValues(value: unknown): string[] {\n return (Array.isArray(value) ? value : value === undefined ? [] : [value]).filter((entry): entry is string => typeof entry === 'string');\n}\n\n/** `name=value` pairs, refused when one has no `=`. */\nfunction parseNameValuePairs(values: readonly string[], flag: string): Record<string, string> {\n const pairs: Record<string, string> = {};\n for (const entry of values) {\n const separator = entry.indexOf('=');\n if (separator <= 0) throw new Error(`--${flag} takes name=value; '${entry}' is not.`);\n pairs[entry.slice(0, separator)] = entry.slice(separator + 1);\n }\n return pairs;\n}\n\n/**\n * Obtains a provider module's credential for its live proof and keeps it in the local probe credential store (#2518).\n *\n * The person creates the vendor account and clicks the consent; everything else is this command. A secret is only\n * ever TYPED into a hidden prompt or returned by the vendor's token endpoint, is stored in a gitignored 0600 file, and is\n * never printed. See `provider-connect.service.ts` for the flow and `provider-probe-credentials.service.ts` for the store.\n */\nexport default class ProvidersConnectCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'providers connect',\n description:\n 'Obtain a provider module\\'s credential for `wildo providers probe`, or with --application connect the running application\\'s own account: run its OAuth2 consent from the terminal (a loopback '\n + 'redirect, the engine\\'s own authorize URL and code exchange), or, for an API-key or EXTENSION module, ask for its '\n + 'slots in a hidden prompt. Stores them in a local gitignored file (mode 0600) beside the module; never prints a secret. '\n + 'The environment still wins over the store.',\n category: CommandCategory.Core,\n args: [{ name: 'ref', description: 'Provider ref (`hubspot`).', required: true }],\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const ref = ctx.args.ref;\n if (!ref) {\n ctx.log.error('Which provider? `wildo providers connect <ref>`.');\n return { success: false };\n }\n if (ctx.flags[FLAG_APPLICATION] === true) return this.connectApplication(ctx, ref);\n const moduleDir = resolveProviderModuleDir({\n frameworkRoot: ctx.cliContext.resolvedHomes.framework.repositoryRoot,\n ref,\n explicit: ctx.flags[FLAG_MODULE] as string | undefined,\n });\n if (moduleDir === undefined) {\n ctx.log.error(`No provider module '${ref}': looked in the framework checkout's ${PROVIDERS_REGISTRY_HOME}/ and this application's ${MODULE_BOUNDARY_LAYER_ROOTS.providers}/. Pass --module <dir>.`);\n return { success: false };\n }\n\n const nonInteractive = ctx.globalFlags.nonInteractive;\n const refuseNonInteractive = (what: string): never => {\n throw new Error(`${what} is needed and --non-interactive is set. Export it, or run the command in a terminal.`);\n };\n const prompts: ProviderConnectPrompts = {\n visible: async (message, defaultValue) => nonInteractive\n ? (defaultValue ?? refuseNonInteractive(message))\n : await input({ message, ...(defaultValue === undefined ? {} : { default: defaultValue }) }),\n // No mask: nothing is echoed, not even its length.\n // A secret is typed by a PERSON at a terminal (secret policy A). Piped stdin (a script, an agent) is refused, naming\n // the environment variable to export instead, so a value can never be fed in by something reading the screen (F5).\n hidden: async (message) => {\n if (nonInteractive) return refuseNonInteractive(message);\n if (process.stdin.isTTY !== true) throw new Error(`${message} must be typed at a terminal; stdin is not one. Export it in the environment instead.`);\n return await password({ message });\n },\n proceed: async (message) => {\n if (!nonInteractive) await input({ message });\n },\n };\n\n try {\n const storePath = providerProbeCredentialStorePath(moduleDir);\n const ignored = assertProviderProbeCredentialStoreIsIgnored(storePath);\n if (ignored.note !== undefined) ctx.log.warn(ignored.note);\n const store = new ProviderProbeCredentialStore(storePath);\n // Refuses a store others can read before anything is asked.\n store.read();\n\n const processingRegion = ctx.flags[FLAG_PROCESSING_REGION] as string | undefined;\n const declaredProcessingRegions = await readDeclaredProcessingRegions(process.cwd());\n const subject = await loadProviderConnectSubject(path.join(moduleDir, ProviderModuleFacet.BACKEND), {\n ...(processingRegion === undefined ? {} : { processingRegion }),\n ...(declaredProcessingRegions === undefined ? {} : { declaredProcessingRegions }),\n });\n const via = subject.probed.augments === undefined ? '' : ` through ${subject.probed.augments}'s OAuth2 client`;\n ctx.log.info(chalk.bold(`${ref}${via} — ${path.relative(process.cwd(), moduleDir) || '.'}`));\n\n if (subject.contract?.oauth2 !== undefined && !providerConnectRunsOAuth2Consent(subject)) {\n ctx.log.info('Its application connection mints a token from the server app\\'s client credentials, so no consent is run: type those slots.');\n }\n if (providerConnectRunsOAuth2Consent(subject)) {\n const redirectHost = (ctx.flags[FLAG_REDIRECT_HOST] as string | undefined) ?? ProviderConnectRedirectHost.LOCALHOST;\n if (!Object.values<string>(ProviderConnectRedirectHost).includes(redirectHost)) {\n ctx.log.error(`--redirect-host is ${Object.values(ProviderConnectRedirectHost).join(' or ')}.`);\n return { success: false };\n }\n const result = await connectProviderOAuth2({\n moduleRef: ref,\n subject,\n store,\n prompts,\n parameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n port: (ctx.flags[FLAG_PORT] as number | undefined) ?? PROVIDER_CONNECT_DEFAULT_PORT,\n redirectHost: redirectHost as ProviderConnectRedirectHost,\n openAuthorizeUrl: openInBrowser,\n report: (line) => ctx.log.info(line),\n });\n ctx.log.success(`Connected. Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n if (result.accountRef !== undefined) ctx.log.info(`Account: ${result.accountRef}`);\n ctx.log.info(`Granted (${result.grantedScopes.length}): ${result.grantedScopes.join(' ') || '(the vendor reported none)'}`);\n if (result.missingScopes.length > 0) ctx.log.warn(`Requested and not reported as granted: ${result.missingScopes.join(' ')}. An operation needing one may be refused.`);\n ctx.log.info(result.refreshable\n ? `The token renews itself when a probe finds it expired${result.accessTokenExpiresAt === undefined ? '' : ` (it expires ${result.accessTokenExpiresAt})`}.`\n : `The vendor issued no refresh token${result.accessTokenExpiresAt === undefined ? '' : `; the token expires ${result.accessTokenExpiresAt}, then connect again`}.`);\n return { success: true };\n }\n\n const result = await connectProviderSlots({\n moduleRef: ref,\n subject,\n store,\n prompts,\n ...(parseCsvFlag(ctx.flags[FLAG_SLOTS]) === undefined ? {} : { chosen: parseCsvFlag(ctx.flags[FLAG_SLOTS])! }),\n report: (line) => ctx.log.warn(line),\n });\n if (result.fromEnvironment.length > 0) ctx.log.info(`Already set in the environment (which wins over the store): ${result.fromEnvironment.join(', ')}.`);\n if (result.storedNames.length === 0) {\n ctx.log.warn('Nothing was stored.');\n return { success: result.fromEnvironment.length > 0 };\n }\n ctx.log.success(`Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n }\n }\n\n /**\n * `--application` (#3579): the running application connects its OWN vendor account. Nothing is stored locally and no\n * token reaches the terminal; see `application-provider-connection.service.ts`.\n */\n private async connectApplication(ctx: CommandContext, ref: string): Promise<CommandResult> {\n let session: ApplicationProviderConnectionClient | undefined;\n try {\n session = await openApplicationConnectionSessionFromFlags(ctx);\n const scopes = parseCsvFlag(ctx.flags[FLAG_SCOPES]);\n const authorizeUrl = await session.startConnection(ref, {\n ...(scopes === undefined ? {} : { scopes }),\n connectionParameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n });\n // Always printed: the opener does nothing on Windows and can fail silently on a headless machine.\n ctx.log.info(`Consent at the vendor:\\n${authorizeUrl}`);\n if (ctx.flags[FLAG_PRINT_URL] !== true) openInBrowser(authorizeUrl);\n ctx.log.success(`Started connecting the application's own '${ref}' account, signed in as ${session.email ?? 'the local administrator'}.`);\n ctx.log.info(\n `Consent at the vendor in a browser signed in to ${session.frontendUrl} as that same administrator: the application completes the connection there `\n + 'and stores the grant. The attempt expires after ten minutes.',\n );\n ctx.log.info('Then check it: `wildo providers connections --application`.');\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n } finally {\n await session?.signOut();\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"connect.command.js","sourceRoot":"","sources":["../../../../src/commands/providers/connect.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EACL,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,gCAAgC,EAChC,wBAAwB,GAEzB,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,4BAA4B,EAC5B,2CAA2C,EAC3C,gCAAgC,GACjC,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qDAAqD,CAAC;AAEpG,OAAO,EAAE,mCAAmC,EAAE,yCAAyC,EAAE,MAAM,oEAAoE,CAAC;AAEpK,MAAM,WAAW,GAAG,QAAQ,CAAC;AAC7B,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAC3C,MAAM,UAAU,GAAG,OAAO,CAAC;AAC3B,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,gBAAgB,GAAG,aAAa,C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BAAE,aAAa,CAAC,YAAY,CAAC,CAAC;YACpE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,6CAA6C,GAAG,2BAA2B,OAAO,CAAC,KAAK,IAAI,yBAAyB,GAAG,CAAC,CAAC;YAC1I,GAAG,CAAC,GAAG,CAAC,IAAI,CACV,mDAAmD,OAAO,CAAC,WAAW,8EAA8E;kBAClJ,8DAA8D,CACjE,CAAC;YACF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;YAC5E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;YACrD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;gBAAS,CAAC;YACT,MAAM,OAAO,EAAE,OAAO,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;CACF","sourcesContent":["import * as path from 'node:path';\n\nimport { input, password } from '@inquirer/prompts';\nimport { MODULE_BOUNDARY_LAYER_ROOTS, ProviderModuleFacet } from '@wildo-ai/platform-config-lib';\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { parseCsvFlag } from '~wildo-cli/kernel/flag-utils';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\nimport {\n PROVIDER_CONNECT_DEFAULT_PORT,\n PROVIDERS_REGISTRY_HOME,\n ProviderConnectRedirectHost,\n connectProviderOAuth2,\n connectProviderSlots,\n loadProviderConnectSubject,\n openInBrowser,\n providerConnectRunsOAuth2Consent,\n resolveProviderModuleDir,\n type ProviderConnectPrompts,\n} from '~wildo-cli/services/registry/provider-connect.service';\nimport {\n ProviderProbeCredentialStore,\n assertProviderProbeCredentialStoreIsIgnored,\n providerProbeCredentialStorePath,\n} from '~wildo-cli/services/registry/provider-probe-credentials.service';\nimport { readDeclaredProcessingRegions } from '~wildo-cli/services/registry/provider-probe.service';\nimport type { ApplicationProviderConnectionClient } from '~wildo-cli/services/registry/application-provider-connection.service';\nimport { APPLICATION_CONNECTION_TARGET_FLAGS, openApplicationConnectionSessionFromFlags } from '~wildo-cli/commands/providers/application-connection-session.utils';\n\nconst FLAG_MODULE = 'module';\nconst FLAG_PARAM = 'param';\nconst FLAG_PORT = 'port';\nconst FLAG_REDIRECT_HOST = 'redirect-host';\nconst FLAG_SLOTS = 'slots';\nconst FLAG_PROCESSING_REGION = 'processing-region';\nconst FLAG_APPLICATION = 'application';\nconst FLAG_SCOPES = 'scopes';\nconst FLAG_PRINT_URL = 'print-url';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_APPLICATION]: {\n type: 'boolean',\n description:\n 'Connect the RUNNING application\\'s own vendor account instead (#3579): sign in to it as its local administrator, start the '\n + 'connection with an application target, and open the vendor\\'s consent. The browser must be signed in to the application '\n + 'as the same administrator: the application completes the connection there and stores the grant itself. Run from the '\n + 'application root, or name a deployed one with --api-url. See `wildo providers connections --application` and '\n + '`wildo providers disconnect <ref> --application`.',\n default: false,\n },\n [FLAG_SCOPES]: {\n type: 'string[]',\n description: 'With --application: the scopes to request, a subset of those the provider declares. Default: all of them.',\n },\n [FLAG_PRINT_URL]: {\n type: 'boolean',\n description: 'With --application: do not open the consent URL in the default browser (it is always printed).',\n default: false,\n },\n ...APPLICATION_CONNECTION_TARGET_FLAGS,\n [FLAG_MODULE]: {\n type: 'string',\n description: 'The module directory (`providers-registry/<ref>` or an application\\'s `providers/<ref>`). Defaults to the framework checkout\\'s, then the current application\\'s.',\n },\n [FLAG_PARAM]: {\n type: 'string[]',\n description: 'A connection parameter the vendor\\'s sign-in needs, `name=value` (`--param subdomain=acme`). Asked for when absent.',\n },\n [FLAG_PORT]: {\n type: 'number',\n description: `The loopback port the consent returns to. Register \\`http://localhost:<port>/callback\\` at the vendor. Default ${PROVIDER_CONNECT_DEFAULT_PORT}.`,\n },\n [FLAG_REDIRECT_HOST]: {\n type: 'string',\n description: 'The redirect URI\\'s host: `localhost` (default, what most vendor consoles accept) or `127.0.0.1`.',\n },\n [FLAG_PROCESSING_REGION]: {\n type: 'string',\n description:\n 'The processing region an application would declare for this provider (`providerComplianceChoices.<ref>.processingRegion`). '\n + 'The module is bound to it as a host binds it at startup, so the consent and the stored host answers are that region\\'s: an endpoint region\\'s host, its account host answer, or its request parameter. '\n + 'A region the provider cannot be reached in is refused. Default: run from an application root, the region it declares '\n + '(a flag naming another is refused); elsewhere, the module as declared (its default host).',\n },\n [FLAG_SLOTS]: {\n type: 'string[]',\n description: 'For a module with no OAuth2 consent (or whose application connection mints its token from client credentials): the slots to type, by env var name or slug. Default: its credential and host slots.',\n },\n};\n\n/**\n * A variadic flag's values as given, NOT split on commas (`parseCsvFlag` would): a value may hold one (`--param\n * name=a,b`).\n */\nfunction flagValues(value: unknown): string[] {\n return (Array.isArray(value) ? value : value === undefined ? [] : [value]).filter((entry): entry is string => typeof entry === 'string');\n}\n\n/** `name=value` pairs, refused when one has no `=`. */\nfunction parseNameValuePairs(values: readonly string[], flag: string): Record<string, string> {\n const pairs: Record<string, string> = {};\n for (const entry of values) {\n const separator = entry.indexOf('=');\n if (separator <= 0) throw new Error(`--${flag} takes name=value; '${entry}' is not.`);\n pairs[entry.slice(0, separator)] = entry.slice(separator + 1);\n }\n return pairs;\n}\n\n/**\n * Obtains a provider module's credential for its live proof and keeps it in the local probe credential store (#2518).\n *\n * The person creates the vendor account and clicks the consent; everything else is this command. A secret is only\n * ever TYPED into a hidden prompt or returned by the vendor's token endpoint, is stored in a gitignored 0600 file, and is\n * never printed. See `provider-connect.service.ts` for the flow and `provider-probe-credentials.service.ts` for the store.\n */\nexport default class ProvidersConnectCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'providers connect',\n description:\n 'Obtain a provider module\\'s credential for `wildo providers probe`, or with --application connect the running application\\'s own account: run its OAuth2 consent from the terminal (a loopback '\n + 'redirect, the engine\\'s own authorize URL and code exchange), or, for an API-key or EXTENSION module, ask for its '\n + 'slots in a hidden prompt. Stores them in a local gitignored file (mode 0600) beside the module; never prints a secret. '\n + 'The environment still wins over the store.',\n category: CommandCategory.Core,\n args: [{ name: 'ref', description: 'Provider ref (`hubspot`).', required: true }],\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const ref = ctx.args.ref;\n if (!ref) {\n ctx.log.error('Which provider? `wildo providers connect <ref>`.');\n return { success: false };\n }\n if (ctx.flags[FLAG_APPLICATION] === true) return this.connectApplication(ctx, ref);\n const moduleDir = resolveProviderModuleDir({\n frameworkRoot: ctx.cliContext.resolvedHomes.framework.repositoryRoot,\n ref,\n explicit: ctx.flags[FLAG_MODULE] as string | undefined,\n });\n if (moduleDir === undefined) {\n ctx.log.error(`No provider module '${ref}': looked in the framework checkout's ${PROVIDERS_REGISTRY_HOME}/ and this application's ${MODULE_BOUNDARY_LAYER_ROOTS.providers}/. Pass --module <dir>.`);\n return { success: false };\n }\n\n const nonInteractive = ctx.globalFlags.nonInteractive;\n const refuseNonInteractive = (what: string): never => {\n throw new Error(`${what} is needed and --non-interactive is set. Export it, or run the command in a terminal.`);\n };\n const prompts: ProviderConnectPrompts = {\n visible: async (message, defaultValue) => nonInteractive\n ? (defaultValue ?? refuseNonInteractive(message))\n : await input({ message, ...(defaultValue === undefined ? {} : { default: defaultValue }) }),\n // No mask: nothing is echoed, not even its length.\n // A secret is typed by a PERSON at a terminal (secret policy A). Piped stdin (a script, an agent) is refused, naming\n // the environment variable to export instead, so a value can never be fed in by something reading the screen (F5).\n hidden: async (message) => {\n if (nonInteractive) return refuseNonInteractive(message);\n if (process.stdin.isTTY !== true) throw new Error(`${message} must be typed at a terminal; stdin is not one. Export it in the environment instead.`);\n return await password({ message });\n },\n proceed: async (message) => {\n if (!nonInteractive) await input({ message });\n },\n };\n\n try {\n const storePath = providerProbeCredentialStorePath(moduleDir);\n const ignored = assertProviderProbeCredentialStoreIsIgnored(storePath);\n if (ignored.note !== undefined) ctx.log.warn(ignored.note);\n const store = new ProviderProbeCredentialStore(storePath);\n // Refuses a store others can read before anything is asked.\n store.read();\n\n const processingRegion = ctx.flags[FLAG_PROCESSING_REGION] as string | undefined;\n const declaredProcessingRegions = await readDeclaredProcessingRegions(process.cwd());\n const subject = await loadProviderConnectSubject(path.join(moduleDir, ProviderModuleFacet.BACKEND), {\n ...(processingRegion === undefined ? {} : { processingRegion }),\n ...(declaredProcessingRegions === undefined ? {} : { declaredProcessingRegions }),\n });\n const via = subject.probed.augments === undefined ? '' : ` through ${subject.probed.augments}'s OAuth2 client`;\n ctx.log.info(chalk.bold(`${ref}${via} — ${path.relative(process.cwd(), moduleDir) || '.'}`));\n\n if (subject.contract?.oauth2 !== undefined && !providerConnectRunsOAuth2Consent(subject)) {\n ctx.log.info('Its application connection mints a token from the server app\\'s client credentials, so no consent is run: type those slots.');\n }\n if (providerConnectRunsOAuth2Consent(subject)) {\n const redirectHost = (ctx.flags[FLAG_REDIRECT_HOST] as string | undefined) ?? ProviderConnectRedirectHost.LOCALHOST;\n if (!Object.values<string>(ProviderConnectRedirectHost).includes(redirectHost)) {\n ctx.log.error(`--redirect-host is ${Object.values(ProviderConnectRedirectHost).join(' or ')}.`);\n return { success: false };\n }\n const result = await connectProviderOAuth2({\n moduleRef: ref,\n subject,\n store,\n prompts,\n parameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n port: (ctx.flags[FLAG_PORT] as number | undefined) ?? PROVIDER_CONNECT_DEFAULT_PORT,\n redirectHost: redirectHost as ProviderConnectRedirectHost,\n openAuthorizeUrl: openInBrowser,\n report: (line) => ctx.log.info(line),\n });\n ctx.log.success(`Connected. Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n if (result.accountRef !== undefined) ctx.log.info(`Account: ${result.accountRef}`);\n ctx.log.info(`Granted to '${ref}' (${result.grantedScopes.length}): ${result.grantedScopes.join(' ') || '(the vendor reported none)'}`);\n // The store keys a grant by MODULE ref, so an augmentation's consent never replaces its base's or a sibling's: each\n // keeps its own token, read by `probe <ref>`. Said here because the line above was read as the base's whole grant.\n if (subject.probed.augments !== undefined) {\n ctx.log.info(`This grant is '${ref}'s own record. Other modules connected through ${subject.probed.augments}'s client keep theirs; \\`providers probe ${ref}\\` reads this one.`);\n }\n if (result.missingScopes.length > 0) ctx.log.warn(`Requested and not reported as granted: ${result.missingScopes.join(' ')}. An operation needing one may be refused.`);\n // Static consent grants what the app registration lists, so these are the registration's gaps (or a granted answer\n // spelled differently from the operation's declaration, which an application's scope check would refuse too).\n if (result.staticConsentScopesNotGranted.length > 0) {\n ctx.log.warn(`Needed by an operation, registered for static consent, and not reported as granted: ${result.staticConsentScopesNotGranted.join(' ')}. Add them to the app registration (with admin consent where required) and connect again.`);\n }\n ctx.log.info(result.refreshable\n ? `The token renews itself when a probe finds it expired${result.accessTokenExpiresAt === undefined ? '' : ` (it expires ${result.accessTokenExpiresAt})`}.`\n : `The vendor issued no refresh token${result.accessTokenExpiresAt === undefined ? '' : `; the token expires ${result.accessTokenExpiresAt}, then connect again`}.`);\n return { success: true };\n }\n\n const result = await connectProviderSlots({\n moduleRef: ref,\n subject,\n store,\n prompts,\n ...(parseCsvFlag(ctx.flags[FLAG_SLOTS]) === undefined ? {} : { chosen: parseCsvFlag(ctx.flags[FLAG_SLOTS])! }),\n report: (line) => ctx.log.warn(line),\n });\n if (result.fromEnvironment.length > 0) ctx.log.info(`Already set in the environment (which wins over the store): ${result.fromEnvironment.join(', ')}.`);\n if (result.storedNames.length === 0) {\n ctx.log.warn('Nothing was stored.');\n return { success: result.fromEnvironment.length > 0 };\n }\n ctx.log.success(`Stored in ${storePath}: ${result.storedNames.join(', ')}.`);\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n }\n }\n\n /**\n * `--application` (#3579): the running application connects its OWN vendor account. Nothing is stored locally and no\n * token reaches the terminal; see `application-provider-connection.service.ts`.\n */\n private async connectApplication(ctx: CommandContext, ref: string): Promise<CommandResult> {\n let session: ApplicationProviderConnectionClient | undefined;\n try {\n session = await openApplicationConnectionSessionFromFlags(ctx);\n const scopes = parseCsvFlag(ctx.flags[FLAG_SCOPES]);\n const authorizeUrl = await session.startConnection(ref, {\n ...(scopes === undefined ? {} : { scopes }),\n connectionParameters: parseNameValuePairs(flagValues(ctx.flags[FLAG_PARAM]), FLAG_PARAM),\n });\n // Always printed: the opener does nothing on Windows and can fail silently on a headless machine.\n ctx.log.info(`Consent at the vendor:\\n${authorizeUrl}`);\n if (ctx.flags[FLAG_PRINT_URL] !== true) openInBrowser(authorizeUrl);\n ctx.log.success(`Started connecting the application's own '${ref}' account, signed in as ${session.email ?? 'the local administrator'}.`);\n ctx.log.info(\n `Consent at the vendor in a browser signed in to ${session.frontendUrl} as that same administrator: the application completes the connection there `\n + 'and stores the grant. The attempt expires after ten minutes.',\n );\n ctx.log.info('Then check it: `wildo providers connections --application`.');\n return { success: true };\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n return { success: false };\n } finally {\n await session?.signOut();\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseCommand } from '../../kernel/base-command';
|
|
2
|
+
import type { CommandMeta, CommandContext, CommandResult } from '../../kernel/types';
|
|
3
|
+
/**
|
|
4
|
+
* `wildo seal currency <sealId>` — whether one approval is still CURRENT over the record it is about (#2914), asked of the
|
|
5
|
+
* locally-running application: the values of the fields the approval covers (its tool's `sealedRecordFields`), as the
|
|
6
|
+
* seal's presentation carries them, against the record as it is now. Exits 0 only when CURRENT, so a script can gate on
|
|
7
|
+
* it. Names which fields moved, never a value.
|
|
8
|
+
*/
|
|
9
|
+
export default class SealCurrencyCommand extends BaseCommand {
|
|
10
|
+
readonly meta: CommandMeta;
|
|
11
|
+
run(ctx: CommandContext): Promise<CommandResult>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=currency.command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/currency.command.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG1F;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,WAAW;IAC1D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAQxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAsBvD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { ApprovalSealsAdminEndpointPath } from '@wildo-ai/saas-backend-lib';
|
|
3
|
+
import { ApprovalSealSubjectCurrency, HttpMethod, HumanDecision_PresentedFieldCurrency } from '@wildo-ai/saas-models';
|
|
4
|
+
import { BaseCommand } from '../../kernel/base-command.js';
|
|
5
|
+
import { JsonDocumentLayout, writeJsonDocument } from '../../kernel/json-document-output.js';
|
|
6
|
+
import { CommandCategory } from '../../kernel/types.js';
|
|
7
|
+
import { callApprovalSealDoor } from './seal-admin-door.utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* `wildo seal currency <sealId>` — whether one approval is still CURRENT over the record it is about (#2914), asked of the
|
|
10
|
+
* locally-running application: the values of the fields the approval covers (its tool's `sealedRecordFields`), as the
|
|
11
|
+
* seal's presentation carries them, against the record as it is now. Exits 0 only when CURRENT, so a script can gate on
|
|
12
|
+
* it. Names which fields moved, never a value.
|
|
13
|
+
*/
|
|
14
|
+
export default class SealCurrencyCommand extends BaseCommand {
|
|
15
|
+
meta = {
|
|
16
|
+
name: 'seal currency',
|
|
17
|
+
description: 'Whether one approval seal of the locally-running application is still current over the record it is about (exit 0 only when current).',
|
|
18
|
+
category: CommandCategory.Local,
|
|
19
|
+
args: [{ name: 'sealId', description: 'The seal\'s id (a record that stores its approval names it, e.g. a close\'s signOffApprovalSealId).', required: true }],
|
|
20
|
+
flags: {
|
|
21
|
+
json: { type: 'boolean', description: 'Print the answer as JSON.' },
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
async run(ctx) {
|
|
25
|
+
const sealId = ctx.args.sealId;
|
|
26
|
+
if (!sealId) {
|
|
27
|
+
ctx.log.error('Missing required <sealId> argument.');
|
|
28
|
+
return { success: false };
|
|
29
|
+
}
|
|
30
|
+
const body = await callApprovalSealDoor(ctx, 'currency', { method: HttpMethod.POST, path: ApprovalSealsAdminEndpointPath.CURRENCY, body: { sealId } });
|
|
31
|
+
if (!body)
|
|
32
|
+
return { success: false };
|
|
33
|
+
const result = body;
|
|
34
|
+
const current = result.standing === ApprovalSealSubjectCurrency.CURRENT;
|
|
35
|
+
if (ctx.flags.json === true) {
|
|
36
|
+
writeJsonDocument(result, JsonDocumentLayout.INDENTED);
|
|
37
|
+
return { success: current };
|
|
38
|
+
}
|
|
39
|
+
const record = result.subject ? `${result.subject.resourceType}/${result.subject.resourceId}` : 'its record';
|
|
40
|
+
const moved = (result.fields ?? []).filter((field) => field.currency !== HumanDecision_PresentedFieldCurrency.CURRENT).map((field) => `${field.key} ${field.currency}`);
|
|
41
|
+
if (current)
|
|
42
|
+
ctx.log.info(`${chalk.green('CURRENT')} — every value ${result.sealId} approved still holds on ${record}.`);
|
|
43
|
+
else if (result.standing === ApprovalSealSubjectCurrency.NO_LONGER_CURRENT)
|
|
44
|
+
ctx.log.info(`${chalk.yellow('NO LONGER CURRENT')} — ${record} changed since ${result.sealId}: ${moved.join(', ')}.`);
|
|
45
|
+
else if (result.standing === ApprovalSealSubjectCurrency.SUBJECT_GONE)
|
|
46
|
+
ctx.log.info(`${chalk.yellow('SUBJECT GONE')} — ${record}, which ${result.sealId} approved, cannot be found.`);
|
|
47
|
+
else
|
|
48
|
+
ctx.log.info(`${chalk.dim('NO SEALED FIELD SET')} — ${result.sealId} covers no record field: its tool declares no sealedRecordFields, or its presentation is not available.`);
|
|
49
|
+
return { success: current };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=currency.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.command.js","sourceRoot":"","sources":["../../../../src/commands/seal/currency.command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,8BAA8B,EAAmC,MAAM,4BAA4B,CAAC;AAC7G,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,oCAAoC,EAAE,MAAM,uBAAuB,CAAC;AAEtH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,WAAW;IACjD,IAAI,GAAgB;QAC3B,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,uIAAuI;QACpJ,QAAQ,EAAE,eAAe,CAAC,KAAK;QAC/B,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qGAAqG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC9J,KAAK,EAAE;YACL,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,2BAA2B,EAAE;SACpE;KACF,CAAC;IAEF,KAAK,CAAC,GAAG,CAAC,GAAmB;QAC3B,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,CAAC,CAAC;QACxK,IAAI,OAAO;YAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,kBAAkB,MAAM,CAAC,MAAM,4BAA4B,MAAM,GAAG,CAAC,CAAC;aACpH,IAAI,MAAM,CAAC,QAAQ,KAAK,2BAA2B,CAAC,iBAAiB;YAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,MAAM,kBAAkB,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAC7L,IAAI,MAAM,CAAC,QAAQ,KAAK,2BAA2B,CAAC,YAAY;YAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,MAAM,WAAW,MAAM,CAAC,MAAM,6BAA6B,CAAC,CAAC;;YACjL,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,MAAM,MAAM,CAAC,MAAM,yGAAyG,CAAC,CAAC;QACnL,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC9B,CAAC;CACF","sourcesContent":["import chalk from 'chalk';\nimport { ApprovalSealsAdminEndpointPath, type ApprovalSealCurrencyResult } from '@wildo-ai/saas-backend-lib';\nimport { ApprovalSealSubjectCurrency, HttpMethod, HumanDecision_PresentedFieldCurrency } from '@wildo-ai/saas-models';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { JsonDocumentLayout, writeJsonDocument } from '~wildo-cli/kernel/json-document-output';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { callApprovalSealDoor } from './seal-admin-door.utils';\n\n/**\n * `wildo seal currency <sealId>` — whether one approval is still CURRENT over the record it is about (#2914), asked of the\n * locally-running application: the values of the fields the approval covers (its tool's `sealedRecordFields`), as the\n * seal's presentation carries them, against the record as it is now. Exits 0 only when CURRENT, so a script can gate on\n * it. Names which fields moved, never a value.\n */\nexport default class SealCurrencyCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'seal currency',\n description: 'Whether one approval seal of the locally-running application is still current over the record it is about (exit 0 only when current).',\n category: CommandCategory.Local,\n args: [{ name: 'sealId', description: 'The seal\\'s id (a record that stores its approval names it, e.g. a close\\'s signOffApprovalSealId).', required: true }],\n flags: {\n json: { type: 'boolean', description: 'Print the answer as JSON.' },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const sealId = ctx.args.sealId;\n if (!sealId) {\n ctx.log.error('Missing required <sealId> argument.');\n return { success: false };\n }\n const body = await callApprovalSealDoor(ctx, 'currency', { method: HttpMethod.POST, path: ApprovalSealsAdminEndpointPath.CURRENCY, body: { sealId } });\n if (!body) return { success: false };\n const result = body as unknown as ApprovalSealCurrencyResult;\n const current = result.standing === ApprovalSealSubjectCurrency.CURRENT;\n if (ctx.flags.json === true) {\n writeJsonDocument(result, JsonDocumentLayout.INDENTED);\n return { success: current };\n }\n const record = result.subject ? `${result.subject.resourceType}/${result.subject.resourceId}` : 'its record';\n const moved = (result.fields ?? []).filter((field) => field.currency !== HumanDecision_PresentedFieldCurrency.CURRENT).map((field) => `${field.key} ${field.currency}`);\n if (current) ctx.log.info(`${chalk.green('CURRENT')} — every value ${result.sealId} approved still holds on ${record}.`);\n else if (result.standing === ApprovalSealSubjectCurrency.NO_LONGER_CURRENT) ctx.log.info(`${chalk.yellow('NO LONGER CURRENT')} — ${record} changed since ${result.sealId}: ${moved.join(', ')}.`);\n else if (result.standing === ApprovalSealSubjectCurrency.SUBJECT_GONE) ctx.log.info(`${chalk.yellow('SUBJECT GONE')} — ${record}, which ${result.sealId} approved, cannot be found.`);\n else ctx.log.info(`${chalk.dim('NO SEALED FIELD SET')} — ${result.sealId} covers no record field: its tool declares no sealedRecordFields, or its presentation is not available.`);\n return { success: current };\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seal-admin-door.utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/seal-admin-door.utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"seal-admin-door.utils.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/seal-admin-door.utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AA4B9D;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAC7H,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CA8CzC"}
|
|
@@ -21,6 +21,8 @@ function describeRefusal(status, verb) {
|
|
|
21
21
|
return 'the admin secret was refused: the stored secret and the running backend\'s differ — restart the backend after `wildo config sync`.';
|
|
22
22
|
if (status === 404)
|
|
23
23
|
return 'no approval seal has that id.';
|
|
24
|
+
if (status === 409 && verb === 'currency')
|
|
25
|
+
return 'the seal\'s presentation file is unreadable or not the one its row recorded (see the body).';
|
|
24
26
|
if (status === 409) {
|
|
25
27
|
return verb === 'export'
|
|
26
28
|
? 'that seal cannot be exported: it is not SEALED yet, its key record is not held, or its presentation file is missing or not the one its row recorded (see the body).'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seal-admin-door.utils.js","sourceRoot":"","sources":["../../../../src/commands/seal/seal-admin-door.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,mCAAmC,EAAE,uCAAuC,EAAE,MAAM,4BAA4B,CAAC;AAG1H,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,uGAAuG;AACvG,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC,sDAAsD;AACtD,SAAS,eAAe,CAAC,MAAc,EAAE,IAAY;IACnD,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC1B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,sJAAsJ,CAAC;QAClL,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,4KAA4K,CAAC;IAC1M,CAAC;IACD,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,gHAAgH,CAAC;IAC5I,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,oIAAoI,CAAC;IAChK,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,+BAA+B,CAAC;IAC3D,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,IAAI,KAAK,QAAQ;YACtB,CAAC,CAAC,qKAAqK;YACvK,CAAC,CAAC,8GAA8G,CAAC;IACrH,CAAC;IACD,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,oDAAoD,CAAC;IAChF,OAAO,oDAAoD,CAAC;AAC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I,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,GAAG,aAAa,QAAQ,CAAC,MAAM,wDAAwD,CAAC,CAAC;QACjJ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import chalk from 'chalk';\nimport { WildoLocationType } from '@wildo-ai/platform-config-lib';\nimport { HttpMethod } from '@wildo-ai/saas-models';\nimport { ApprovalSealsAdminEndpointHeaderKey, ApprovalSealsAdminEndpointMountBasePath } from '@wildo-ai/saas-backend-lib';\n\nimport type { CommandContext } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { resolveBackendBaseUrl } from '../context/pipelines.command';\n\n/** A seal door call is one small read or one re-drive; a backend slower than this is not answering. */\nconst SEAL_DOOR_TIMEOUT_MS = 30_000;\n\n/** What a refusal of the approval-seal door means. */\nfunction describeRefusal(status: number, verb: string): string {\n if (verb === 'log-export') {\n if (status === 503) return 'the backend has no admin secret configured (APPLICATION_ADMIN_SECRET), or the custodian cannot sign yet (see the code in the body); ask again later.';\n if (status === 409) return 'the custodian refused the export (see the code in the body: an unpinned export key, a range past the head), or the application does not hold the export key\\'s record yet.';\n }\n if (status === 503) return 'the backend has no admin secret configured (APPLICATION_ADMIN_SECRET): run `wildo config sync` and restart it.';\n if (status === 401) return 'the admin secret was refused: the stored secret and the running backend\\'s differ — restart the backend after `wildo config sync`.';\n if (status === 404) return 'no approval seal has that id.';\n if (status === 409) {\n return verb === 'export'\n ? 'that seal cannot be exported: it is not SEALED yet, its key record is not held, or its presentation file is missing or not the one its row recorded (see the body).'\n : 'that seal is not DEAD: only a DEAD seal is re-driven (a PENDING one is the relay\\'s, a SEALED one is final).';\n }\n if (status === 400) return 'the request was refused as invalid (see the body).';\n return 'the backend answered with an error (see the body).';\n}\n\n/**\n * Call the running application backend's approval-seal operator door (#2903) with the active LOCAL environment's admin\n * secret, the one the backend receives as `APPLICATION_ADMIN_SECRET`. Answers the JSON body, or null after logging why\n * nothing was read, never an empty answer standing for a failure.\n */\nexport async function callApprovalSealDoor(\n ctx: CommandContext,\n verb: string,\n request: { readonly method: HttpMethod.GET | HttpMethod.POST; readonly path: string; readonly body?: Record<string, unknown> },\n): Promise<Record<string, unknown> | null> {\n if (!ensureSaasAppScope(ctx)) return null;\n const env = ctx.activeEnv;\n if (!env) {\n ctx.log.error('No active environment. Run `wildo init` first.');\n return null;\n }\n if (env.locationType === WildoLocationType.REMOTE) {\n ctx.log.error(`\\`wildo seal ${verb}\\` calls the LOCALLY-running backend; the active environment is remote.`);\n return null;\n }\n const secret = EnvironmentUtils.loadSecretsJson(env.name)?.application?.adminSecret;\n if (!secret) {\n ctx.log.error(`No application admin secret is stored for '${env.name}'. Run \\`wildo config sync\\`, then restart the application.`);\n return null;\n }\n const baseUrl = await resolveBackendBaseUrl(ctx.cliContext.resolvedHomes.app.declarationRoot!);\n if (!baseUrl) {\n ctx.log.error('Could not resolve the application backend\\'s local address: no backend service declares a port.');\n return null;\n }\n const url = `${baseUrl.replace(/\\/$/, '')}${ApprovalSealsAdminEndpointMountBasePath}${request.path}`;\n let response: Response;\n try {\n response = await fetch(url, {\n method: request.method,\n headers: { [ApprovalSealsAdminEndpointHeaderKey]: secret, ...(request.body ? { 'content-type': 'application/json' } : {}) },\n ...(request.body ? { body: JSON.stringify(request.body) } : {}),\n signal: AbortSignal.timeout(SEAL_DOOR_TIMEOUT_MS),\n });\n } catch (error) {\n ctx.log.error(`${chalk.red('unreachable')} — application backend at ${baseUrl}: ${ErrorUtils.extractErrorMessage(error)}`);\n ctx.log.error('Start the stack with `wildo local dev` from the application root. Nothing was done.');\n return null;\n }\n const body = await response.json().catch(() => null) as Record<string, unknown> | null;\n if (!response.ok) {\n ctx.log.error(`${chalk.yellow(`HTTP ${response.status}`)} — ${request.path}: ${describeRefusal(response.status, verb)}`);\n if (body) ctx.log.error(JSON.stringify(body, null, 2));\n return null;\n }\n if (body === null) {\n ctx.log.error(`${chalk.yellow('unexpected answer')} — ${url} answered ${response.status} without a JSON body: is that the application backend?`);\n return null;\n }\n return body;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"seal-admin-door.utils.js","sourceRoot":"","sources":["../../../../src/commands/seal/seal-admin-door.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,mCAAmC,EAAE,uCAAuC,EAAE,MAAM,4BAA4B,CAAC;AAG1H,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,uGAAuG;AACvG,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC,sDAAsD;AACtD,SAAS,eAAe,CAAC,MAAc,EAAE,IAAY;IACnD,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;QAC1B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,sJAAsJ,CAAC;QAClL,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,4KAA4K,CAAC;IAC1M,CAAC;IACD,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,gHAAgH,CAAC;IAC5I,IAAI,MAAM,KAAK,GAAG;QAAE,OAAO,oIAAoI,CAAC;IAChK,IAAI,MAAM,KAAK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;IACvF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QACzH,IAAI,IAAI;YAAE,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,mBAAmB,CAAC,MAAM,GAAG,aAAa,QAAQ,CAAC,MAAM,wDAAwD,CAAC,CAAC;QACjJ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import chalk from 'chalk';\nimport { WildoLocationType } from '@wildo-ai/platform-config-lib';\nimport { HttpMethod } from '@wildo-ai/saas-models';\nimport { ApprovalSealsAdminEndpointHeaderKey, ApprovalSealsAdminEndpointMountBasePath } from '@wildo-ai/saas-backend-lib';\n\nimport type { CommandContext } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\nimport { resolveBackendBaseUrl } from '../context/pipelines.command';\n\n/** A seal door call is one small read or one re-drive; a backend slower than this is not answering. */\nconst SEAL_DOOR_TIMEOUT_MS = 30_000;\n\n/** What a refusal of the approval-seal door means. */\nfunction describeRefusal(status: number, verb: string): string {\n if (verb === 'log-export') {\n if (status === 503) return 'the backend has no admin secret configured (APPLICATION_ADMIN_SECRET), or the custodian cannot sign yet (see the code in the body); ask again later.';\n if (status === 409) return 'the custodian refused the export (see the code in the body: an unpinned export key, a range past the head), or the application does not hold the export key\\'s record yet.';\n }\n if (status === 503) return 'the backend has no admin secret configured (APPLICATION_ADMIN_SECRET): run `wildo config sync` and restart it.';\n if (status === 401) return 'the admin secret was refused: the stored secret and the running backend\\'s differ — restart the backend after `wildo config sync`.';\n if (status === 404) return 'no approval seal has that id.';\n if (status === 409 && verb === 'currency') return 'the seal\\'s presentation file is unreadable or not the one its row recorded (see the body).';\n if (status === 409) {\n return verb === 'export'\n ? 'that seal cannot be exported: it is not SEALED yet, its key record is not held, or its presentation file is missing or not the one its row recorded (see the body).'\n : 'that seal is not DEAD: only a DEAD seal is re-driven (a PENDING one is the relay\\'s, a SEALED one is final).';\n }\n if (status === 400) return 'the request was refused as invalid (see the body).';\n return 'the backend answered with an error (see the body).';\n}\n\n/**\n * Call the running application backend's approval-seal operator door (#2903) with the active LOCAL environment's admin\n * secret, the one the backend receives as `APPLICATION_ADMIN_SECRET`. Answers the JSON body, or null after logging why\n * nothing was read, never an empty answer standing for a failure.\n */\nexport async function callApprovalSealDoor(\n ctx: CommandContext,\n verb: string,\n request: { readonly method: HttpMethod.GET | HttpMethod.POST; readonly path: string; readonly body?: Record<string, unknown> },\n): Promise<Record<string, unknown> | null> {\n if (!ensureSaasAppScope(ctx)) return null;\n const env = ctx.activeEnv;\n if (!env) {\n ctx.log.error('No active environment. Run `wildo init` first.');\n return null;\n }\n if (env.locationType === WildoLocationType.REMOTE) {\n ctx.log.error(`\\`wildo seal ${verb}\\` calls the LOCALLY-running backend; the active environment is remote.`);\n return null;\n }\n const secret = EnvironmentUtils.loadSecretsJson(env.name)?.application?.adminSecret;\n if (!secret) {\n ctx.log.error(`No application admin secret is stored for '${env.name}'. Run \\`wildo config sync\\`, then restart the application.`);\n return null;\n }\n const baseUrl = await resolveBackendBaseUrl(ctx.cliContext.resolvedHomes.app.declarationRoot!);\n if (!baseUrl) {\n ctx.log.error('Could not resolve the application backend\\'s local address: no backend service declares a port.');\n return null;\n }\n const url = `${baseUrl.replace(/\\/$/, '')}${ApprovalSealsAdminEndpointMountBasePath}${request.path}`;\n let response: Response;\n try {\n response = await fetch(url, {\n method: request.method,\n headers: { [ApprovalSealsAdminEndpointHeaderKey]: secret, ...(request.body ? { 'content-type': 'application/json' } : {}) },\n ...(request.body ? { body: JSON.stringify(request.body) } : {}),\n signal: AbortSignal.timeout(SEAL_DOOR_TIMEOUT_MS),\n });\n } catch (error) {\n ctx.log.error(`${chalk.red('unreachable')} — application backend at ${baseUrl}: ${ErrorUtils.extractErrorMessage(error)}`);\n ctx.log.error('Start the stack with `wildo local dev` from the application root. Nothing was done.');\n return null;\n }\n const body = await response.json().catch(() => null) as Record<string, unknown> | null;\n if (!response.ok) {\n ctx.log.error(`${chalk.yellow(`HTTP ${response.status}`)} — ${request.path}: ${describeRefusal(response.status, verb)}`);\n if (body) ctx.log.error(JSON.stringify(body, null, 2));\n return null;\n }\n if (body === null) {\n ctx.log.error(`${chalk.yellow('unexpected answer')} — ${url} answered ${response.status} without a JSON body: is that the application backend?`);\n return null;\n }\n return body;\n}\n"]}
|
|
@@ -19,6 +19,11 @@ import type { CommandMeta, CommandContext, CommandResult } from '../../kernel/ty
|
|
|
19
19
|
* JWS attached. `--manifested-copy <path>` checks it: rebuilt from its own prefix, the JWS and the disclosed approver's
|
|
20
20
|
* name, then its prefix opened against the seal's commitment. One changed byte in the approval page and the seal does
|
|
21
21
|
* not verify. A copy the approver's erasure deleted is reported as erased content, never as missing.
|
|
22
|
+
*
|
|
23
|
+
* Whether the approval is still CURRENT over its record (#2914): `--subject-record <record.json>` gives the record as it
|
|
24
|
+
* is now (its fields, as an export of the record states them; `null` for a record that is gone). The values of the
|
|
25
|
+
* fields the approval covers, as the disclosed presentation carries them, are compared with it. A record changed since
|
|
26
|
+
* is reported NO LONGER CURRENT and is not a failure: the seal still proves what was approved.
|
|
22
27
|
*/
|
|
23
28
|
export default class SealVerifyCommand extends BaseCommand {
|
|
24
29
|
readonly meta: CommandMeta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/verify.command.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK1F
|
|
1
|
+
{"version":3,"file":"verify.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/seal/verify.command.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK1F;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,WAAW;IACxD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAcxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CA4IvD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import { CryptoKey_Purpose } from '@wildo-ai/saas-models';
|
|
4
|
+
import { ApprovalSealSubjectCurrency, CryptoKey_Purpose, HumanDecision_PresentedFieldCurrency } from '@wildo-ai/saas-models';
|
|
5
5
|
import { ApprovalSealCorroborationSchema, ApprovalSealCorroborationSource, ApprovalSealDeliverableFileStanding, ApprovalSealDisclosureStanding, ApprovalSealVerificationBundleSchema, verifyApprovalSeal, } from '@wildo-ai/platform-config-lib';
|
|
6
6
|
import { BaseCommand } from '../../kernel/base-command.js';
|
|
7
7
|
import { JsonDocumentLayout, writeJsonDocument } from '../../kernel/json-document-output.js';
|
|
@@ -28,6 +28,11 @@ import { readPinSetsFile, readSigningLogExportFile } from './signing-log-files.u
|
|
|
28
28
|
* JWS attached. `--manifested-copy <path>` checks it: rebuilt from its own prefix, the JWS and the disclosed approver's
|
|
29
29
|
* name, then its prefix opened against the seal's commitment. One changed byte in the approval page and the seal does
|
|
30
30
|
* not verify. A copy the approver's erasure deleted is reported as erased content, never as missing.
|
|
31
|
+
*
|
|
32
|
+
* Whether the approval is still CURRENT over its record (#2914): `--subject-record <record.json>` gives the record as it
|
|
33
|
+
* is now (its fields, as an export of the record states them; `null` for a record that is gone). The values of the
|
|
34
|
+
* fields the approval covers, as the disclosed presentation carries them, are compared with it. A record changed since
|
|
35
|
+
* is reported NO LONGER CURRENT and is not a failure: the seal still proves what was approved.
|
|
31
36
|
*/
|
|
32
37
|
export default class SealVerifyCommand extends BaseCommand {
|
|
33
38
|
meta = {
|
|
@@ -42,6 +47,7 @@ export default class SealVerifyCommand extends BaseCommand {
|
|
|
42
47
|
'signing-log-exports': { type: 'string[]', description: 'Signing-log exports the operator kept (`wildo seal log-export`), to corroborate a seal under a compromised key.' },
|
|
43
48
|
deliverable: { type: 'string', description: 'The file the seal attests as the approved deliverable (#2904): its bytes are checked against the seal\'s commitment.' },
|
|
44
49
|
'manifested-copy': { type: 'string', description: 'The approved deliverable\'s manifested copy (#2907): its approval page and attached seal are rebuilt and compared, and what precedes them checked against the seal\'s commitment.' },
|
|
50
|
+
'subject-record': { type: 'string', description: 'The record the approval is about, as it is now (a JSON object of its fields, or null when gone) (#2914): reports whether the approval is still current over it.' },
|
|
45
51
|
},
|
|
46
52
|
};
|
|
47
53
|
async run(ctx) {
|
|
@@ -93,6 +99,14 @@ export default class SealVerifyCommand extends BaseCommand {
|
|
|
93
99
|
}
|
|
94
100
|
input = { ...input, manifestedCopy: { ...(bundle.manifestedCopy ?? {}), bytes: readFileSync(resolve(process.cwd(), ctx.flags['manifested-copy'])) } };
|
|
95
101
|
}
|
|
102
|
+
if (typeof ctx.flags['subject-record'] === 'string') {
|
|
103
|
+
const record = JSON.parse(readFileSync(resolve(process.cwd(), ctx.flags['subject-record']), 'utf8'));
|
|
104
|
+
if (record !== null && (typeof record !== 'object' || Array.isArray(record))) {
|
|
105
|
+
ctx.log.error('The subject record must be a JSON object of the record\'s fields, or null for a record that is gone.');
|
|
106
|
+
return { success: false };
|
|
107
|
+
}
|
|
108
|
+
input = { ...input, subjectRecord: record };
|
|
109
|
+
}
|
|
96
110
|
if (exportPaths) {
|
|
97
111
|
const files = exportPaths.map(readSigningLogExportFile);
|
|
98
112
|
const exportPins = pinSets?.[CryptoKey_Purpose.SIGNING_LOG_EXPORT];
|
|
@@ -100,7 +114,7 @@ export default class SealVerifyCommand extends BaseCommand {
|
|
|
100
114
|
}
|
|
101
115
|
}
|
|
102
116
|
catch (error) {
|
|
103
|
-
ctx.log.error(`Cannot read the pin sets, the corroboration, the deliverable, the manifested copy or the signing-log exports: ${ErrorUtils.extractErrorMessage(error)}`);
|
|
117
|
+
ctx.log.error(`Cannot read the pin sets, the corroboration, the deliverable, the manifested copy, the subject record or the signing-log exports: ${ErrorUtils.extractErrorMessage(error)}`);
|
|
104
118
|
return { success: false };
|
|
105
119
|
}
|
|
106
120
|
const result = verifyApprovalSeal(input);
|
|
@@ -155,6 +169,16 @@ export default class SealVerifyCommand extends BaseCommand {
|
|
|
155
169
|
: chalk.dim('nothing to compare with: the approver, the presentation or the deliverable\'s salt is not disclosed');
|
|
156
170
|
ctx.log.info(` manifested copy${result.manifestedCopy.fileId ? ` ${result.manifestedCopy.fileId}` : ''}: ${described}`);
|
|
157
171
|
}
|
|
172
|
+
if (result.subjectRecordCurrency) {
|
|
173
|
+
const currency = result.subjectRecordCurrency;
|
|
174
|
+
const record = currency.subject ? ` ${currency.subject.resourceType}/${currency.subject.resourceId}` : '';
|
|
175
|
+
const moved = (currency.fields ?? []).filter((field) => field.currency !== HumanDecision_PresentedFieldCurrency.CURRENT).map((field) => `${field.key} ${field.currency}`);
|
|
176
|
+
const described = currency.standing === ApprovalSealSubjectCurrency.CURRENT ? chalk.green('CURRENT — every value the approval covers still holds')
|
|
177
|
+
: currency.standing === ApprovalSealSubjectCurrency.NO_LONGER_CURRENT ? chalk.yellow(`NO LONGER CURRENT — ${moved.join(', ')}`)
|
|
178
|
+
: currency.standing === ApprovalSealSubjectCurrency.SUBJECT_GONE ? chalk.yellow('the record is gone')
|
|
179
|
+
: chalk.dim('nothing to compare with: the presentation is not disclosed, or the approval covers no record field');
|
|
180
|
+
ctx.log.info(` currency over the record${record}: ${described}`);
|
|
181
|
+
}
|
|
158
182
|
if (claims.statementDigest) {
|
|
159
183
|
ctx.log.info(` statement: ${result.statement?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? JSON.stringify(result.statement.value) : undisclosed(result.statement?.standing, 'UNDISCLOSED (erased)')}`);
|
|
160
184
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.command.js","sourceRoot":"","sources":["../../../../src/commands/seal/verify.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,oCAAoC,EACpC,kBAAkB,GAEnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,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M,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,EAAE,CAAC,CAAC;QAC3H,CAAC;QACD,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;YAC3B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,SAAS,EAAE,QAAQ,KAAK,8BAA8B,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,EAAE,QAAQ,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAC;QACrN,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,yHAAyH,CAAC,CAAC,CAAC;YACtJ,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,iFAAiF,CAAC,CAAC,CAAC;QAChH,CAAC;QACD,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;YAC1B,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,MAAM,CAAC,cAAc,KAAK,+BAA+B,CAAC,kBAAkB,CAAC,CAAC,CAAC,mDAAmD,CAAC,CAAC,CAAC,yCAAyC,EAAE,CAAC,CAAC;QACvN,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;CACF","sourcesContent":["import { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport chalk from 'chalk';\nimport { CryptoKey_Purpose } from '@wildo-ai/saas-models';\nimport {\n ApprovalSealCorroborationSchema,\n ApprovalSealCorroborationSource,\n ApprovalSealDeliverableFileStanding,\n ApprovalSealDisclosureStanding,\n ApprovalSealVerificationBundleSchema,\n verifyApprovalSeal,\n type ApprovalSealVerificationInput,\n} from '@wildo-ai/platform-config-lib';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { JsonDocumentLayout, writeJsonDocument } from '~wildo-cli/kernel/json-document-output';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { parseCsvFlag } from '~wildo-cli/kernel/flag-utils';\nimport { readPinSetsFile, readSigningLogExportFile } from './signing-log-files.utils';\n\n/**\n * `wildo seal verify <bundle.json>` — verify one approval seal OFFLINE (#2903): the bundle carries the compact JWS, the\n * stored records of the keys that may have signed it (scope and issuer included, as an export carries them), and\n * optionally the disclosures. Nothing is called: it verifies after the application is gone. Exits non-zero on a seal\n * that does not verify, or one that is valid and not provable.\n *\n * The bundle is the host's file, so the operator adds what the host cannot vouch for itself (#2932): `--pins`, its pin\n * sets file (the seal key is trusted only when pinned, and its state is the pin's); `--signing-log-exports`, the exports\n * it kept, which corroborate a seal under a key compromised after an export that lists it; and `--corroboration`, a\n * decision digest recorded elsewhere before the compromise (an exported audit row, an immutable sink).\n *\n * A seal that attests a FILE deliverable (#2904) names it in the bundle with the salt its commitment was made with;\n * `--deliverable <path>` gives the file's bytes, checked against the commitment the presentation binds: one changed byte\n * and the seal does not verify. Without it the file is reported as not given.\n *\n * Such a deliverable may have a MANIFESTED COPY (#2907): the original followed by a page naming who approved it, with the\n * JWS attached. `--manifested-copy <path>` checks it: rebuilt from its own prefix, the JWS and the disclosed approver's\n * name, then its prefix opened against the seal's commitment. One changed byte in the approval page and the seal does\n * not verify. A copy the approver's erasure deleted is reported as erased content, never as missing.\n */\nexport default class SealVerifyCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'seal verify',\n description: 'Verify one approval seal offline from a bundle file ({ jws, keys, expectedIssuer?, disclosures?, erasedClaims?, deliverableFile?, manifestedCopy? }), with your own pins, kept exports, corroboration, the approved file and its manifested copy.',\n category: CommandCategory.Core,\n args: [{ name: 'bundle', description: 'Path to the JSON bundle.', required: true }],\n flags: {\n json: { type: 'boolean', description: 'Print the verification as JSON.' },\n pins: { type: 'string', description: 'The operator\\'s pin sets file ({ \"approval_seal\": { \"keys\": [...] }, \"signing_log_export\": ... }).' },\n corroboration: { type: 'string', description: 'A file { decisionPayloadDigest, recordedAt }: the decision\\'s digest, recorded outside the application before the compromise.' },\n 'signing-log-exports': { type: 'string[]', description: 'Signing-log exports the operator kept (`wildo seal log-export`), to corroborate a seal under a compromised key.' },\n deliverable: { type: 'string', description: 'The file the seal attests as the approved deliverable (#2904): its bytes are checked against the seal\\'s commitment.' },\n 'manifested-copy': { type: 'string', description: 'The approved deliverable\\'s manifested copy (#2907): its approval page and attached seal are rebuilt and compared, and what precedes them checked against the seal\\'s commitment.' },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const path = ctx.args.bundle;\n if (!path) {\n ctx.log.error('Missing required <bundle> argument.');\n return { success: false };\n }\n let bundle;\n try {\n bundle = ApprovalSealVerificationBundleSchema.parse(JSON.parse(readFileSync(resolve(process.cwd(), path), 'utf8')));\n } catch (error) {\n ctx.log.error(`Cannot read the bundle ${path}: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n // The bundle is the host's; the pins and the kept exports come only from the operator's own files (#2932 review H1).\n // A pin file that does not pin the purpose being checked is refused rather than silently ignored (review L1).\n let input: ApprovalSealVerificationInput = bundle;\n try {\n const pinSets = typeof ctx.flags.pins === 'string' ? readPinSetsFile(ctx.flags.pins) : undefined;\n const exportPaths = parseCsvFlag(ctx.flags['signing-log-exports']);\n if (pinSets) {\n const sealPins = pinSets[CryptoKey_Purpose.APPROVAL_SEAL];\n if (!sealPins) {\n ctx.log.error(`The pin sets file pins no ${CryptoKey_Purpose.APPROVAL_SEAL} key: nothing would be checked against it.`);\n return { success: false };\n }\n if (exportPaths && !pinSets[CryptoKey_Purpose.SIGNING_LOG_EXPORT]) {\n ctx.log.error(`The pin sets file pins no ${CryptoKey_Purpose.SIGNING_LOG_EXPORT} key: the exports could not be checked against it.`);\n return { success: false };\n }\n input = { ...input, pins: sealPins };\n }\n if (typeof ctx.flags.corroboration === 'string') {\n input = { ...input, corroboration: ApprovalSealCorroborationSchema.parse(JSON.parse(readFileSync(resolve(process.cwd(), ctx.flags.corroboration), 'utf8'))) };\n }\n if (typeof ctx.flags.deliverable === 'string') {\n if (!bundle.deliverableFile) {\n ctx.log.error('The bundle names no file deliverable: this seal attests no file to check the given one against.');\n return { success: false };\n }\n input = { ...input, deliverableFile: { ...bundle.deliverableFile, bytes: readFileSync(resolve(process.cwd(), ctx.flags.deliverable)) } };\n }\n if (typeof ctx.flags['manifested-copy'] === 'string') {\n if (!bundle.deliverableFile) {\n ctx.log.error('The bundle names no file deliverable: this seal attests no file a manifested copy could be made of.');\n return { success: false };\n }\n input = { ...input, manifestedCopy: { ...(bundle.manifestedCopy ?? {}), bytes: readFileSync(resolve(process.cwd(), ctx.flags['manifested-copy'])) } };\n }\n if (exportPaths) {\n const files = exportPaths.map(readSigningLogExportFile);\n const exportPins = pinSets?.[CryptoKey_Purpose.SIGNING_LOG_EXPORT];\n input = { ...input, signingLogExports: { exports: files.map((file) => file.jws), keys: files.map((file) => file.key), ...(exportPins ? { pins: exportPins } : {}) } };\n }\n } catch (error) {\n ctx.log.error(`Cannot read the pin sets, the corroboration, the deliverable, the manifested copy or the signing-log exports: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n const result = verifyApprovalSeal(input);\n if (ctx.flags.json === true) {\n writeJsonDocument(result, JsonDocumentLayout.INDENTED);\n return { success: result.valid && result.provable };\n }\n if (!result.valid) {\n ctx.log.error(`${chalk.red('NOT VALID')} — ${result.failures.join(', ')}`);\n if (result.deliverableFile?.standing === ApprovalSealDeliverableFileStanding.CHANGED) {\n ctx.log.error(` deliverable file ${result.deliverableFile.fileId}: the given bytes are NOT the file the person approved`);\n }\n if (result.manifestedCopy?.standing === ApprovalSealDeliverableFileStanding.CHANGED) {\n ctx.log.error(' manifested copy: the given file is NOT this seal\\'s copy of the approved file (its approval page, attached seal or original differs)');\n }\n return { success: false };\n }\n const claims = result.claims!;\n ctx.log.info(`${result.provable ? chalk.green('VALID') : chalk.yellow('VALID, NOT PROVABLE')} — ${claims.source} ${claims.decisionRef} · ${claims.outcome} (${claims.meaning})`);\n ctx.log.info(` subject: ${claims.subject.resourceType}/${claims.subject.resourceId} · tenant ${claims.tenant}`);\n ctx.log.info(` decided: ${new Date(claims.decidedAt * 1000).toISOString()} · signed ${result.signingWindowSeconds ?? '?'} s later${result.lateSeal ? chalk.yellow(' (late seal)') : ''} · key ${result.kid} (${result.keyState})`);\n ctx.log.info(` decider: ${claims.decider.kind} via ${claims.decider.channel}${claims.decider.amr ? ` · amr ${claims.decider.amr.join(',')}` : ''}${claims.decider.stepUpMethod ? ` · step-up ${claims.decider.stepUpMethod}` : ''}${claims.decider.stepUpAt !== undefined ? ` proven ${claims.decidedAt - claims.decider.stepUpAt} s before the decision` : ''}${claims.decider.stepUpUserVerified !== undefined ? ` · user ${claims.decider.stepUpUserVerified ? 'verified' : 'NOT verified'} by the authenticator` : ''}`);\n // #2924: content the seal commits to and the bundle does not give is never a failure. An erasure the bundle states\n // reads UNDISCLOSED (erased) (PRESENTATION_ERASED for what the person was shown); anything else absent, not given.\n const undisclosed = (standing: ApprovalSealDisclosureStanding | undefined, erased: string) =>\n standing === ApprovalSealDisclosureStanding.ERASED ? chalk.dim(erased) : chalk.dim('not given');\n const person = (label: string, standing: typeof result.approver) => {\n if (!standing) return;\n ctx.log.info(` ${label}: ${standing.standing === ApprovalSealDisclosureStanding.DISCLOSED ? JSON.stringify(standing.value) : undisclosed(standing.standing, 'UNDISCLOSED (erased)')}`);\n };\n person('approver', result.approver);\n person('requester', result.requester);\n // #2903 S6: what the person was shown, and what they answered, each against its commitment.\n if (claims.presentation) {\n const shown = result.presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? 'disclosed, matches the seal'\n : undisclosed(result.presentation?.standing, 'PRESENTATION_ERASED (an erasure rewrote the stored presentation; the seal still binds its digest)');\n ctx.log.info(` presentation: ${claims.presentation.provenance} · ${shown}`);\n }\n if (result.deliverableFile) {\n const standing = result.deliverableFile.standing;\n const described = standing === ApprovalSealDeliverableFileStanding.MATCHES ? chalk.green('the given bytes are the file approved')\n : standing === ApprovalSealDeliverableFileStanding.NOT_GIVEN ? chalk.yellow('not given (pass --deliverable <file>)')\n : chalk.dim('nothing to compare with: the presentation is not disclosed, or binds no such file');\n ctx.log.info(` deliverable file ${result.deliverableFile.fileId}${result.deliverableFile.argument ? ` (${result.deliverableFile.argument})` : ''}: ${described}`);\n }\n if (result.manifestedCopy) {\n const standing = result.manifestedCopy.standing;\n const described = standing === ApprovalSealDeliverableFileStanding.MATCHES\n ? chalk.green(`the approved file, with this seal's approval page${result.manifestedCopy.approverName ? ` naming ${result.manifestedCopy.approverName}` : ''}${result.manifestedCopy.locale ? ` (words: ${result.manifestedCopy.locale})` : ''}${result.manifestedCopy.verificationUrl ? `, QR code to ${result.manifestedCopy.verificationUrl}` : ''}`)\n : standing === ApprovalSealDeliverableFileStanding.CONTENT_ERASED ? chalk.dim('CONTENT_ERASED (deleted with the approver\\'s erasure; the seal and the original still prove the approval)')\n : standing === ApprovalSealDeliverableFileStanding.NOT_GIVEN ? chalk.yellow('not given (pass --manifested-copy <file>)')\n : chalk.dim('nothing to compare with: the approver, the presentation or the deliverable\\'s salt is not disclosed');\n ctx.log.info(` manifested copy${result.manifestedCopy.fileId ? ` ${result.manifestedCopy.fileId}` : ''}: ${described}`);\n }\n if (claims.statementDigest) {\n ctx.log.info(` statement: ${result.statement?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? JSON.stringify(result.statement.value) : undisclosed(result.statement?.standing, 'UNDISCLOSED (erased)')}`);\n }\n if (!result.provable) {\n ctx.log.info(chalk.yellow(' The key is compromised: corroborate the decision payload digest with evidence recorded before its compromise instant,'));\n ctx.log.info(chalk.yellow(' or give a signing-log export you kept from before it (--signing-log-exports).'));\n }\n if (result.corroboratedBy) {\n ctx.log.info(` corroborated by: ${result.corroboratedBy === ApprovalSealCorroborationSource.SIGNING_LOG_EXPORT ? 'a signing-log export signed before the compromise' : 'evidence recorded before the compromise'}`);\n }\n ctx.log.info(` decision payload digest: ${result.decisionPayloadDigest}`);\n return { success: result.provable };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"verify.command.js","sourceRoot":"","sources":["../../../../src/commands/seal/verify.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,oCAAoC,EAAE,MAAM,uBAAuB,CAAC;AAC7H,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,mCAAmC,EACnC,8BAA8B,EAC9B,oCAAoC,EACpC,kBAAkB,GAEnB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,OAAO,i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AAC,cAAc,KAAK,+BAA+B,CAAC,kBAAkB,CAAC,CAAC,CAAC,mDAAmD,CAAC,CAAC,CAAC,yCAAyC,EAAE,CAAC,CAAC;QACvN,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,8BAA8B,MAAM,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC;IACtC,CAAC;CACF","sourcesContent":["import { readFileSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport chalk from 'chalk';\nimport { ApprovalSealSubjectCurrency, CryptoKey_Purpose, HumanDecision_PresentedFieldCurrency } from '@wildo-ai/saas-models';\nimport {\n ApprovalSealCorroborationSchema,\n ApprovalSealCorroborationSource,\n ApprovalSealDeliverableFileStanding,\n ApprovalSealDisclosureStanding,\n ApprovalSealVerificationBundleSchema,\n verifyApprovalSeal,\n type ApprovalSealVerificationInput,\n} from '@wildo-ai/platform-config-lib';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { JsonDocumentLayout, writeJsonDocument } from '~wildo-cli/kernel/json-document-output';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { parseCsvFlag } from '~wildo-cli/kernel/flag-utils';\nimport { readPinSetsFile, readSigningLogExportFile } from './signing-log-files.utils';\n\n/**\n * `wildo seal verify <bundle.json>` — verify one approval seal OFFLINE (#2903): the bundle carries the compact JWS, the\n * stored records of the keys that may have signed it (scope and issuer included, as an export carries them), and\n * optionally the disclosures. Nothing is called: it verifies after the application is gone. Exits non-zero on a seal\n * that does not verify, or one that is valid and not provable.\n *\n * The bundle is the host's file, so the operator adds what the host cannot vouch for itself (#2932): `--pins`, its pin\n * sets file (the seal key is trusted only when pinned, and its state is the pin's); `--signing-log-exports`, the exports\n * it kept, which corroborate a seal under a key compromised after an export that lists it; and `--corroboration`, a\n * decision digest recorded elsewhere before the compromise (an exported audit row, an immutable sink).\n *\n * A seal that attests a FILE deliverable (#2904) names it in the bundle with the salt its commitment was made with;\n * `--deliverable <path>` gives the file's bytes, checked against the commitment the presentation binds: one changed byte\n * and the seal does not verify. Without it the file is reported as not given.\n *\n * Such a deliverable may have a MANIFESTED COPY (#2907): the original followed by a page naming who approved it, with the\n * JWS attached. `--manifested-copy <path>` checks it: rebuilt from its own prefix, the JWS and the disclosed approver's\n * name, then its prefix opened against the seal's commitment. One changed byte in the approval page and the seal does\n * not verify. A copy the approver's erasure deleted is reported as erased content, never as missing.\n *\n * Whether the approval is still CURRENT over its record (#2914): `--subject-record <record.json>` gives the record as it\n * is now (its fields, as an export of the record states them; `null` for a record that is gone). The values of the\n * fields the approval covers, as the disclosed presentation carries them, are compared with it. A record changed since\n * is reported NO LONGER CURRENT and is not a failure: the seal still proves what was approved.\n */\nexport default class SealVerifyCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'seal verify',\n description: 'Verify one approval seal offline from a bundle file ({ jws, keys, expectedIssuer?, disclosures?, erasedClaims?, deliverableFile?, manifestedCopy? }), with your own pins, kept exports, corroboration, the approved file and its manifested copy.',\n category: CommandCategory.Core,\n args: [{ name: 'bundle', description: 'Path to the JSON bundle.', required: true }],\n flags: {\n json: { type: 'boolean', description: 'Print the verification as JSON.' },\n pins: { type: 'string', description: 'The operator\\'s pin sets file ({ \"approval_seal\": { \"keys\": [...] }, \"signing_log_export\": ... }).' },\n corroboration: { type: 'string', description: 'A file { decisionPayloadDigest, recordedAt }: the decision\\'s digest, recorded outside the application before the compromise.' },\n 'signing-log-exports': { type: 'string[]', description: 'Signing-log exports the operator kept (`wildo seal log-export`), to corroborate a seal under a compromised key.' },\n deliverable: { type: 'string', description: 'The file the seal attests as the approved deliverable (#2904): its bytes are checked against the seal\\'s commitment.' },\n 'manifested-copy': { type: 'string', description: 'The approved deliverable\\'s manifested copy (#2907): its approval page and attached seal are rebuilt and compared, and what precedes them checked against the seal\\'s commitment.' },\n 'subject-record': { type: 'string', description: 'The record the approval is about, as it is now (a JSON object of its fields, or null when gone) (#2914): reports whether the approval is still current over it.' },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const path = ctx.args.bundle;\n if (!path) {\n ctx.log.error('Missing required <bundle> argument.');\n return { success: false };\n }\n let bundle;\n try {\n bundle = ApprovalSealVerificationBundleSchema.parse(JSON.parse(readFileSync(resolve(process.cwd(), path), 'utf8')));\n } catch (error) {\n ctx.log.error(`Cannot read the bundle ${path}: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n // The bundle is the host's; the pins and the kept exports come only from the operator's own files (#2932 review H1).\n // A pin file that does not pin the purpose being checked is refused rather than silently ignored (review L1).\n let input: ApprovalSealVerificationInput = bundle;\n try {\n const pinSets = typeof ctx.flags.pins === 'string' ? readPinSetsFile(ctx.flags.pins) : undefined;\n const exportPaths = parseCsvFlag(ctx.flags['signing-log-exports']);\n if (pinSets) {\n const sealPins = pinSets[CryptoKey_Purpose.APPROVAL_SEAL];\n if (!sealPins) {\n ctx.log.error(`The pin sets file pins no ${CryptoKey_Purpose.APPROVAL_SEAL} key: nothing would be checked against it.`);\n return { success: false };\n }\n if (exportPaths && !pinSets[CryptoKey_Purpose.SIGNING_LOG_EXPORT]) {\n ctx.log.error(`The pin sets file pins no ${CryptoKey_Purpose.SIGNING_LOG_EXPORT} key: the exports could not be checked against it.`);\n return { success: false };\n }\n input = { ...input, pins: sealPins };\n }\n if (typeof ctx.flags.corroboration === 'string') {\n input = { ...input, corroboration: ApprovalSealCorroborationSchema.parse(JSON.parse(readFileSync(resolve(process.cwd(), ctx.flags.corroboration), 'utf8'))) };\n }\n if (typeof ctx.flags.deliverable === 'string') {\n if (!bundle.deliverableFile) {\n ctx.log.error('The bundle names no file deliverable: this seal attests no file to check the given one against.');\n return { success: false };\n }\n input = { ...input, deliverableFile: { ...bundle.deliverableFile, bytes: readFileSync(resolve(process.cwd(), ctx.flags.deliverable)) } };\n }\n if (typeof ctx.flags['manifested-copy'] === 'string') {\n if (!bundle.deliverableFile) {\n ctx.log.error('The bundle names no file deliverable: this seal attests no file a manifested copy could be made of.');\n return { success: false };\n }\n input = { ...input, manifestedCopy: { ...(bundle.manifestedCopy ?? {}), bytes: readFileSync(resolve(process.cwd(), ctx.flags['manifested-copy'])) } };\n }\n if (typeof ctx.flags['subject-record'] === 'string') {\n const record: unknown = JSON.parse(readFileSync(resolve(process.cwd(), ctx.flags['subject-record']), 'utf8'));\n if (record !== null && (typeof record !== 'object' || Array.isArray(record))) {\n ctx.log.error('The subject record must be a JSON object of the record\\'s fields, or null for a record that is gone.');\n return { success: false };\n }\n input = { ...input, subjectRecord: record as Record<string, unknown> | null };\n }\n if (exportPaths) {\n const files = exportPaths.map(readSigningLogExportFile);\n const exportPins = pinSets?.[CryptoKey_Purpose.SIGNING_LOG_EXPORT];\n input = { ...input, signingLogExports: { exports: files.map((file) => file.jws), keys: files.map((file) => file.key), ...(exportPins ? { pins: exportPins } : {}) } };\n }\n } catch (error) {\n ctx.log.error(`Cannot read the pin sets, the corroboration, the deliverable, the manifested copy, the subject record or the signing-log exports: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n const result = verifyApprovalSeal(input);\n if (ctx.flags.json === true) {\n writeJsonDocument(result, JsonDocumentLayout.INDENTED);\n return { success: result.valid && result.provable };\n }\n if (!result.valid) {\n ctx.log.error(`${chalk.red('NOT VALID')} — ${result.failures.join(', ')}`);\n if (result.deliverableFile?.standing === ApprovalSealDeliverableFileStanding.CHANGED) {\n ctx.log.error(` deliverable file ${result.deliverableFile.fileId}: the given bytes are NOT the file the person approved`);\n }\n if (result.manifestedCopy?.standing === ApprovalSealDeliverableFileStanding.CHANGED) {\n ctx.log.error(' manifested copy: the given file is NOT this seal\\'s copy of the approved file (its approval page, attached seal or original differs)');\n }\n return { success: false };\n }\n const claims = result.claims!;\n ctx.log.info(`${result.provable ? chalk.green('VALID') : chalk.yellow('VALID, NOT PROVABLE')} — ${claims.source} ${claims.decisionRef} · ${claims.outcome} (${claims.meaning})`);\n ctx.log.info(` subject: ${claims.subject.resourceType}/${claims.subject.resourceId} · tenant ${claims.tenant}`);\n ctx.log.info(` decided: ${new Date(claims.decidedAt * 1000).toISOString()} · signed ${result.signingWindowSeconds ?? '?'} s later${result.lateSeal ? chalk.yellow(' (late seal)') : ''} · key ${result.kid} (${result.keyState})`);\n ctx.log.info(` decider: ${claims.decider.kind} via ${claims.decider.channel}${claims.decider.amr ? ` · amr ${claims.decider.amr.join(',')}` : ''}${claims.decider.stepUpMethod ? ` · step-up ${claims.decider.stepUpMethod}` : ''}${claims.decider.stepUpAt !== undefined ? ` proven ${claims.decidedAt - claims.decider.stepUpAt} s before the decision` : ''}${claims.decider.stepUpUserVerified !== undefined ? ` · user ${claims.decider.stepUpUserVerified ? 'verified' : 'NOT verified'} by the authenticator` : ''}`);\n // #2924: content the seal commits to and the bundle does not give is never a failure. An erasure the bundle states\n // reads UNDISCLOSED (erased) (PRESENTATION_ERASED for what the person was shown); anything else absent, not given.\n const undisclosed = (standing: ApprovalSealDisclosureStanding | undefined, erased: string) =>\n standing === ApprovalSealDisclosureStanding.ERASED ? chalk.dim(erased) : chalk.dim('not given');\n const person = (label: string, standing: typeof result.approver) => {\n if (!standing) return;\n ctx.log.info(` ${label}: ${standing.standing === ApprovalSealDisclosureStanding.DISCLOSED ? JSON.stringify(standing.value) : undisclosed(standing.standing, 'UNDISCLOSED (erased)')}`);\n };\n person('approver', result.approver);\n person('requester', result.requester);\n // #2903 S6: what the person was shown, and what they answered, each against its commitment.\n if (claims.presentation) {\n const shown = result.presentation?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? 'disclosed, matches the seal'\n : undisclosed(result.presentation?.standing, 'PRESENTATION_ERASED (an erasure rewrote the stored presentation; the seal still binds its digest)');\n ctx.log.info(` presentation: ${claims.presentation.provenance} · ${shown}`);\n }\n if (result.deliverableFile) {\n const standing = result.deliverableFile.standing;\n const described = standing === ApprovalSealDeliverableFileStanding.MATCHES ? chalk.green('the given bytes are the file approved')\n : standing === ApprovalSealDeliverableFileStanding.NOT_GIVEN ? chalk.yellow('not given (pass --deliverable <file>)')\n : chalk.dim('nothing to compare with: the presentation is not disclosed, or binds no such file');\n ctx.log.info(` deliverable file ${result.deliverableFile.fileId}${result.deliverableFile.argument ? ` (${result.deliverableFile.argument})` : ''}: ${described}`);\n }\n if (result.manifestedCopy) {\n const standing = result.manifestedCopy.standing;\n const described = standing === ApprovalSealDeliverableFileStanding.MATCHES\n ? chalk.green(`the approved file, with this seal's approval page${result.manifestedCopy.approverName ? ` naming ${result.manifestedCopy.approverName}` : ''}${result.manifestedCopy.locale ? ` (words: ${result.manifestedCopy.locale})` : ''}${result.manifestedCopy.verificationUrl ? `, QR code to ${result.manifestedCopy.verificationUrl}` : ''}`)\n : standing === ApprovalSealDeliverableFileStanding.CONTENT_ERASED ? chalk.dim('CONTENT_ERASED (deleted with the approver\\'s erasure; the seal and the original still prove the approval)')\n : standing === ApprovalSealDeliverableFileStanding.NOT_GIVEN ? chalk.yellow('not given (pass --manifested-copy <file>)')\n : chalk.dim('nothing to compare with: the approver, the presentation or the deliverable\\'s salt is not disclosed');\n ctx.log.info(` manifested copy${result.manifestedCopy.fileId ? ` ${result.manifestedCopy.fileId}` : ''}: ${described}`);\n }\n if (result.subjectRecordCurrency) {\n const currency = result.subjectRecordCurrency;\n const record = currency.subject ? ` ${currency.subject.resourceType}/${currency.subject.resourceId}` : '';\n const moved = (currency.fields ?? []).filter((field) => field.currency !== HumanDecision_PresentedFieldCurrency.CURRENT).map((field) => `${field.key} ${field.currency}`);\n const described = currency.standing === ApprovalSealSubjectCurrency.CURRENT ? chalk.green('CURRENT — every value the approval covers still holds')\n : currency.standing === ApprovalSealSubjectCurrency.NO_LONGER_CURRENT ? chalk.yellow(`NO LONGER CURRENT — ${moved.join(', ')}`)\n : currency.standing === ApprovalSealSubjectCurrency.SUBJECT_GONE ? chalk.yellow('the record is gone')\n : chalk.dim('nothing to compare with: the presentation is not disclosed, or the approval covers no record field');\n ctx.log.info(` currency over the record${record}: ${described}`);\n }\n if (claims.statementDigest) {\n ctx.log.info(` statement: ${result.statement?.standing === ApprovalSealDisclosureStanding.DISCLOSED ? JSON.stringify(result.statement.value) : undisclosed(result.statement?.standing, 'UNDISCLOSED (erased)')}`);\n }\n if (!result.provable) {\n ctx.log.info(chalk.yellow(' The key is compromised: corroborate the decision payload digest with evidence recorded before its compromise instant,'));\n ctx.log.info(chalk.yellow(' or give a signing-log export you kept from before it (--signing-log-exports).'));\n }\n if (result.corroboratedBy) {\n ctx.log.info(` corroborated by: ${result.corroboratedBy === ApprovalSealCorroborationSource.SIGNING_LOG_EXPORT ? 'a signing-log export signed before the compromise' : 'evidence recorded before the compromise'}`);\n }\n ctx.log.info(` decision payload digest: ${result.decisionPayloadDigest}`);\n return { success: result.provable };\n }\n}\n"]}
|
|
@@ -44,12 +44,29 @@ export type EnvironmentClassifierReading = {
|
|
|
44
44
|
readonly secrets: EnvironmentProviderEnvReading;
|
|
45
45
|
/** Of the serving provider's required secrets, those absent from `providerEnv` (empty unless `secrets` was READ). */
|
|
46
46
|
readonly missingSecrets: readonly string[];
|
|
47
|
+
/** Which guardrail the provider asked first offers, by its declared capabilities (both false when there is none). */
|
|
48
|
+
readonly offers: GuardrailsOffered;
|
|
49
|
+
/** The environment's reason, when it declares that its agents run unguarded where no classifier offers a guardrail. */
|
|
50
|
+
readonly runsUnguardedBecause?: string;
|
|
51
|
+
/**
|
|
52
|
+
* With no provider found: the providers the backend scope or a selection DECLARE for the capability although none can
|
|
53
|
+
* serve (not installed, or selected and not scoped with it). The runtime refuses such a declared classifier and never
|
|
54
|
+
* waives it.
|
|
55
|
+
*/
|
|
56
|
+
readonly declaredButMissing?: readonly string[];
|
|
47
57
|
/**
|
|
48
58
|
* A REMOTE environment (its authored file is `wildo.infra.remote.config.ts`): its deployed secrets are rebuilt from its
|
|
49
59
|
* CI environment, so the `secrets.json` on this machine is a copy that may not be the whole of them.
|
|
50
60
|
*/
|
|
51
61
|
readonly remote?: true;
|
|
52
62
|
};
|
|
63
|
+
/** Which classifier-backed guardrail something offers, or needs. */
|
|
64
|
+
export interface GuardrailsOffered {
|
|
65
|
+
readonly promptInjection: boolean;
|
|
66
|
+
readonly outputModeration: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** The guardrails the guarded agents declare, between them. `undefined` when the agents could not be read. */
|
|
69
|
+
export declare function guardrailsDeclaredBy(agents: readonly AgentAiUseDeclaration[]): GuardrailsOffered | undefined;
|
|
53
70
|
/**
|
|
54
71
|
* The agents that can be refused for want of a classifier, by ref, or `undefined` when the projection cannot say (it
|
|
55
72
|
* predates the guardrail fields, so absence there means NOT READ). An agent is left out when it is known not to run
|
|
@@ -75,6 +92,8 @@ export declare function contentGuardrailClassifierCheck(input: {
|
|
|
75
92
|
readonly readings: readonly EnvironmentClassifierReading[];
|
|
76
93
|
/** The guarded agents, or `undefined` when the agents could not be read. */
|
|
77
94
|
readonly guardedAgents: readonly string[] | undefined;
|
|
95
|
+
/** The guardrails they declare between them ({@link guardrailsDeclaredBy}); both when absent or unknown. */
|
|
96
|
+
readonly guardrailsNeeded?: GuardrailsOffered;
|
|
78
97
|
readonly agentsNotReadBecause?: string;
|
|
79
98
|
}): LocalPreconditionCheckResult;
|
|
80
99
|
//# sourceMappingURL=content-guardrail-classifier.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-guardrail-classifier.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/content-guardrail-classifier.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content-guardrail-classifier.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/content-guardrail-classifier.service.ts"],"names":[],"mappings":"AAmDA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,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