@jinn-network/jinn-layer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/contribution-adapter.d.ts +18 -0
- package/dist/adapters/contribution-adapter.js +134 -0
- package/dist/adapters/corpus-adapter.d.ts +12 -0
- package/dist/adapters/corpus-adapter.js +212 -0
- package/dist/adapters/index.d.ts +17 -0
- package/dist/adapters/index.js +17 -0
- package/dist/adapters/json-map-store.d.ts +4 -0
- package/dist/adapters/json-map-store.js +31 -0
- package/dist/adapters/local-learning-adapter.d.ts +25 -0
- package/dist/adapters/local-learning-adapter.js +49 -0
- package/dist/adapters/skills-adapter.d.ts +8 -0
- package/dist/adapters/skills-adapter.js +55 -0
- package/dist/admission-policy.d.ts +38 -0
- package/dist/admission-policy.js +17 -0
- package/dist/bin/jinn-distill-mcp.d.ts +2 -0
- package/dist/bin/jinn-distill-mcp.js +10 -0
- package/dist/bin/jinn-layer.d.ts +7 -0
- package/dist/bin/jinn-layer.js +15 -0
- package/dist/bridge-fetch-evidence.d.ts +102 -0
- package/dist/bridge-fetch-evidence.js +677 -0
- package/dist/bridge-verdict-source.d.ts +47 -0
- package/dist/bridge-verdict-source.js +216 -0
- package/dist/bridge.d.ts +247 -0
- package/dist/bridge.js +439 -0
- package/dist/capture.d.ts +98 -0
- package/dist/capture.js +617 -0
- package/dist/cli.d.ts +148 -0
- package/dist/cli.js +2221 -0
- package/dist/cluster-selection.d.ts +34 -0
- package/dist/cluster-selection.js +135 -0
- package/dist/cluster.d.ts +89 -0
- package/dist/cluster.js +142 -0
- package/dist/consume.d.ts +139 -0
- package/dist/consume.js +280 -0
- package/dist/corpus-probes.d.ts +61 -0
- package/dist/corpus-probes.js +120 -0
- package/dist/corpus-store.d.ts +16 -0
- package/dist/corpus-store.js +101 -0
- package/dist/distill-captures.d.ts +56 -0
- package/dist/distill-captures.js +283 -0
- package/dist/distill-feedback.d.ts +20 -0
- package/dist/distill-feedback.js +30 -0
- package/dist/distill-llm.d.ts +138 -0
- package/dist/distill-llm.js +438 -0
- package/dist/distill-mcp-server.d.ts +30 -0
- package/dist/distill-mcp-server.js +281 -0
- package/dist/distill-mode.d.ts +62 -0
- package/dist/distill-mode.js +107 -0
- package/dist/distill-progress.d.ts +78 -0
- package/dist/distill-progress.js +69 -0
- package/dist/distill-prompt.d.ts +34 -0
- package/dist/distill-prompt.js +85 -0
- package/dist/distill-render.d.ts +123 -0
- package/dist/distill-render.js +303 -0
- package/dist/distill-runs.d.ts +28 -0
- package/dist/distill-runs.js +39 -0
- package/dist/distill-traces.d.ts +67 -0
- package/dist/distill-traces.js +211 -0
- package/dist/distill.d.ts +180 -0
- package/dist/distill.js +337 -0
- package/dist/distiller.d.ts +118 -0
- package/dist/distiller.js +142 -0
- package/dist/envelope.d.ts +9 -0
- package/dist/envelope.js +9 -0
- package/dist/eval-prep.d.ts +129 -0
- package/dist/eval-prep.js +523 -0
- package/dist/execution-publish.d.ts +62 -0
- package/dist/execution-publish.js +72 -0
- package/dist/gate.d.ts +39 -0
- package/dist/gate.js +106 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +50 -0
- package/dist/ipfs-cid.d.ts +18 -0
- package/dist/ipfs-cid.js +149 -0
- package/dist/layer-default.d.ts +3 -0
- package/dist/layer-default.js +10 -0
- package/dist/ledger.d.ts +62 -0
- package/dist/ledger.js +104 -0
- package/dist/measurement.d.ts +90 -0
- package/dist/measurement.js +134 -0
- package/dist/path-safety.d.ts +19 -0
- package/dist/path-safety.js +303 -0
- package/dist/pipeline.d.ts +94 -0
- package/dist/pipeline.js +124 -0
- package/dist/plugin-wiring.d.ts +4 -0
- package/dist/plugin-wiring.js +54 -0
- package/dist/preview.d.ts +31 -0
- package/dist/preview.js +28 -0
- package/dist/process-contract.d.ts +303 -0
- package/dist/process-contract.js +118 -0
- package/dist/publish-skill.d.ts +86 -0
- package/dist/publish-skill.js +116 -0
- package/dist/publish.d.ts +294 -0
- package/dist/publish.js +1090 -0
- package/dist/scripts/scan-skills-registry.d.ts +24 -0
- package/dist/scripts/scan-skills-registry.js +207 -0
- package/dist/seed-import/curated-batch.d.ts +36 -0
- package/dist/seed-import/curated-batch.js +103 -0
- package/dist/seed-import/episode-execute.d.ts +50 -0
- package/dist/seed-import/episode-execute.js +235 -0
- package/dist/seed-import/episode-fetch.d.ts +119 -0
- package/dist/seed-import/episode-fetch.js +137 -0
- package/dist/seed-import/episode-plan.d.ts +11 -0
- package/dist/seed-import/episode-plan.js +27 -0
- package/dist/seed-import/episode-report.d.ts +39 -0
- package/dist/seed-import/episode-report.js +36 -0
- package/dist/seed-import/execute.d.ts +61 -0
- package/dist/seed-import/execute.js +245 -0
- package/dist/seed-import/fetch.d.ts +62 -0
- package/dist/seed-import/fetch.js +82 -0
- package/dist/seed-import/licence.d.ts +17 -0
- package/dist/seed-import/licence.js +36 -0
- package/dist/seed-import/plan.d.ts +10 -0
- package/dist/seed-import/plan.js +21 -0
- package/dist/seed-import/report.d.ts +34 -0
- package/dist/seed-import/report.js +31 -0
- package/dist/seed-import/state.d.ts +72 -0
- package/dist/seed-import/state.js +120 -0
- package/dist/signal.d.ts +36 -0
- package/dist/signal.js +48 -0
- package/dist/signing.d.ts +8 -0
- package/dist/signing.js +21 -0
- package/dist/skill-package.d.ts +70 -0
- package/dist/skill-package.js +141 -0
- package/dist/skill.d.ts +21 -0
- package/dist/skill.js +77 -0
- package/dist/snapshot-transcript.d.ts +54 -0
- package/dist/snapshot-transcript.js +117 -0
- package/dist/three-arm-run.d.ts +27 -0
- package/dist/three-arm-run.js +41 -0
- package/package.json +60 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* jinn-layer CLI — the human surface over the harness-layer consume path.
|
|
3
|
+
*
|
|
4
|
+
* Verbs (same command-module spirit as client/src/cli/commands/, kept
|
|
5
|
+
* self-contained so the package stays embeddable):
|
|
6
|
+
*
|
|
7
|
+
* jinn-layer corpus search "<query>" [--limit N] [--json]
|
|
8
|
+
* jinn-layer corpus get <ref> [--json] [--out <dir>]
|
|
9
|
+
* jinn-layer capture preview <task-file> [--json]
|
|
10
|
+
*
|
|
11
|
+
* Output is human-readable by default (this is a discovery surface);
|
|
12
|
+
* --json emits the typed result as JSON (artifact content base64-encoded).
|
|
13
|
+
* `capture preview` renders the scrub report: the redaction diff (original
|
|
14
|
+
* values shown on the terminal only — they never leave the machine) and the
|
|
15
|
+
* envelope exactly as it would publish. Its --json output strips the
|
|
16
|
+
* original values so it stays persistence-safe.
|
|
17
|
+
*/
|
|
18
|
+
import { type HarnessLayer } from './consume.js';
|
|
19
|
+
import { type JinnPluginDeps } from '@jinn-network/plugin';
|
|
20
|
+
import { type HarnessPublishDeps } from './publish.js';
|
|
21
|
+
import { type SeedSource } from './seed-import/fetch.js';
|
|
22
|
+
import { type EpisodeSource } from './seed-import/episode-fetch.js';
|
|
23
|
+
import { type SeedImportStateStore } from './seed-import/state.js';
|
|
24
|
+
import { type VerdictSource } from './bridge-verdict-source.js';
|
|
25
|
+
import { type EvidenceFetcherPorts, type ExecutionEnvelopeAuthenticator, type PublisherSafeResolver, type VerifierFactsResolver } from './bridge-fetch-evidence.js';
|
|
26
|
+
import { type DistillMode } from './distill-mode.js';
|
|
27
|
+
import type { AttemptRef, BridgeEvidence } from './bridge.js';
|
|
28
|
+
import type { DistillCluster, DistillLLMOutput, MetaDistillLLMOutput } from './distill.js';
|
|
29
|
+
import { type ProgressStream } from './distill-progress.js';
|
|
30
|
+
import type { MetaCluster } from './cluster.js';
|
|
31
|
+
export type DistillProvider = 'claude' | 'codex';
|
|
32
|
+
export interface DistillPorts {
|
|
33
|
+
distill: (cluster: DistillCluster) => Promise<DistillLLMOutput>;
|
|
34
|
+
metaDistill: (cluster: MetaCluster) => Promise<MetaDistillLLMOutput>;
|
|
35
|
+
}
|
|
36
|
+
/** Injectable deps for `distill run` (tests). Production defaults build the live wiring. */
|
|
37
|
+
export interface DistillRunCliDeps {
|
|
38
|
+
/** Ledger verdict-row source (both polarities). Default: live indexer. */
|
|
39
|
+
verdictSource?: VerdictSource;
|
|
40
|
+
/** Fetch the patch + problem statement for an attempt. Default: live gateway + indexer. */
|
|
41
|
+
fetchEvidence?: (ref: AttemptRef) => Promise<BridgeEvidence>;
|
|
42
|
+
/**
|
|
43
|
+
* Production composition hook for authenticated SWE verifier facts. Receives
|
|
44
|
+
* the CLI's bounded IPFS reader so solver-specific proof resolution cannot
|
|
45
|
+
* introduce an unbounded duplicate gateway path.
|
|
46
|
+
*/
|
|
47
|
+
verifierFactsResolverFactory?: (ipfs: EvidenceFetcherPorts['ipfs']) => VerifierFactsResolver;
|
|
48
|
+
/** Production composition hook for raw execution-envelope authentication. */
|
|
49
|
+
authenticateEnvelope?: ExecutionEnvelopeAuthenticator;
|
|
50
|
+
/** Production composition hook for ERC-8004 publisher → Safe resolution. */
|
|
51
|
+
resolvePublisherSafe?: PublisherSafeResolver;
|
|
52
|
+
/** The LLM distill port. Default: createClaudeDistiller. */
|
|
53
|
+
distill?: (cluster: DistillCluster) => Promise<DistillLLMOutput>;
|
|
54
|
+
/** The stage-2 meta LLM port. Default: createClaudeMetaDistiller. */
|
|
55
|
+
metaDistill?: (cluster: MetaCluster) => Promise<MetaDistillLLMOutput>;
|
|
56
|
+
/** Provider-aware port factory (tests/embedders). Default: Claude or Codex CLI ports. */
|
|
57
|
+
distillerFactory?: (provider: DistillProvider, model: string, timeoutMs?: number) => DistillPorts;
|
|
58
|
+
/** Layer-1 evidence publish deps. Default: live testnet wiring from env. */
|
|
59
|
+
publishDeps?: HarnessPublishDeps;
|
|
60
|
+
/** Held-out slate instance ids. Default: the active swe-rebench-v2 slate. */
|
|
61
|
+
slateInstanceIds?: Set<string>;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Injectable deps for the rung-1 `distill` own-captures loop (tests). Production
|
|
65
|
+
* defaults resolve the distill port from the provider + distiller model.
|
|
66
|
+
*/
|
|
67
|
+
export interface DistillCliDeps {
|
|
68
|
+
/** The LLM distill port. Default: provider factory over the resolved distiller model. */
|
|
69
|
+
distill?: (cluster: DistillCluster) => Promise<DistillLLMOutput>;
|
|
70
|
+
/** Provider-aware port factory (tests). Default: Claude or Codex CLI ports. */
|
|
71
|
+
distillerFactory?: (provider: DistillProvider, model: string, timeoutMs?: number) => DistillPorts;
|
|
72
|
+
/**
|
|
73
|
+
* Held-out slate ids — defence-in-depth over the gate + contamination scan.
|
|
74
|
+
* Own captures rarely intersect a public slate, so this defaults to empty.
|
|
75
|
+
*/
|
|
76
|
+
slateInstanceIds?: Set<string>;
|
|
77
|
+
/**
|
|
78
|
+
* First-run consent resolver (#1490). Called only when the persisted mode is
|
|
79
|
+
* `unset` and the invocation is interactive. Tests inject a fake so the
|
|
80
|
+
* consent flow needs no TTY; the default is a readline prompt (see
|
|
81
|
+
* {@link readlineConsentPrompt}), used only when `isTty`.
|
|
82
|
+
*/
|
|
83
|
+
promptConsent?: () => Promise<DistillMode>;
|
|
84
|
+
/**
|
|
85
|
+
* Whether to treat this invocation as interactive (tests). Default:
|
|
86
|
+
* `process.stdout.isTTY && process.stdin.isTTY`. When false and the mode is
|
|
87
|
+
* unset, the first run takes the safe default (defer) without persisting — a
|
|
88
|
+
* later interactive run still gets the prompt. It also gates the install
|
|
89
|
+
* review/prompt: non-interactive stages only (nothing installed).
|
|
90
|
+
*/
|
|
91
|
+
isTty?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Install-choice resolver (#1490). Called only when a LOCAL run produced
|
|
94
|
+
* skills, no `--install` flag was given, and the invocation is interactive.
|
|
95
|
+
* Returns the choice over the produced skill names. Tests inject a fake; the
|
|
96
|
+
* default is a readline prompt (see {@link readlineInstallPrompt}).
|
|
97
|
+
*/
|
|
98
|
+
promptInstall?: (skillNames: string[]) => Promise<InstallChoice>;
|
|
99
|
+
/**
|
|
100
|
+
* Where `--progress ndjson` events are written (#1533). Default:
|
|
101
|
+
* `process.stderr` — stdout stays reserved for the `--json` result.
|
|
102
|
+
*/
|
|
103
|
+
progressStream?: ProgressStream;
|
|
104
|
+
}
|
|
105
|
+
/** The install-review choice: everything, just the first, or none (stage only). */
|
|
106
|
+
export type InstallChoice = 'all' | 'first' | 'none';
|
|
107
|
+
export interface JinnLayerWriter {
|
|
108
|
+
write(value: string): boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface RunJinnLayerCliOptions {
|
|
111
|
+
/** Injectable layer (tests). Default: createHarnessLayer() with env overrides. */
|
|
112
|
+
layer?: HarnessLayer;
|
|
113
|
+
/** Injectable publish deps (tests). Default: live testnet wiring from env. */
|
|
114
|
+
publishDeps?: HarnessPublishDeps;
|
|
115
|
+
/** Injectable seed source (tests). Default: GitHub source over --source list. */
|
|
116
|
+
seedSource?: SeedSource;
|
|
117
|
+
/** Injectable evidence-episode seed source (tests). Default: local dir source over --episodes-dir. */
|
|
118
|
+
episodeSource?: EpisodeSource;
|
|
119
|
+
/** Injectable seed-import idempotency state (tests). Default: file-backed store (real `seed execute` runs). */
|
|
120
|
+
seedImportState?: SeedImportStateStore;
|
|
121
|
+
/** Injectable distill-pipeline deps (tests). Default: live wiring per field. */
|
|
122
|
+
distillRunDeps?: DistillRunCliDeps;
|
|
123
|
+
/** Injectable rung-1 own-captures deps (tests). Default: provider-resolved distill port. */
|
|
124
|
+
distillDeps?: DistillCliDeps;
|
|
125
|
+
/** Injectable stdin reader for versioned process commands. */
|
|
126
|
+
reader?: () => Promise<string>;
|
|
127
|
+
/** Real ports are used by default; tests can override any subset. */
|
|
128
|
+
pluginOverrides?: Partial<JinnPluginDeps>;
|
|
129
|
+
writer?: JinnLayerWriter;
|
|
130
|
+
}
|
|
131
|
+
export interface BoundedIpfsJsonFetcherOptions {
|
|
132
|
+
gateway: string;
|
|
133
|
+
/** Default ceiling for ordinary evidence hops. Defaults to 64 MiB. */
|
|
134
|
+
defaultMaxBytes?: number;
|
|
135
|
+
/** One deadline covers response headers and streaming body reads. */
|
|
136
|
+
timeoutMs?: number;
|
|
137
|
+
fetchImpl?: typeof fetch;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Build the live IPFS JSON port with a caller-selectable finite byte ceiling.
|
|
141
|
+
*
|
|
142
|
+
* The stream is cancelled on the first over-limit chunk, so hostile evidence
|
|
143
|
+
* is never fully buffered before the cap is enforced. The verifier resolver
|
|
144
|
+
* uses the second argument for its tighter authenticated-artifact ceiling.
|
|
145
|
+
*/
|
|
146
|
+
export declare function createBoundedIpfsJsonFetcher(options: BoundedIpfsJsonFetcherOptions): EvidenceFetcherPorts['ipfs'];
|
|
147
|
+
/** Returns the process exit code (0 = success). */
|
|
148
|
+
export declare function runJinnLayerCli(argv: string[], opts?: RunJinnLayerCliOptions): Promise<number>;
|