@intutic/cli 1.9.0 → 1.10.1
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/README.md +1 -0
- package/dist/cli.js +868 -30
- package/dist/cli.js.map +1 -1
- package/dist/commands/attenuate.d.ts +39 -0
- package/dist/commands/attenuate.d.ts.map +1 -0
- package/dist/commands/attenuate.js +98 -0
- package/dist/commands/attenuate.js.map +1 -0
- package/dist/commands/budget.d.ts +80 -0
- package/dist/commands/budget.d.ts.map +1 -1
- package/dist/commands/budget.js +119 -3
- package/dist/commands/budget.js.map +1 -1
- package/dist/commands/connect.d.ts +10 -0
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +358 -48
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/credentials.d.ts +31 -0
- package/dist/commands/credentials.d.ts.map +1 -0
- package/dist/commands/credentials.js +134 -0
- package/dist/commands/credentials.js.map +1 -0
- package/dist/commands/decision.d.ts +37 -0
- package/dist/commands/decision.d.ts.map +1 -0
- package/dist/commands/decision.js +56 -0
- package/dist/commands/decision.js.map +1 -0
- package/dist/commands/doctor.d.ts +38 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +228 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/enforce.d.ts +33 -0
- package/dist/commands/enforce.d.ts.map +1 -0
- package/dist/commands/enforce.js +150 -0
- package/dist/commands/enforce.js.map +1 -0
- package/dist/commands/enterprise.d.ts +29 -0
- package/dist/commands/enterprise.d.ts.map +1 -0
- package/dist/commands/enterprise.js +141 -0
- package/dist/commands/enterprise.js.map +1 -0
- package/dist/commands/env.d.ts +7 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/env.js +55 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/exec.d.ts +38 -2
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/exec.js +247 -10
- package/dist/commands/exec.js.map +1 -1
- package/dist/commands/findings.d.ts +84 -0
- package/dist/commands/findings.d.ts.map +1 -0
- package/dist/commands/findings.js +329 -0
- package/dist/commands/findings.js.map +1 -0
- package/dist/commands/gateway.d.ts +62 -0
- package/dist/commands/gateway.d.ts.map +1 -0
- package/dist/commands/gateway.js +298 -0
- package/dist/commands/gateway.js.map +1 -0
- package/dist/commands/guardrails.d.ts +81 -0
- package/dist/commands/guardrails.d.ts.map +1 -0
- package/dist/commands/guardrails.js +735 -0
- package/dist/commands/guardrails.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +14 -2
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install-daemon.d.ts +70 -3
- package/dist/commands/install-daemon.d.ts.map +1 -1
- package/dist/commands/install-daemon.js +482 -47
- package/dist/commands/install-daemon.js.map +1 -1
- package/dist/commands/integrity.d.ts +205 -0
- package/dist/commands/integrity.d.ts.map +1 -0
- package/dist/commands/integrity.js +620 -0
- package/dist/commands/integrity.js.map +1 -0
- package/dist/commands/judge.d.ts +31 -0
- package/dist/commands/judge.d.ts.map +1 -0
- package/dist/commands/judge.js +118 -0
- package/dist/commands/judge.js.map +1 -0
- package/dist/commands/org.d.ts +31 -0
- package/dist/commands/org.d.ts.map +1 -0
- package/dist/commands/org.js +159 -0
- package/dist/commands/org.js.map +1 -0
- package/dist/commands/policy.d.ts +138 -4
- package/dist/commands/policy.d.ts.map +1 -1
- package/dist/commands/policy.js +538 -97
- package/dist/commands/policy.js.map +1 -1
- package/dist/commands/predict-cost.d.ts +45 -0
- package/dist/commands/predict-cost.d.ts.map +1 -0
- package/dist/commands/predict-cost.js +123 -0
- package/dist/commands/predict-cost.js.map +1 -0
- package/dist/commands/rollback.d.ts +5 -0
- package/dist/commands/rollback.d.ts.map +1 -0
- package/dist/commands/rollback.js +142 -0
- package/dist/commands/rollback.js.map +1 -0
- package/dist/commands/routing.d.ts +62 -0
- package/dist/commands/routing.d.ts.map +1 -0
- package/dist/commands/routing.js +121 -0
- package/dist/commands/routing.js.map +1 -0
- package/dist/commands/setup.d.ts +62 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +238 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/skill.d.ts +268 -1
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +744 -39
- package/dist/commands/skill.js.map +1 -1
- package/dist/commands/sops.d.ts +95 -0
- package/dist/commands/sops.d.ts.map +1 -1
- package/dist/commands/sops.js +334 -34
- package/dist/commands/sops.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +1 -18
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +44 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team.d.ts +38 -0
- package/dist/commands/team.d.ts.map +1 -0
- package/dist/commands/team.js +140 -0
- package/dist/commands/team.js.map +1 -0
- package/dist/commands/traces.d.ts +8 -1
- package/dist/commands/traces.d.ts.map +1 -1
- package/dist/commands/traces.js +114 -15
- package/dist/commands/traces.js.map +1 -1
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +2 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/config/keychain.d.ts +10 -2
- package/dist/config/keychain.d.ts.map +1 -1
- package/dist/config/keychain.js +83 -14
- package/dist/config/keychain.js.map +1 -1
- package/dist/config/paths.d.ts +27 -0
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +37 -6
- package/dist/config/paths.js.map +1 -1
- package/dist/config/store.d.ts.map +1 -1
- package/dist/config/store.js +19 -3
- package/dist/config/store.js.map +1 -1
- package/dist/harness/ag2.d.ts +22 -0
- package/dist/harness/ag2.d.ts.map +1 -0
- package/dist/harness/ag2.js +34 -0
- package/dist/harness/ag2.js.map +1 -0
- package/dist/harness/agentcore.d.ts +55 -0
- package/dist/harness/agentcore.d.ts.map +1 -0
- package/dist/harness/agentcore.js +119 -0
- package/dist/harness/agentcore.js.map +1 -0
- package/dist/harness/agenticOrchestrator.d.ts +52 -0
- package/dist/harness/agenticOrchestrator.d.ts.map +1 -0
- package/dist/harness/agenticOrchestrator.js +115 -0
- package/dist/harness/agenticOrchestrator.js.map +1 -0
- package/dist/harness/aiSdkHarness.d.ts +30 -0
- package/dist/harness/aiSdkHarness.d.ts.map +1 -0
- package/dist/harness/aiSdkHarness.js +51 -0
- package/dist/harness/aiSdkHarness.js.map +1 -0
- package/dist/harness/aiSdkWorkflow.d.ts +26 -0
- package/dist/harness/aiSdkWorkflow.d.ts.map +1 -0
- package/dist/harness/aiSdkWorkflow.js +39 -0
- package/dist/harness/aiSdkWorkflow.js.map +1 -0
- package/dist/harness/autogen.d.ts +24 -0
- package/dist/harness/autogen.d.ts.map +1 -0
- package/dist/harness/autogen.js +36 -0
- package/dist/harness/autogen.js.map +1 -0
- package/dist/harness/base.js.map +1 -1
- package/dist/harness/continue.d.ts.map +1 -1
- package/dist/harness/continue.js +2 -1
- package/dist/harness/continue.js.map +1 -1
- package/dist/harness/crewai.d.ts +15 -0
- package/dist/harness/crewai.d.ts.map +1 -0
- package/dist/harness/crewai.js +26 -0
- package/dist/harness/crewai.js.map +1 -0
- package/dist/harness/detector.d.ts +1 -1
- package/dist/harness/detector.d.ts.map +1 -1
- package/dist/harness/detector.js +47 -1
- package/dist/harness/detector.js.map +1 -1
- package/dist/harness/dsh.d.ts +19 -0
- package/dist/harness/dsh.d.ts.map +1 -0
- package/dist/harness/dsh.js +93 -0
- package/dist/harness/dsh.js.map +1 -0
- package/dist/harness/eve.d.ts +40 -0
- package/dist/harness/eve.d.ts.map +1 -0
- package/dist/harness/eve.js +67 -0
- package/dist/harness/eve.js.map +1 -0
- package/dist/harness/googleAdk.d.ts +18 -0
- package/dist/harness/googleAdk.d.ts.map +1 -0
- package/dist/harness/googleAdk.js +29 -0
- package/dist/harness/googleAdk.js.map +1 -0
- package/dist/harness/goose.d.ts.map +1 -1
- package/dist/harness/goose.js +5 -1
- package/dist/harness/goose.js.map +1 -1
- package/dist/harness/grok.d.ts +16 -0
- package/dist/harness/grok.d.ts.map +1 -0
- package/dist/harness/grok.js +78 -0
- package/dist/harness/grok.js.map +1 -0
- package/dist/harness/jsSdkGatedAdapter.d.ts +102 -0
- package/dist/harness/jsSdkGatedAdapter.d.ts.map +1 -0
- package/dist/harness/jsSdkGatedAdapter.js +139 -0
- package/dist/harness/jsSdkGatedAdapter.js.map +1 -0
- package/dist/harness/langchain.d.ts +22 -0
- package/dist/harness/langchain.d.ts.map +1 -0
- package/dist/harness/langchain.js +33 -0
- package/dist/harness/langchain.js.map +1 -0
- package/dist/harness/langgraph.d.ts +22 -0
- package/dist/harness/langgraph.d.ts.map +1 -0
- package/dist/harness/langgraph.js +80 -0
- package/dist/harness/langgraph.js.map +1 -0
- package/dist/harness/mastra.d.ts +21 -0
- package/dist/harness/mastra.d.ts.map +1 -0
- package/dist/harness/mastra.js +33 -0
- package/dist/harness/mastra.js.map +1 -0
- package/dist/harness/muse.d.ts +22 -0
- package/dist/harness/muse.d.ts.map +1 -0
- package/dist/harness/muse.js +92 -0
- package/dist/harness/muse.js.map +1 -0
- package/dist/harness/n8n.d.ts.map +1 -1
- package/dist/harness/n8n.js +36 -11
- package/dist/harness/n8n.js.map +1 -1
- package/dist/harness/openaiAgents.d.ts +40 -0
- package/dist/harness/openaiAgents.d.ts.map +1 -0
- package/dist/harness/openaiAgents.js +107 -0
- package/dist/harness/openaiAgents.js.map +1 -0
- package/dist/harness/opencode.d.ts +24 -0
- package/dist/harness/opencode.d.ts.map +1 -0
- package/dist/harness/opencode.js +97 -0
- package/dist/harness/opencode.js.map +1 -0
- package/dist/harness/pydanticAi.d.ts +19 -0
- package/dist/harness/pydanticAi.d.ts.map +1 -0
- package/dist/harness/pydanticAi.js +30 -0
- package/dist/harness/pydanticAi.js.map +1 -0
- package/dist/harness/sdkGatedAdapter.d.ts +55 -0
- package/dist/harness/sdkGatedAdapter.d.ts.map +1 -0
- package/dist/harness/sdkGatedAdapter.js +85 -0
- package/dist/harness/sdkGatedAdapter.js.map +1 -0
- package/dist/harness/smolagents.d.ts +22 -0
- package/dist/harness/smolagents.d.ts.map +1 -0
- package/dist/harness/smolagents.js +33 -0
- package/dist/harness/smolagents.js.map +1 -0
- package/dist/harness/strands.d.ts +22 -0
- package/dist/harness/strands.d.ts.map +1 -0
- package/dist/harness/strands.js +35 -0
- package/dist/harness/strands.js.map +1 -0
- package/dist/harness/trueforge.d.ts +25 -0
- package/dist/harness/trueforge.d.ts.map +1 -0
- package/dist/harness/trueforge.js +40 -0
- package/dist/harness/trueforge.js.map +1 -0
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js +70 -0
- package/dist/harness/types.js.map +1 -1
- package/dist/harness/vercelAiSdk.d.ts +31 -0
- package/dist/harness/vercelAiSdk.d.ts.map +1 -0
- package/dist/harness/vercelAiSdk.js +44 -0
- package/dist/harness/vercelAiSdk.js.map +1 -0
- package/dist/harness/xirp.d.ts +43 -0
- package/dist/harness/xirp.d.ts.map +1 -0
- package/dist/harness/xirp.js +95 -0
- package/dist/harness/xirp.js.map +1 -0
- package/dist/lib/api.d.ts +68 -0
- package/dist/lib/api.d.ts.map +1 -1
- package/dist/lib/api.js +108 -67
- package/dist/lib/api.js.map +1 -1
- package/dist/lib/authMessages.d.ts +19 -0
- package/dist/lib/authMessages.d.ts.map +1 -0
- package/dist/lib/authMessages.js +20 -0
- package/dist/lib/authMessages.js.map +1 -0
- package/dist/lib/binaryChecksum.d.ts +12 -0
- package/dist/lib/binaryChecksum.d.ts.map +1 -0
- package/dist/lib/binaryChecksum.js +45 -0
- package/dist/lib/binaryChecksum.js.map +1 -0
- package/dist/lib/binaryOnPath.d.ts +24 -0
- package/dist/lib/binaryOnPath.d.ts.map +1 -0
- package/dist/lib/binaryOnPath.js +31 -0
- package/dist/lib/binaryOnPath.js.map +1 -0
- package/dist/lib/caTrust.d.ts +69 -0
- package/dist/lib/caTrust.d.ts.map +1 -0
- package/dist/lib/caTrust.js +169 -0
- package/dist/lib/caTrust.js.map +1 -0
- package/dist/lib/ciscoScanner.d.ts +178 -0
- package/dist/lib/ciscoScanner.d.ts.map +1 -0
- package/dist/lib/ciscoScanner.js +292 -0
- package/dist/lib/ciscoScanner.js.map +1 -0
- package/dist/lib/decisionsLogRefresh.d.ts +28 -0
- package/dist/lib/decisionsLogRefresh.d.ts.map +1 -0
- package/dist/lib/decisionsLogRefresh.js +54 -0
- package/dist/lib/decisionsLogRefresh.js.map +1 -0
- package/dist/lib/deviceReport.d.ts +26 -0
- package/dist/lib/deviceReport.d.ts.map +1 -0
- package/dist/lib/deviceReport.js +55 -0
- package/dist/lib/deviceReport.js.map +1 -0
- package/dist/lib/elevation.d.ts +58 -0
- package/dist/lib/elevation.d.ts.map +1 -0
- package/dist/lib/elevation.js +83 -0
- package/dist/lib/elevation.js.map +1 -0
- package/dist/lib/enforcementState.d.ts +69 -0
- package/dist/lib/enforcementState.d.ts.map +1 -0
- package/dist/lib/enforcementState.js +113 -0
- package/dist/lib/enforcementState.js.map +1 -0
- package/dist/lib/ensureValkey.d.ts.map +1 -1
- package/dist/lib/ensureValkey.js +2 -2
- package/dist/lib/ensureValkey.js.map +1 -1
- package/dist/lib/envInjector.d.ts.map +1 -1
- package/dist/lib/envInjector.js +22 -4
- package/dist/lib/envInjector.js.map +1 -1
- package/dist/lib/gitHooks.d.ts +7 -2
- package/dist/lib/gitHooks.d.ts.map +1 -1
- package/dist/lib/gitHooks.js +180 -13
- package/dist/lib/gitHooks.js.map +1 -1
- package/dist/lib/gracefulShutdown.d.ts +37 -0
- package/dist/lib/gracefulShutdown.d.ts.map +1 -0
- package/dist/lib/gracefulShutdown.js +57 -0
- package/dist/lib/gracefulShutdown.js.map +1 -0
- package/dist/lib/graphIdentity.d.ts +80 -0
- package/dist/lib/graphIdentity.d.ts.map +1 -0
- package/dist/lib/graphIdentity.js +120 -0
- package/dist/lib/graphIdentity.js.map +1 -0
- package/dist/lib/localTraces.d.ts +61 -0
- package/dist/lib/localTraces.d.ts.map +1 -0
- package/dist/lib/localTraces.js +173 -0
- package/dist/lib/localTraces.js.map +1 -0
- package/dist/lib/mdmManifest.d.ts +73 -0
- package/dist/lib/mdmManifest.d.ts.map +1 -0
- package/dist/lib/mdmManifest.js +190 -0
- package/dist/lib/mdmManifest.js.map +1 -0
- package/dist/lib/onboarding.d.ts.map +1 -1
- package/dist/lib/onboarding.js +60 -1
- package/dist/lib/onboarding.js.map +1 -1
- package/dist/lib/otelPropagation.d.ts +26 -0
- package/dist/lib/otelPropagation.d.ts.map +1 -0
- package/dist/lib/otelPropagation.js +40 -0
- package/dist/lib/otelPropagation.js.map +1 -0
- package/dist/lib/policySnapshot.d.ts +92 -0
- package/dist/lib/policySnapshot.d.ts.map +1 -0
- package/dist/lib/policySnapshot.js +173 -0
- package/dist/lib/policySnapshot.js.map +1 -0
- package/dist/lib/process.d.ts.map +1 -1
- package/dist/lib/process.js +60 -0
- package/dist/lib/process.js.map +1 -1
- package/dist/lib/providerProbe.d.ts +28 -0
- package/dist/lib/providerProbe.d.ts.map +1 -0
- package/dist/lib/providerProbe.js +57 -0
- package/dist/lib/providerProbe.js.map +1 -0
- package/dist/lib/proxyBinary.d.ts +19 -0
- package/dist/lib/proxyBinary.d.ts.map +1 -0
- package/dist/lib/proxyBinary.js +30 -0
- package/dist/lib/proxyBinary.js.map +1 -0
- package/dist/lib/sandbox/firecracker.d.ts +89 -0
- package/dist/lib/sandbox/firecracker.d.ts.map +1 -0
- package/dist/lib/sandbox/firecracker.js +135 -0
- package/dist/lib/sandbox/firecracker.js.map +1 -0
- package/dist/lib/sandbox/index.d.ts +34 -0
- package/dist/lib/sandbox/index.d.ts.map +1 -0
- package/dist/lib/sandbox/index.js +54 -0
- package/dist/lib/sandbox/index.js.map +1 -0
- package/dist/lib/sandbox/oci.d.ts +38 -0
- package/dist/lib/sandbox/oci.d.ts.map +1 -0
- package/dist/lib/sandbox/oci.js +108 -0
- package/dist/lib/sandbox/oci.js.map +1 -0
- package/dist/lib/sandbox/types.d.ts +48 -0
- package/dist/lib/sandbox/types.d.ts.map +1 -0
- package/dist/lib/sandbox/types.js +12 -0
- package/dist/lib/sandbox/types.js.map +1 -0
- package/dist/lib/sopFrontMatter.d.ts +50 -0
- package/dist/lib/sopFrontMatter.d.ts.map +1 -0
- package/dist/lib/sopFrontMatter.js +129 -0
- package/dist/lib/sopFrontMatter.js.map +1 -0
- package/package.json +11 -6
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `intutic judge configure` — generate the local artifacts an on-prem
|
|
3
|
+
* LLM-as-judge needs (LLD #70, model catalog & cohort wizard).
|
|
4
|
+
*
|
|
5
|
+
* Deliberately local-artifacts-only: it writes a `litellm_config.yaml` and
|
|
6
|
+
* prints env / Helm snippets for the operator to apply themselves. It never
|
|
7
|
+
* calls a remote API to flip anything on. `local_judge` is deliberately NOT
|
|
8
|
+
* exposed through `PATCH /api/v1/gateways/:id/config`
|
|
9
|
+
* (`services/control-plane/src/lib/gateway.ts`) — this command respects that
|
|
10
|
+
* boundary by construction, not by omission.
|
|
11
|
+
*
|
|
12
|
+
* The catalog's `ref` (`${provider}/${id}`, e.g. `anthropic/claude-haiku-4-5`)
|
|
13
|
+
* is already LiteLLM's own `litellm_params.model` format, so a selected
|
|
14
|
+
* catalog entry needs no translation — see `infra/compose/litellm_config.yaml`
|
|
15
|
+
* for the hand-written example this generates the same shape as.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
import { type SetupIO } from './setup.js';
|
|
20
|
+
export interface JudgeConfigureOpts {
|
|
21
|
+
/** Where to write the generated litellm_config.yaml. */
|
|
22
|
+
out?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build the litellm_config.yaml content for one judge model — the SAME
|
|
26
|
+
* shape `infra/compose/litellm_config.yaml` hand-writes for its default
|
|
27
|
+
* entry, generated instead of copy-pasted.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildLiteLLMConfigYaml(modelRef: string): string;
|
|
30
|
+
export declare function runJudgeConfigure(opts: JudgeConfigureOpts, io?: SetupIO): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=judge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../src/commands/judge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AAExD,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAOD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB/D;AAwBD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,EAAE,EAAE,GAAE,OAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyD9G"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `intutic judge configure` — generate the local artifacts an on-prem
|
|
3
|
+
* LLM-as-judge needs (LLD #70, model catalog & cohort wizard).
|
|
4
|
+
*
|
|
5
|
+
* Deliberately local-artifacts-only: it writes a `litellm_config.yaml` and
|
|
6
|
+
* prints env / Helm snippets for the operator to apply themselves. It never
|
|
7
|
+
* calls a remote API to flip anything on. `local_judge` is deliberately NOT
|
|
8
|
+
* exposed through `PATCH /api/v1/gateways/:id/config`
|
|
9
|
+
* (`services/control-plane/src/lib/gateway.ts`) — this command respects that
|
|
10
|
+
* boundary by construction, not by omission.
|
|
11
|
+
*
|
|
12
|
+
* The catalog's `ref` (`${provider}/${id}`, e.g. `anthropic/claude-haiku-4-5`)
|
|
13
|
+
* is already LiteLLM's own `litellm_params.model` format, so a selected
|
|
14
|
+
* catalog entry needs no translation — see `infra/compose/litellm_config.yaml`
|
|
15
|
+
* for the hand-written example this generates the same shape as.
|
|
16
|
+
*
|
|
17
|
+
* @module
|
|
18
|
+
*/
|
|
19
|
+
import { writeFileSync } from 'node:fs';
|
|
20
|
+
import { resolve } from 'node:path';
|
|
21
|
+
import pc from 'picocolors';
|
|
22
|
+
import { judgeModelChoices, findCatalogModel, normalizeModelRef } from '@intutic/shared-types';
|
|
23
|
+
import { createClackIO } from './setup.js';
|
|
24
|
+
/** Uppercase `${PROVIDER}_API_KEY` env var LiteLLM reads for this provider's key. */
|
|
25
|
+
function apiKeyEnvVar(providerId) {
|
|
26
|
+
return `${providerId.toUpperCase()}_API_KEY`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build the litellm_config.yaml content for one judge model — the SAME
|
|
30
|
+
* shape `infra/compose/litellm_config.yaml` hand-writes for its default
|
|
31
|
+
* entry, generated instead of copy-pasted.
|
|
32
|
+
*/
|
|
33
|
+
export function buildLiteLLMConfigYaml(modelRef) {
|
|
34
|
+
const { provider, id } = normalizeModelRef(modelRef);
|
|
35
|
+
const litellmModel = provider ? `${provider}/${id}` : id;
|
|
36
|
+
const alias = id || modelRef;
|
|
37
|
+
const apiKeyLine = provider ? ` api_key: os.environ/${apiKeyEnvVar(provider)}\n` : '';
|
|
38
|
+
return (`# Generated by \`intutic judge configure\` (LLD #70). Same shape as\n` +
|
|
39
|
+
`# infra/compose/litellm_config.yaml's hand-written example — add more\n` +
|
|
40
|
+
`# model_list entries by hand following that file if you need more than\n` +
|
|
41
|
+
`# the one judge model this command configured.\n\n` +
|
|
42
|
+
`model_list:\n` +
|
|
43
|
+
` - model_name: ${alias}\n` +
|
|
44
|
+
` litellm_params:\n` +
|
|
45
|
+
` model: ${litellmModel}\n` +
|
|
46
|
+
apiKeyLine +
|
|
47
|
+
`\n` +
|
|
48
|
+
`general_settings:\n` +
|
|
49
|
+
` master_key: os.environ/LITELLM_MASTER_KEY\n`);
|
|
50
|
+
}
|
|
51
|
+
function envBlock(modelAlias) {
|
|
52
|
+
return [
|
|
53
|
+
'# Compose (infra/compose/docker-compose.gateway.yml) or your own env file:',
|
|
54
|
+
'INTUTIC_GATEWAY_LOCAL_JUDGE=true',
|
|
55
|
+
'LITELLM_LOCAL_URL=http://litellm:4000',
|
|
56
|
+
'LITELLM_LOCAL_API_KEY=${LITELLM_MASTER_KEY}',
|
|
57
|
+
`LITELLM_LOCAL_JUDGE_MODEL=${modelAlias}`,
|
|
58
|
+
].join('\n');
|
|
59
|
+
}
|
|
60
|
+
function helmSnippet(modelAlias) {
|
|
61
|
+
return [
|
|
62
|
+
'# tools/helm/intutic-gateway values (or --set on `helm install`):',
|
|
63
|
+
'proxy:',
|
|
64
|
+
' localJudge: true',
|
|
65
|
+
'litellm:',
|
|
66
|
+
' enabled: true',
|
|
67
|
+
` judgeModel: "${modelAlias}"`,
|
|
68
|
+
' configMapName: "" # leave empty to let the chart render one from this litellm_config.yaml; set your own for a pre-existing ConfigMap',
|
|
69
|
+
].join('\n');
|
|
70
|
+
}
|
|
71
|
+
export async function runJudgeConfigure(opts, io = createClackIO()) {
|
|
72
|
+
io.intro(pc.bold('Intutic — On-Prem Judge Configuration'));
|
|
73
|
+
io.log.info('This writes local files only — it never calls a remote API. local_judge is deliberately ' +
|
|
74
|
+
'not remotely configurable; apply what this generates yourself.');
|
|
75
|
+
// Unfiltered: a local LiteLLM instance can serve anything, including a
|
|
76
|
+
// free-text alias not in the catalog at all.
|
|
77
|
+
const CUSTOM = '__custom__';
|
|
78
|
+
const choices = judgeModelChoices({ saasRoutableOnly: false });
|
|
79
|
+
const pick = await io.select({
|
|
80
|
+
message: 'Which model should the on-prem judge use?',
|
|
81
|
+
options: [
|
|
82
|
+
...choices.slice(0, 30).map((m) => ({ value: m.ref, label: `${m.displayName} (${m.provider})` })),
|
|
83
|
+
{ value: CUSTOM, label: 'Enter a custom model reference (provider/model, or a local alias)…' },
|
|
84
|
+
],
|
|
85
|
+
});
|
|
86
|
+
// io.select returns setup.ts's private CANCELLED symbol on Ctrl-C, not
|
|
87
|
+
// exported for identity comparison here — `typeof pick !== 'string'` is
|
|
88
|
+
// the correct guard regardless, since every real answer is a string.
|
|
89
|
+
if (typeof pick !== 'string') {
|
|
90
|
+
io.outro('Cancelled.');
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let modelRef = pick;
|
|
94
|
+
if (pick === CUSTOM) {
|
|
95
|
+
const custom = await io.text({ message: 'Model reference (e.g. anthropic/claude-haiku-4-5, or a local alias like my-org/local-qwen)' });
|
|
96
|
+
if (typeof custom !== 'string' || !custom.trim()) {
|
|
97
|
+
io.outro('Cancelled.');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
modelRef = custom.trim();
|
|
101
|
+
}
|
|
102
|
+
if (!findCatalogModel(modelRef)) {
|
|
103
|
+
io.log.warn(`'${modelRef}' is not in the known model catalog — proceeding as a custom/local alias.`);
|
|
104
|
+
}
|
|
105
|
+
const yaml = buildLiteLLMConfigYaml(modelRef);
|
|
106
|
+
const outPath = resolve(opts.out ?? './litellm_config.yaml');
|
|
107
|
+
writeFileSync(outPath, yaml, 'utf-8');
|
|
108
|
+
io.log.success(`Written to ${outPath}`);
|
|
109
|
+
const { id: modelAlias } = normalizeModelRef(modelRef);
|
|
110
|
+
io.note(envBlock(modelAlias || modelRef), 'Environment');
|
|
111
|
+
io.note(helmSnippet(modelAlias || modelRef), 'Helm values');
|
|
112
|
+
io.log.warn('If this judge model will also be served by the SHARED (non-local) LiteLLM deployment, adding it to ' +
|
|
113
|
+
'infra/kubernetes/base/litellm/config.yaml obligates matching entries in providerPricingService.ts\'s ' +
|
|
114
|
+
'STATIC_FALLBACK_RATES and offline_bundle.json — modelNameParity.test.ts enforces this. Not required ' +
|
|
115
|
+
'for a purely local/on-prem judge.');
|
|
116
|
+
io.outro(pc.bold('Done. Apply the env/Helm values above, then restart the gateway.'));
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=judge.js.map
|
|
@@ -0,0 +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AC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC,CAAA;AACvF,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `intutic org create` — create a real org from an already-authenticated
|
|
3
|
+
* session (tenancy phase 4/7, LLD #65).
|
|
4
|
+
*
|
|
5
|
+
* Real org creation now requires DNS domain-ownership verification (LLD #71
|
|
6
|
+
* follow-up): creating an org auto-provisions a real managed gateway cell,
|
|
7
|
+
* so an org's claimed domain must be proven before `POST /api/v1/orgs` will
|
|
8
|
+
* create it. There's no anonymous-compatible verification flow (no session
|
|
9
|
+
* exists yet to own a verification attempt against), so the old anonymous
|
|
10
|
+
* `POST /api/v1/auth/signup/org` this command used to call is now closed by
|
|
11
|
+
* default in production (`INTUTIC_PUBLIC_ORG_SIGNUP`, off unless a
|
|
12
|
+
* deployment has built its own anonymous verification story) — this command
|
|
13
|
+
* requires `intutic login` first and drives the same flow the dashboard's
|
|
14
|
+
* "Create Organization" modal does: start verification, publish the TXT
|
|
15
|
+
* record it's given, confirm it resolves, then create the org.
|
|
16
|
+
*
|
|
17
|
+
* Server side: services/control-plane/src/services/domainVerificationService.ts,
|
|
18
|
+
* services/control-plane/src/routes/orgs.ts.
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
interface OrgCreateOpts {
|
|
23
|
+
dev?: boolean;
|
|
24
|
+
domain?: string;
|
|
25
|
+
orgName?: string;
|
|
26
|
+
region?: string;
|
|
27
|
+
}
|
|
28
|
+
/** `intutic org create` */
|
|
29
|
+
export declare function runOrgCreate(opts: OrgCreateOpts): Promise<void>;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=org.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../src/commands/org.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AA6DH,UAAU,aAAa;IACrB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AA4CD,2BAA2B;AAC3B,wBAAsB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA+FrE"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `intutic org create` — create a real org from an already-authenticated
|
|
3
|
+
* session (tenancy phase 4/7, LLD #65).
|
|
4
|
+
*
|
|
5
|
+
* Real org creation now requires DNS domain-ownership verification (LLD #71
|
|
6
|
+
* follow-up): creating an org auto-provisions a real managed gateway cell,
|
|
7
|
+
* so an org's claimed domain must be proven before `POST /api/v1/orgs` will
|
|
8
|
+
* create it. There's no anonymous-compatible verification flow (no session
|
|
9
|
+
* exists yet to own a verification attempt against), so the old anonymous
|
|
10
|
+
* `POST /api/v1/auth/signup/org` this command used to call is now closed by
|
|
11
|
+
* default in production (`INTUTIC_PUBLIC_ORG_SIGNUP`, off unless a
|
|
12
|
+
* deployment has built its own anonymous verification story) — this command
|
|
13
|
+
* requires `intutic login` first and drives the same flow the dashboard's
|
|
14
|
+
* "Create Organization" modal does: start verification, publish the TXT
|
|
15
|
+
* record it's given, confirm it resolves, then create the org.
|
|
16
|
+
*
|
|
17
|
+
* Server side: services/control-plane/src/services/domainVerificationService.ts,
|
|
18
|
+
* services/control-plane/src/routes/orgs.ts.
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
import { log } from '../lib/logger.js';
|
|
23
|
+
import { loadCredentials, saveCredentials } from '../config/store.js';
|
|
24
|
+
import { resolveControlPlaneUrl } from '../config/paths.js';
|
|
25
|
+
import { createApiClient } from '../lib/api.js';
|
|
26
|
+
import { newIso } from '@intutic/id';
|
|
27
|
+
import { createInterface } from 'node:readline';
|
|
28
|
+
const NOT_AUTHENTICATED = 'Not authenticated. Run `intutic login` first.';
|
|
29
|
+
async function prompt(question) {
|
|
30
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
rl.question(question, (answer) => {
|
|
33
|
+
rl.close();
|
|
34
|
+
resolve(answer);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Switches the CLI's stored session to a newly created org's default
|
|
40
|
+
* workspace. `GET /api/v1/auth/session?X-Workspace-Id` mints a new
|
|
41
|
+
* refresh token scoped to the target workspace but returns its paired
|
|
42
|
+
* access token only via an httpOnly cookie (browser-only) — this exchanges
|
|
43
|
+
* that refresh token for a JSON-returned access token via the normal
|
|
44
|
+
* refresh endpoint, the same two-step dance a browser reload does
|
|
45
|
+
* implicitly through its cookie jar.
|
|
46
|
+
*/
|
|
47
|
+
async function switchStoredSessionToWorkspace(controlPlaneUrl, apiKey, targetWorkspaceId) {
|
|
48
|
+
const sessionRes = await fetch(`${controlPlaneUrl}/api/v1/auth/session`, {
|
|
49
|
+
method: 'GET',
|
|
50
|
+
headers: {
|
|
51
|
+
'Content-Type': 'application/json',
|
|
52
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
53
|
+
'X-Workspace-Id': targetWorkspaceId,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
if (!sessionRes.ok) {
|
|
57
|
+
const body = await sessionRes.json().catch(() => ({}));
|
|
58
|
+
throw new Error(body.error || `Failed to switch to the new workspace (HTTP ${sessionRes.status})`);
|
|
59
|
+
}
|
|
60
|
+
const session = (await sessionRes.json());
|
|
61
|
+
const refreshRes = await fetch(`${controlPlaneUrl}/api/v1/auth/refresh`, {
|
|
62
|
+
method: 'POST',
|
|
63
|
+
headers: { 'Content-Type': 'application/json' },
|
|
64
|
+
body: JSON.stringify({ refreshToken: session.refreshToken }),
|
|
65
|
+
});
|
|
66
|
+
if (!refreshRes.ok) {
|
|
67
|
+
const body = await refreshRes.json().catch(() => ({}));
|
|
68
|
+
throw new Error(body.error || `Failed to mint a token for the new workspace (HTTP ${refreshRes.status})`);
|
|
69
|
+
}
|
|
70
|
+
const refreshed = (await refreshRes.json());
|
|
71
|
+
return { ...session, accessToken: refreshed.accessToken };
|
|
72
|
+
}
|
|
73
|
+
/** `intutic org create` */
|
|
74
|
+
export async function runOrgCreate(opts) {
|
|
75
|
+
log.header('Intutic — Create Organization');
|
|
76
|
+
const creds = await loadCredentials();
|
|
77
|
+
if (!creds) {
|
|
78
|
+
log.error(NOT_AUTHENTICATED);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
const controlPlaneUrl = resolveControlPlaneUrl(opts.dev);
|
|
82
|
+
log.dim(`Control plane: ${controlPlaneUrl}`);
|
|
83
|
+
const orgName = opts.orgName ?? (await prompt('Organization name: '));
|
|
84
|
+
const domain = opts.domain ?? (await prompt('Domain (e.g. acme.com): '));
|
|
85
|
+
if (!orgName.trim() || !domain.trim()) {
|
|
86
|
+
log.error('Organization name and domain are both required.');
|
|
87
|
+
process.exit(1);
|
|
88
|
+
}
|
|
89
|
+
const client = createApiClient(controlPlaneUrl, creds.apiKey);
|
|
90
|
+
let verification;
|
|
91
|
+
try {
|
|
92
|
+
verification = await client.post('/api/v1/domain-verification/start', {
|
|
93
|
+
domain: domain.trim(),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
log.error(`Failed to start domain verification: ${err instanceof Error ? err.message : String(err)}`);
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
100
|
+
log.success('Verification started. Add this DNS TXT record to prove you own the domain:');
|
|
101
|
+
log.field('Record name', verification.txtRecordName);
|
|
102
|
+
log.field('Record value', verification.txtRecordValue);
|
|
103
|
+
log.dim(' DNS changes can take a few minutes to propagate.');
|
|
104
|
+
let checked;
|
|
105
|
+
while (true) {
|
|
106
|
+
const answer = await prompt('\nPress Enter to check DNS now (or type "q" to abort): ');
|
|
107
|
+
if (answer.trim().toLowerCase() === 'q') {
|
|
108
|
+
log.warn('Aborted. Nothing was created.');
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
checked = await client.get(`/api/v1/domain-verification/${verification.verificationId}`);
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
log.error(`Failed to check verification status: ${err instanceof Error ? err.message : String(err)}`);
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (checked.status === 'verified') {
|
|
119
|
+
log.success('Domain verified.');
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
if (checked.status === 'expired') {
|
|
123
|
+
log.error('This verification has expired. Run this command again to start a new one.');
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
log.warn('TXT record not seen yet — still pending.');
|
|
127
|
+
}
|
|
128
|
+
try {
|
|
129
|
+
const org = await client.post('/api/v1/orgs', {
|
|
130
|
+
orgName: orgName.trim(),
|
|
131
|
+
domain: checked.domain,
|
|
132
|
+
verificationId: verification.verificationId,
|
|
133
|
+
// Omitted entirely when not passed -- the server defaults to its home
|
|
134
|
+
// region and validates against its configured cell regions.
|
|
135
|
+
...(opts.region ? { region: opts.region.trim().toLowerCase() } : {}),
|
|
136
|
+
});
|
|
137
|
+
log.success(`Org "${org.name}" created.`);
|
|
138
|
+
log.field('Org ID', org.orgId);
|
|
139
|
+
log.field('Org plan', org.planTier);
|
|
140
|
+
if (org.region)
|
|
141
|
+
log.field('Gateway region', org.region);
|
|
142
|
+
log.field('Default workspace', org.workspaceId);
|
|
143
|
+
const switched = await switchStoredSessionToWorkspace(controlPlaneUrl, creds.apiKey, org.workspaceId);
|
|
144
|
+
await saveCredentials({
|
|
145
|
+
apiKey: switched.accessToken,
|
|
146
|
+
workspaceId: switched.workspaceId,
|
|
147
|
+
controlPlaneUrl,
|
|
148
|
+
email: switched.email,
|
|
149
|
+
storedAt: newIso(),
|
|
150
|
+
});
|
|
151
|
+
log.dim(` Switched your CLI session into the new org's default workspace. Run \`intutic team list --org ${org.orgId}\` ` +
|
|
152
|
+
'to see it, or `intutic team create --org <org_id> --name <name>` to add another team.');
|
|
153
|
+
}
|
|
154
|
+
catch (err) {
|
|
155
|
+
log.error(`Org creation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
156
|
+
process.exit(1);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=org.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org.js","sourceRoot":"","sources":["../../src/commands/org.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,MAAM,iBAAiB,GAAG,+CAA+C,CAAA;AA0CzE,KAAK,UAAU,MAAM,CAAC,QAAgB;IACpC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC5E,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;YAC/B,EAAE,CAAC,KAAK,EAAE,CAAA;YACV,OAAO,CAAC,MAAM,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC;A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AE,QAAQ,CAAC,WAAW;YACjC,eAAe;YACf,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,QAAQ,EAAE,MAAM,EAAE;SACnB,CAAC,CAAA;QACF,GAAG,CAAC,GAAG,CACL,mGAAmG,GAAG,CAAC,KAAK,KAAK;YAC/G,uFAAuF,CAC1F,CAAA;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CAAC,KAAK,CAAC,wBAAwB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { unsupportedWasmImports, explainWasmImport } from '@intutic/shared-types';
|
|
2
|
+
import { type ApiClient } from '../lib/api.js';
|
|
3
|
+
import type { EnforcementAction, InterventionMode, RiskCategory } from '@intutic/shared-types';
|
|
1
4
|
export declare function runPolicyEnable(policyId: string, opts: {
|
|
2
5
|
dev?: boolean;
|
|
3
6
|
}): Promise<void>;
|
|
@@ -8,25 +11,113 @@ export declare function runPolicyRollback(policyId: string, opts: {
|
|
|
8
11
|
version: string;
|
|
9
12
|
dev?: boolean;
|
|
10
13
|
}): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* A compliance policy exactly as `GET /api/v1/policies` serializes it: the
|
|
16
|
+
* `pcas_policies` columns (`packages/db/src/schema.ts`) after a JSON round
|
|
17
|
+
* trip, so timestamps arrive as ISO strings and nullable columns as `null`.
|
|
18
|
+
*
|
|
19
|
+
* `intutic policy export` prints these verbatim and is the documented way to
|
|
20
|
+
* get policies out of a workspace, which makes this the shape a caller piping
|
|
21
|
+
* the export into another tool depends on. Written out rather than left as
|
|
22
|
+
* `any[]` for that reason: a column rename on the control plane should be a
|
|
23
|
+
* visible change here, not a silently different file on someone's disk.
|
|
24
|
+
*/
|
|
25
|
+
export interface CompliancePolicy {
|
|
26
|
+
policyId: string;
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
name: string;
|
|
29
|
+
description: string | null;
|
|
30
|
+
riskCategory: RiskCategory | null;
|
|
31
|
+
/** Glob matched against the tool name the agent is calling. */
|
|
32
|
+
targetToolPattern: string;
|
|
33
|
+
enforcementAction: EnforcementAction;
|
|
34
|
+
interventionMode: InterventionMode | null;
|
|
35
|
+
priority: number | null;
|
|
36
|
+
/** Free-form JSON match conditions — the column is `jsonb` with no schema. */
|
|
37
|
+
conditions: unknown;
|
|
38
|
+
isActive: boolean | null;
|
|
39
|
+
currentVersion: number;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
}
|
|
11
43
|
export declare function runPolicyExport(opts: {
|
|
12
44
|
all?: boolean;
|
|
13
45
|
dev?: boolean;
|
|
14
46
|
}): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* `intutic policy snapshot` — compile this workspace's policy to disk.
|
|
49
|
+
*
|
|
50
|
+
* The snapshot is the dynamic tier: every harness gate reads
|
|
51
|
+
* `~/.intutic/hooks/policy-snapshot.rules` and enforces the compiled floor and
|
|
52
|
+
* nothing else when it is missing. Until this command existed the only thing
|
|
53
|
+
* that ever wrote it was `intutic connect`, so arming the gates meant running a
|
|
54
|
+
* daemon that also rewrites five harnesses' hook configs, starts a drift
|
|
55
|
+
* watcher and provisions Valkey. This does the one thing.
|
|
56
|
+
*/
|
|
57
|
+
export declare function runPolicySnapshot(opts: {
|
|
58
|
+
dev?: boolean;
|
|
59
|
+
}): Promise<void>;
|
|
15
60
|
/**
|
|
16
61
|
* Minimal RequestContext used to validate a rule instantiates and evaluates
|
|
17
62
|
* before install. Mirrors packages/wasm-sdk/assembly/mock_context_allow.json
|
|
18
63
|
* (embedded so `intutic policy install` works outside the monorepo).
|
|
19
64
|
*/
|
|
20
65
|
export declare const DEFAULT_ALLOW_MOCK: string;
|
|
66
|
+
/**
|
|
67
|
+
* Every host function the proxy registers, declared once on this side.
|
|
68
|
+
*
|
|
69
|
+
* `tools/scripts/check-wasm-host-imports.js` asserts this equals
|
|
70
|
+
* `HOST_IMPORTS` in `packages/proxy/src/wasm/host.rs`. The two had already
|
|
71
|
+
* drifted — this side offered `seed`, the proxy never has — and the drift was
|
|
72
|
+
* invisible because it only surfaced as a per-request warning in a process
|
|
73
|
+
* nobody was reading.
|
|
74
|
+
*/
|
|
75
|
+
export declare const HOST_IMPORT_NAMES: readonly ["log_info", "abort", "trace", "read_referenced_file"];
|
|
76
|
+
/**
|
|
77
|
+
* The guest side of the ABI, resolved from a module's exports.
|
|
78
|
+
*
|
|
79
|
+
* These are exactly the three things the proxy runner needs of a rule
|
|
80
|
+
* (`packages/proxy/src/wasm/runner.rs`): linear memory to pass the context
|
|
81
|
+
* through, an allocator to reserve space in it, and the entry point.
|
|
82
|
+
*
|
|
83
|
+
* Every lookup that produces one is checked at run time — a `.wasm` file can
|
|
84
|
+
* export anything or nothing, and the compiler cannot know which. Declaring
|
|
85
|
+
* the shape and asserting a module has it are separate jobs; `resolveGuestAbi`
|
|
86
|
+
* does the second and names whichever piece is missing.
|
|
87
|
+
*/
|
|
88
|
+
export interface WasmGuestAbi {
|
|
89
|
+
/** Guest linear memory. Every pointer crossing the boundary indexes into it. */
|
|
90
|
+
memory: WebAssembly.Memory;
|
|
91
|
+
/** `allocate(size) -> ptr`, or AssemblyScript's `__new(size, 0) -> ptr`. */
|
|
92
|
+
allocate(size: number): number;
|
|
93
|
+
/** The rule entry point: `evaluate(ptr, len) -> i32` verdict code. */
|
|
94
|
+
evaluate(offset: number, length: number): number;
|
|
95
|
+
}
|
|
21
96
|
/**
|
|
22
97
|
* Instantiate a compiled WASM rule with the standard host imports and run
|
|
23
98
|
* `evaluate` against a JSON-serialized RequestContext. Returns the raw
|
|
24
|
-
* verdict code (0=ALLOW, 1=BLOCK, 2
|
|
99
|
+
* verdict code (0=ALLOW, 1=BLOCK, 3=REASK; 2 is a deprecated block). Throws on any instantiation or
|
|
25
100
|
* ABI failure — callers decide how to surface it.
|
|
26
101
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
102
|
+
/**
|
|
103
|
+
* Re-exported so existing callers and tests keep one import site.
|
|
104
|
+
*
|
|
105
|
+
* The implementations live in `@intutic/shared-types` because three surfaces
|
|
106
|
+
* need them — this CLI, the control plane's upload endpoint, and the SDK test
|
|
107
|
+
* harness — and each having its own copy is precisely how `seed` came to be
|
|
108
|
+
* offered here and never registered by the proxy.
|
|
109
|
+
*/
|
|
110
|
+
export declare const unsupportedImports: typeof unsupportedWasmImports;
|
|
111
|
+
export declare const explainUnsupportedImport: typeof explainWasmImport;
|
|
112
|
+
/**
|
|
113
|
+
* Instantiates a compiled rule with the proxy's host imports and evaluates it
|
|
114
|
+
* against one mock context, returning the raw verdict code.
|
|
115
|
+
*
|
|
116
|
+
* The import set here is the proxy's, not a convenient superset: a rule that
|
|
117
|
+
* links in this sandbox must link in the proxy, or install validation passes
|
|
118
|
+
* something the proxy then silently bypasses.
|
|
119
|
+
*/
|
|
120
|
+
export declare function instantiateAndEvaluate(wasmBuffer: Uint8Array, mockStr: string): Promise<number>;
|
|
30
121
|
export declare function runPolicyTest(opts: {
|
|
31
122
|
wasm: string;
|
|
32
123
|
mock: string;
|
|
@@ -61,15 +152,58 @@ export declare function buildCompileArgs(opts: {
|
|
|
61
152
|
out?: string;
|
|
62
153
|
debug?: boolean;
|
|
63
154
|
}): string[];
|
|
155
|
+
/** `GET /api/v1/rule-candidates/:id/source`, as the control plane serves it. */
|
|
156
|
+
export interface CandidateSource {
|
|
157
|
+
candidateId: string;
|
|
158
|
+
guardrailId: string | null;
|
|
159
|
+
status: string;
|
|
160
|
+
source: string;
|
|
161
|
+
sourceSha256: string;
|
|
162
|
+
}
|
|
163
|
+
/** Where a fetched candidate source is written: two directories below the project root, which is what its `../../assembly/index` import needs. */
|
|
164
|
+
export declare function candidateSourcePath(candidateId: string): string;
|
|
165
|
+
export declare function candidateOutPath(candidateId: string): string;
|
|
166
|
+
export declare function sourceSha256Of(source: string): string;
|
|
167
|
+
/**
|
|
168
|
+
* Fetch a candidate's source of record and check it against the hash the
|
|
169
|
+
* server states. A body that does not hash to its own `sourceSha256` is not
|
|
170
|
+
* compiled: `/bundle` would refuse the result anyway, and a mismatch here
|
|
171
|
+
* means something between the control plane and this process changed bytes.
|
|
172
|
+
*/
|
|
173
|
+
export declare function fetchCandidateSource(client: Pick<ApiClient, 'getWithStatus'>, candidateId: string): Promise<CandidateSource>;
|
|
174
|
+
/**
|
|
175
|
+
* Upload a compiled bundle to its candidate together with the hash of the
|
|
176
|
+
* source it was compiled from, and print the gate results. The server
|
|
177
|
+
* recomputes the hash from the candidate row; a bundle built from anything
|
|
178
|
+
* else is refused before a gate runs.
|
|
179
|
+
*/
|
|
180
|
+
export declare function uploadCandidateBundle(client: Pick<ApiClient, 'postForm'>, candidateId: string, wasmPath: string, sourceSha256: string): Promise<void>;
|
|
64
181
|
export declare function runPolicyCompile(opts: {
|
|
65
182
|
src?: string;
|
|
66
183
|
out?: string;
|
|
67
184
|
debug?: boolean;
|
|
185
|
+
candidate?: string;
|
|
186
|
+
upload?: boolean;
|
|
187
|
+
dev?: boolean;
|
|
68
188
|
}): Promise<void>;
|
|
69
189
|
export declare function runPolicyInstall(opts: {
|
|
70
190
|
wasm: string;
|
|
71
191
|
name?: string;
|
|
72
192
|
priority?: string;
|
|
73
193
|
}): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* `intutic policy replay <ruleId>` — "prove before enforce": run an installed
|
|
196
|
+
* or not-yet-active rule against a sample of this workspace's own recent
|
|
197
|
+
* traffic and report what it would have done, without touching enforcement.
|
|
198
|
+
*
|
|
199
|
+
* Uses `postWithStatus` rather than `post`: the 422 the route returns for too
|
|
200
|
+
* little sampled traffic is an answer this command exists to report, not a
|
|
201
|
+
* request failure to throw past.
|
|
202
|
+
*/
|
|
203
|
+
export declare function runPolicyReplay(ruleId: string, opts: {
|
|
204
|
+
limit?: string;
|
|
205
|
+
since?: string;
|
|
206
|
+
dev?: boolean;
|
|
207
|
+
}): Promise<void>;
|
|
74
208
|
export declare function runPolicyListLocal(): Promise<void>;
|
|
75
209
|
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/commands/policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/commands/policy.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;AAE/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AA0C9F,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB9F;AAED,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB/F;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,GACvC,OAAO,CAAC,IAAI,CAAC,CA6Bf;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC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