@pleri/olam-cli 0.1.159 → 0.1.160
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/agent-stream/agent-sdk-to-chunks.js +3 -0
- package/dist/agent-stream/driver-runner.js +9 -4
- package/dist/agent-stream/host-driver-launch.js +48 -0
- package/dist/commands/flywheel/check-persona-skeleton.d.ts +30 -2
- package/dist/commands/flywheel/check-persona-skeleton.d.ts.map +1 -1
- package/dist/commands/flywheel/check-persona-skeleton.js +143 -6
- package/dist/commands/flywheel/check-persona-skeleton.js.map +1 -1
- package/dist/commands/flywheel/diversity-check.d.ts +12 -2
- package/dist/commands/flywheel/diversity-check.d.ts.map +1 -1
- package/dist/commands/flywheel/diversity-check.js +56 -6
- package/dist/commands/flywheel/diversity-check.js.map +1 -1
- package/dist/commands/flywheel/index.d.ts.map +1 -1
- package/dist/commands/flywheel/index.js +2 -0
- package/dist/commands/flywheel/index.js.map +1 -1
- package/dist/commands/flywheel/install-shims.d.ts +36 -3
- package/dist/commands/flywheel/install-shims.d.ts.map +1 -1
- package/dist/commands/flywheel/install-shims.js +118 -7
- package/dist/commands/flywheel/install-shims.js.map +1 -1
- package/dist/commands/flywheel/k10-measure.d.ts +12 -2
- package/dist/commands/flywheel/k10-measure.d.ts.map +1 -1
- package/dist/commands/flywheel/k10-measure.js +55 -6
- package/dist/commands/flywheel/k10-measure.js.map +1 -1
- package/dist/commands/flywheel/migrate-overlays.d.ts +115 -0
- package/dist/commands/flywheel/migrate-overlays.d.ts.map +1 -0
- package/dist/commands/flywheel/migrate-overlays.js +766 -0
- package/dist/commands/flywheel/migrate-overlays.js.map +1 -0
- package/dist/commands/flywheel/sanitize-persona-output.d.ts +33 -2
- package/dist/commands/flywheel/sanitize-persona-output.d.ts.map +1 -1
- package/dist/commands/flywheel/sanitize-persona-output.js +94 -6
- package/dist/commands/flywheel/sanitize-persona-output.js.map +1 -1
- package/dist/commands/memory/index.d.ts.map +1 -1
- package/dist/commands/memory/index.js +2 -0
- package/dist/commands/memory/index.js.map +1 -1
- package/dist/commands/memory/install-hooks.d.ts +22 -0
- package/dist/commands/memory/install-hooks.d.ts.map +1 -0
- package/dist/commands/memory/install-hooks.js +156 -0
- package/dist/commands/memory/install-hooks.js.map +1 -0
- package/dist/commands/skills-doctor.js +2 -2
- package/dist/commands/skills-doctor.js.map +1 -1
- package/dist/commands/skills-source.d.ts.map +1 -1
- package/dist/commands/skills-source.js +10 -0
- package/dist/commands/skills-source.js.map +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +169 -1
- package/dist/commands/skills.js.map +1 -1
- package/dist/image-digests.json +7 -7
- package/dist/index.js +3046 -718
- package/dist/lib/flywheel-probes.d.ts +58 -0
- package/dist/lib/flywheel-probes.d.ts.map +1 -0
- package/dist/lib/flywheel-probes.js +163 -0
- package/dist/lib/flywheel-probes.js.map +1 -0
- package/dist/lib/shim-generator.d.ts +51 -0
- package/dist/lib/shim-generator.d.ts.map +1 -0
- package/dist/lib/shim-generator.js +88 -0
- package/dist/lib/shim-generator.js.map +1 -0
- package/dist/lib/skills-apply-overlays.d.ts +35 -0
- package/dist/lib/skills-apply-overlays.d.ts.map +1 -0
- package/dist/lib/skills-apply-overlays.js +243 -0
- package/dist/lib/skills-apply-overlays.js.map +1 -0
- package/dist/mcp-server.js +1106 -453
- package/hermes-bundle/version.json +1 -1
- package/host-cp/k8s/manifests/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +1 -1
- package/host-cp/k8s/manifests/memory-service/30-configmap.yaml +11 -0
- package/host-cp/k8s/manifests/memory-service/35-configmap-iii-config.yaml +76 -0
- package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +11 -1
- package/host-cp/src/crystallize-planning.mjs +261 -0
- package/host-cp/src/plan-chat-service.mjs +84 -2
- package/host-cp/src/planning-sessions.mjs +270 -0
- package/package.json +1 -1
|
@@ -213,6 +213,7 @@ function blockToChunkDraft(block, ctx) {
|
|
|
213
213
|
seq: ctx.seq,
|
|
214
214
|
role: 'assistant',
|
|
215
215
|
kind: 'text',
|
|
216
|
+
chunk_type: 'text',
|
|
216
217
|
chunk: text,
|
|
217
218
|
created_at: ctx.createdAt,
|
|
218
219
|
};
|
|
@@ -226,6 +227,7 @@ function blockToChunkDraft(block, ctx) {
|
|
|
226
227
|
seq: ctx.seq,
|
|
227
228
|
role: 'tool',
|
|
228
229
|
kind: 'tool-call',
|
|
230
|
+
chunk_type: 'tool_use',
|
|
229
231
|
chunk: JSON.stringify({
|
|
230
232
|
tool_use_id: tool.id,
|
|
231
233
|
name: tool.name,
|
|
@@ -244,6 +246,7 @@ function blockToChunkDraft(block, ctx) {
|
|
|
244
246
|
seq: ctx.seq,
|
|
245
247
|
role: 'assistant',
|
|
246
248
|
kind: 'text',
|
|
249
|
+
chunk_type: 'text',
|
|
247
250
|
chunk: JSON.stringify(block),
|
|
248
251
|
created_at: ctx.createdAt,
|
|
249
252
|
};
|
|
@@ -83,6 +83,10 @@ export const DEFAULT_SYSTEM_PROMPT_APPEND = `You are the driver agent inside an
|
|
|
83
83
|
*/
|
|
84
84
|
export function buildSdkOptions(input) {
|
|
85
85
|
const driverToolsEnabled = process.env.AGENT_DRIVER_TOOLS_ENABLED === '1';
|
|
86
|
+
const baseAllowedTools = [];
|
|
87
|
+
const allowedTools = input.extraAllowedTools
|
|
88
|
+
? [...baseAllowedTools, ...input.extraAllowedTools]
|
|
89
|
+
: baseAllowedTools;
|
|
86
90
|
return {
|
|
87
91
|
systemPrompt: {
|
|
88
92
|
type: 'preset',
|
|
@@ -90,7 +94,7 @@ export function buildSdkOptions(input) {
|
|
|
90
94
|
...(input.systemPromptAppend ? { append: input.systemPromptAppend } : {}),
|
|
91
95
|
},
|
|
92
96
|
// Empty allowlist = strict coordinator (no tools); undefined = full preset tools.
|
|
93
|
-
...(driverToolsEnabled ? {} : { allowedTools
|
|
97
|
+
...(driverToolsEnabled ? {} : { allowedTools }),
|
|
94
98
|
effort: 'low',
|
|
95
99
|
thinking: { type: 'disabled' },
|
|
96
100
|
model: 'claude-sonnet-4-6',
|
|
@@ -110,7 +114,7 @@ export function buildSdkOptions(input) {
|
|
|
110
114
|
* - The `prompt` is passed through unchanged.
|
|
111
115
|
*/
|
|
112
116
|
export function createSdkQuery(query) {
|
|
113
|
-
return ({ prompt, abortSignal, systemPromptAppend }) => {
|
|
117
|
+
return ({ prompt, abortSignal, systemPromptAppend, extraAllowedTools }) => {
|
|
114
118
|
// eslint-disable-next-line no-console
|
|
115
119
|
console.error(`[driver] sdkQuery fired (prompt: ${typeof prompt === 'string' ? `${prompt.length} chars` : 'AsyncIterable<SdkUserMessage>'})`);
|
|
116
120
|
// Forward the runDriver-owned abortSignal to a fresh AbortController
|
|
@@ -126,7 +130,7 @@ export function createSdkQuery(query) {
|
|
|
126
130
|
});
|
|
127
131
|
}
|
|
128
132
|
const options = {
|
|
129
|
-
...buildSdkOptions({ systemPromptAppend }),
|
|
133
|
+
...buildSdkOptions({ systemPromptAppend, extraAllowedTools }),
|
|
130
134
|
abortController: sdkAbortController,
|
|
131
135
|
};
|
|
132
136
|
return query({ prompt, options });
|
|
@@ -139,7 +143,7 @@ export function createSdkQuery(query) {
|
|
|
139
143
|
* (SIGTERM via the supervisor → the abortSignal here).
|
|
140
144
|
*/
|
|
141
145
|
export function runDriver(opts) {
|
|
142
|
-
const { hostCpUrl, bearer, worldId, sessionId, systemPromptAppend = DEFAULT_SYSTEM_PROMPT_APPEND, sdkQuery, abortSignal: externalSignal, subscribeImpl = subscribeToChunks, postChunkImpl = (url, b) => makeHostCpChunkPoster({ sidecarUrl: url, bearer: b }), } = opts;
|
|
146
|
+
const { hostCpUrl, bearer, worldId, sessionId, systemPromptAppend = DEFAULT_SYSTEM_PROMPT_APPEND, extraAllowedTools, sdkQuery, abortSignal: externalSignal, subscribeImpl = subscribeToChunks, postChunkImpl = (url, b) => makeHostCpChunkPoster({ sidecarUrl: url, bearer: b }), } = opts;
|
|
143
147
|
const controller = new AbortController();
|
|
144
148
|
if (externalSignal) {
|
|
145
149
|
if (externalSignal.aborted)
|
|
@@ -241,6 +245,7 @@ export function runDriver(opts) {
|
|
|
241
245
|
prompt: userMessageStream(),
|
|
242
246
|
abortSignal: signal,
|
|
243
247
|
systemPromptAppend,
|
|
248
|
+
extraAllowedTools,
|
|
244
249
|
});
|
|
245
250
|
await streamMultiTurnSdkToChunks({
|
|
246
251
|
messages,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* host-driver-launch.ts — Phase J J4 thin host-side launcher for the
|
|
3
|
+
* planning-driver.
|
|
4
|
+
*
|
|
5
|
+
* HOST_DRIVER_CONTRACT: this module ONLY overrides the launch path —
|
|
6
|
+
* every agent logic decision delegates to `runDriver()` in
|
|
7
|
+
* driver-runner.ts. Adding a new options field or behavioural branch
|
|
8
|
+
* here is a code-smell; extend `DriverRunnerOptions` instead so the
|
|
9
|
+
* world-side path inherits.
|
|
10
|
+
*
|
|
11
|
+
* Why a separate launcher: `runDriver`'s `main()` entry reads
|
|
12
|
+
* `WORLD_ID` / `SESSION_ID` / `HOST_CP_URL` / `HOST_CP_BEARER` from
|
|
13
|
+
* env and `await import('@anthropic-ai/claude-agent-sdk')`. That shape
|
|
14
|
+
* suits the supervisor-fork-into-devbox path; on the host process
|
|
15
|
+
* we already have those values in JS scope (no env injection across
|
|
16
|
+
* a container boundary), so we bypass `main()` and call `runDriver()`
|
|
17
|
+
* directly with the planning-agent system-prompt-append default.
|
|
18
|
+
*/
|
|
19
|
+
import { PLANNING_SYSTEM_PROMPT } from '../prompts/planning-agent.js';
|
|
20
|
+
import { runDriver, } from './driver-runner.js';
|
|
21
|
+
/**
|
|
22
|
+
* Launch a planning-driver in the host process. Delegates everything
|
|
23
|
+
* substantive to `runDriver`; this function only translates the
|
|
24
|
+
* host-side options shape into `DriverRunnerOptions` (defaulting
|
|
25
|
+
* `systemPromptAppend` to the planning prompt) and bypasses `main()`'s
|
|
26
|
+
* env-var fork.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Phase I I0 — planning-side widened tool allowlist.
|
|
30
|
+
* The in-world supervisor path never sets extraAllowedTools (stays `[]` per
|
|
31
|
+
* Decision D10). The planning-side driver defaults to including mcp__linear__*
|
|
32
|
+
* so operators with a local Linear MCP server can ingest tickets without
|
|
33
|
+
* configuring anything extra beyond the standard Linear MCP setup.
|
|
34
|
+
*/
|
|
35
|
+
export const PLANNING_DRIVER_EXTRA_ALLOWED_TOOLS = ['mcp__linear__*'];
|
|
36
|
+
export function launchHostDriver(opts) {
|
|
37
|
+
return runDriver({
|
|
38
|
+
worldId: opts.worldId,
|
|
39
|
+
sessionId: opts.sessionId,
|
|
40
|
+
hostCpUrl: opts.hostCpUrl,
|
|
41
|
+
bearer: opts.bearer,
|
|
42
|
+
sdkQuery: opts.sdkQuery,
|
|
43
|
+
systemPromptAppend: opts.systemPromptAppend ?? PLANNING_SYSTEM_PROMPT,
|
|
44
|
+
extraAllowedTools: opts.extraAllowedTools ?? PLANNING_DRIVER_EXTRA_ALLOWED_TOOLS,
|
|
45
|
+
abortSignal: opts.abortSignal,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=host-driver-launch.js.map
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `olam flywheel check-persona-skeleton` —
|
|
3
|
-
*
|
|
2
|
+
* `olam flywheel check-persona-skeleton` — D12 skeleton conformance checker.
|
|
3
|
+
*
|
|
4
|
+
* Port of `shared/engineering/scripts/check-persona-skeleton.py`. Validates
|
|
5
|
+
* persona-file conformance:
|
|
6
|
+
* 1. Frontmatter has `name`, `description`, `allowed-tools`.
|
|
7
|
+
* 2-5. Body has `## Role`, `## Cognitive patterns`, `## Scoring rubric`,
|
|
8
|
+
* `## Output format`.
|
|
9
|
+
* 6. `## Cognitive patterns` has ≥5 named patterns (### headings or bullets).
|
|
10
|
+
* 7. Token count (chars/4 approx) ≤ K10 cap (6000).
|
|
11
|
+
*
|
|
12
|
+
* Note on merged-result measurement: the Python predecessor imports
|
|
13
|
+
* apply-overlays.py's `merge_markdown` to measure overlay+upstream merged
|
|
14
|
+
* results. This TypeScript port currently measures STANDALONE only — overlay
|
|
15
|
+
* files needing merged-result measurement emit a warning + are checked
|
|
16
|
+
* against their standalone content. The merge-aware measurement lands when
|
|
17
|
+
* Phase A step 9 (apply-overlays port) ships; see follow-up task A7-merge.
|
|
18
|
+
*
|
|
19
|
+
* CLI:
|
|
20
|
+
* olam flywheel check-persona-skeleton <file> [<file> ...]
|
|
21
|
+
* Exit 0 = all PASS; Exit 1 = any FAIL.
|
|
22
|
+
*
|
|
23
|
+
* Plan reference: docs/plans/olam-flywheel-cli-namespace/phase-a-tasks.md § A7
|
|
4
24
|
*/
|
|
5
25
|
import type { Command } from 'commander';
|
|
26
|
+
interface CheckResult {
|
|
27
|
+
passed: boolean;
|
|
28
|
+
failures: string[];
|
|
29
|
+
tokens: number;
|
|
30
|
+
mergedSkipped: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function checkFile(filepath: string): CheckResult;
|
|
6
33
|
export declare function registerFlywheelCheckPersonaSkeleton(parent: Command): void;
|
|
34
|
+
export {};
|
|
7
35
|
//# sourceMappingURL=check-persona-skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-persona-skeleton.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/check-persona-skeleton.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"check-persona-skeleton.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/check-persona-skeleton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuDzC,UAAU,WAAW;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAoDvD;AAED,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CA4B1E"}
|
|
@@ -1,14 +1,151 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `olam flywheel check-persona-skeleton` —
|
|
3
|
-
*
|
|
2
|
+
* `olam flywheel check-persona-skeleton` — D12 skeleton conformance checker.
|
|
3
|
+
*
|
|
4
|
+
* Port of `shared/engineering/scripts/check-persona-skeleton.py`. Validates
|
|
5
|
+
* persona-file conformance:
|
|
6
|
+
* 1. Frontmatter has `name`, `description`, `allowed-tools`.
|
|
7
|
+
* 2-5. Body has `## Role`, `## Cognitive patterns`, `## Scoring rubric`,
|
|
8
|
+
* `## Output format`.
|
|
9
|
+
* 6. `## Cognitive patterns` has ≥5 named patterns (### headings or bullets).
|
|
10
|
+
* 7. Token count (chars/4 approx) ≤ K10 cap (6000).
|
|
11
|
+
*
|
|
12
|
+
* Note on merged-result measurement: the Python predecessor imports
|
|
13
|
+
* apply-overlays.py's `merge_markdown` to measure overlay+upstream merged
|
|
14
|
+
* results. This TypeScript port currently measures STANDALONE only — overlay
|
|
15
|
+
* files needing merged-result measurement emit a warning + are checked
|
|
16
|
+
* against their standalone content. The merge-aware measurement lands when
|
|
17
|
+
* Phase A step 9 (apply-overlays port) ships; see follow-up task A7-merge.
|
|
18
|
+
*
|
|
19
|
+
* CLI:
|
|
20
|
+
* olam flywheel check-persona-skeleton <file> [<file> ...]
|
|
21
|
+
* Exit 0 = all PASS; Exit 1 = any FAIL.
|
|
22
|
+
*
|
|
23
|
+
* Plan reference: docs/plans/olam-flywheel-cli-namespace/phase-a-tasks.md § A7
|
|
4
24
|
*/
|
|
25
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
26
|
+
import { homedir } from 'node:os';
|
|
27
|
+
import { basename, join } from 'node:path';
|
|
28
|
+
import { parse as parseYAML } from 'yaml';
|
|
29
|
+
const CHARS_PER_TOKEN = 4;
|
|
30
|
+
const K10_TOKEN_CAP = 6000;
|
|
31
|
+
const AGENTS_DIR = join(homedir(), '.claude', 'agents');
|
|
32
|
+
const REQUIRED_FRONTMATTER_KEYS = ['name', 'description', 'allowed-tools'];
|
|
33
|
+
const REQUIRED_SECTIONS = [
|
|
34
|
+
'## Role',
|
|
35
|
+
'## Cognitive patterns',
|
|
36
|
+
'## Scoring rubric',
|
|
37
|
+
'## Output format',
|
|
38
|
+
];
|
|
39
|
+
function parseFile(text) {
|
|
40
|
+
const cleaned = text.replace(/^/, '');
|
|
41
|
+
if (!cleaned.startsWith('---'))
|
|
42
|
+
return { fm: {}, body: cleaned };
|
|
43
|
+
const closeIdx = cleaned.indexOf('\n---', 3);
|
|
44
|
+
if (closeIdx === -1)
|
|
45
|
+
return { fm: {}, body: cleaned };
|
|
46
|
+
const fmRaw = cleaned.slice(4, closeIdx);
|
|
47
|
+
const body = cleaned.slice(closeIdx + 4).replace(/^\n/, '');
|
|
48
|
+
try {
|
|
49
|
+
const fm = parseYAML(fmRaw) ?? {};
|
|
50
|
+
return { fm, body };
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return { fm: {}, body };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function countH2(body, heading) {
|
|
57
|
+
const escaped = heading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
58
|
+
const pattern = new RegExp(`^${escaped}\\s*$`, 'gm');
|
|
59
|
+
return (body.match(pattern) ?? []).length;
|
|
60
|
+
}
|
|
61
|
+
function sectionBody(body, heading) {
|
|
62
|
+
const escaped = heading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
63
|
+
const pattern = new RegExp(`^${escaped}\\s*\\n([\\s\\S]*?)(?=^## |$(?![\\r\\n]))`, 'm');
|
|
64
|
+
const match = body.match(pattern);
|
|
65
|
+
return match?.[1] ?? '';
|
|
66
|
+
}
|
|
67
|
+
function countNamedPatterns(sectionText) {
|
|
68
|
+
const h3Count = (sectionText.match(/^###\s+\S/gm) ?? []).length;
|
|
69
|
+
if (h3Count >= 5)
|
|
70
|
+
return h3Count;
|
|
71
|
+
const bulletCount = (sectionText.match(/^\s*[-*]\s+\S/gm) ?? []).length;
|
|
72
|
+
return Math.max(h3Count, bulletCount);
|
|
73
|
+
}
|
|
74
|
+
export function checkFile(filepath) {
|
|
75
|
+
if (!existsSync(filepath) || !statSync(filepath).isFile()) {
|
|
76
|
+
return { passed: false, failures: [`file not found: ${filepath}`], tokens: 0, mergedSkipped: false };
|
|
77
|
+
}
|
|
78
|
+
const text = readFileSync(filepath, 'utf8');
|
|
79
|
+
const { fm, body } = parseFile(text);
|
|
80
|
+
const failures = [];
|
|
81
|
+
// 1. Frontmatter required keys.
|
|
82
|
+
for (const key of REQUIRED_FRONTMATTER_KEYS) {
|
|
83
|
+
const val = fm[key];
|
|
84
|
+
if (val === undefined || val === null || val === '') {
|
|
85
|
+
failures.push(`frontmatter missing \`${key}:\``);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// Determine whether to attempt merged measurement.
|
|
89
|
+
const isNewAgent = fm['overlay-intent'] === 'new-agent';
|
|
90
|
+
const agentName = typeof fm.name === 'string' ? fm.name : '';
|
|
91
|
+
let mergedSkipped = false;
|
|
92
|
+
if (!isNewAgent && agentName !== '') {
|
|
93
|
+
const upstreamPath = join(AGENTS_DIR, `${agentName}.md`);
|
|
94
|
+
if (existsSync(upstreamPath)) {
|
|
95
|
+
// Merged-result measurement requires A9 apply-overlays port.
|
|
96
|
+
// For now: warn + fall back to standalone measurement.
|
|
97
|
+
mergedSkipped = true;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// 2-5. Required sections.
|
|
101
|
+
for (const heading of REQUIRED_SECTIONS) {
|
|
102
|
+
if (countH2(body, heading) === 0) {
|
|
103
|
+
failures.push(`missing section: '${heading}'`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// 6. ≥5 named patterns.
|
|
107
|
+
const cogBody = sectionBody(body, '## Cognitive patterns');
|
|
108
|
+
if (cogBody !== '') {
|
|
109
|
+
const patternCount = countNamedPatterns(cogBody);
|
|
110
|
+
if (patternCount < 5) {
|
|
111
|
+
failures.push(`'## Cognitive patterns' has ${patternCount} named pattern(s); need >= 5`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// 7. Token cap.
|
|
115
|
+
const tokens = Math.floor(text.length / CHARS_PER_TOKEN);
|
|
116
|
+
if (tokens > K10_TOKEN_CAP) {
|
|
117
|
+
failures.push(`K10 cap exceeded: ${tokens} > ${K10_TOKEN_CAP} tokens`);
|
|
118
|
+
}
|
|
119
|
+
return { passed: failures.length === 0, failures, tokens, mergedSkipped };
|
|
120
|
+
}
|
|
5
121
|
export function registerFlywheelCheckPersonaSkeleton(parent) {
|
|
6
122
|
parent
|
|
7
123
|
.command('check-persona-skeleton')
|
|
8
|
-
.description('Validate
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
124
|
+
.description('Validate D12 skeleton conformance of persona files (frontmatter + required sections + cognitive patterns + K10 cap)')
|
|
125
|
+
.argument('<file...>', 'one or more persona files to check')
|
|
126
|
+
.action((files) => {
|
|
127
|
+
let passCount = 0;
|
|
128
|
+
let failCount = 0;
|
|
129
|
+
for (const filepath of files) {
|
|
130
|
+
const result = checkFile(filepath);
|
|
131
|
+
const label = basename(filepath);
|
|
132
|
+
if (result.passed) {
|
|
133
|
+
process.stdout.write(`PASS: ${label} -- D12 skeleton valid; tokens=${result.tokens}/${K10_TOKEN_CAP}`);
|
|
134
|
+
if (result.mergedSkipped) {
|
|
135
|
+
process.stdout.write(' (merged measurement deferred to A9 apply-overlays port)');
|
|
136
|
+
}
|
|
137
|
+
process.stdout.write('\n');
|
|
138
|
+
passCount += 1;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
for (const detail of result.failures) {
|
|
142
|
+
process.stdout.write(`FAIL: ${label} -- ${detail}\n`);
|
|
143
|
+
}
|
|
144
|
+
failCount += 1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
process.stdout.write(`\nResults: ${passCount} passed, ${failCount} failed\n`);
|
|
148
|
+
process.exit(failCount > 0 ? 1 : 0);
|
|
12
149
|
});
|
|
13
150
|
}
|
|
14
151
|
//# sourceMappingURL=check-persona-skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-persona-skeleton.js","sourceRoot":"","sources":["../../../src/commands/flywheel/check-persona-skeleton.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"check-persona-skeleton.js","sourceRoot":"","sources":["../../../src/commands/flywheel/check-persona-skeleton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAE1C,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AAExD,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,eAAe,CAAU,CAAC;AACpF,MAAM,iBAAiB,GAAG;IACxB,SAAS;IACT,uBAAuB;IACvB,mBAAmB;IACnB,kBAAkB;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;YACjB,CAAC;iBAAM,CAAC;gBACN,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;oBACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,KAAK,OAAO,MAAM,IAAI,CAAC,CAAC;gBACxD,CAAC;gBACD,SAAS,IAAI,CAAC,CAAC;YACjB,CAAC;QACH,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,SAAS,YAAY,SAAS,WAAW,CAAC,CAAC;QAC9E,OAAO,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `olam flywheel diversity-check` —
|
|
3
|
-
*
|
|
2
|
+
* `olam flywheel diversity-check` — cross-persona Jaccard similarity CLI.
|
|
3
|
+
*
|
|
4
|
+
* Reads persona-prompt files from a glob; computes pairwise Jaccard; reports
|
|
5
|
+
* pairs exceeding the threshold (default 0.7). Used by /10x:learn write-path
|
|
6
|
+
* to detect silent convergence collapse across K1 personas.
|
|
7
|
+
*
|
|
8
|
+
* Exit codes:
|
|
9
|
+
* 0 = no convergence (all pairs below threshold)
|
|
10
|
+
* 1 = convergence detected (one or more pairs above threshold)
|
|
11
|
+
* 2 = unexpected error (no matching files / read failure)
|
|
12
|
+
*
|
|
13
|
+
* Plan reference: docs/plans/olam-flywheel-cli-namespace/phase-a-tasks.md § A8
|
|
4
14
|
*/
|
|
5
15
|
import type { Command } from 'commander';
|
|
6
16
|
export declare function registerFlywheelDiversityCheck(parent: Command): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diversity-check.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/diversity-check.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"diversity-check.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/diversity-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAkDpE"}
|
|
@@ -1,14 +1,64 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `olam flywheel diversity-check` —
|
|
3
|
-
*
|
|
2
|
+
* `olam flywheel diversity-check` — cross-persona Jaccard similarity CLI.
|
|
3
|
+
*
|
|
4
|
+
* Reads persona-prompt files from a glob; computes pairwise Jaccard; reports
|
|
5
|
+
* pairs exceeding the threshold (default 0.7). Used by /10x:learn write-path
|
|
6
|
+
* to detect silent convergence collapse across K1 personas.
|
|
7
|
+
*
|
|
8
|
+
* Exit codes:
|
|
9
|
+
* 0 = no convergence (all pairs below threshold)
|
|
10
|
+
* 1 = convergence detected (one or more pairs above threshold)
|
|
11
|
+
* 2 = unexpected error (no matching files / read failure)
|
|
12
|
+
*
|
|
13
|
+
* Plan reference: docs/plans/olam-flywheel-cli-namespace/phase-a-tasks.md § A8
|
|
4
14
|
*/
|
|
15
|
+
import { readFileSync } from 'node:fs';
|
|
16
|
+
import { basename } from 'node:path';
|
|
17
|
+
import { globSync } from 'node:fs';
|
|
18
|
+
import { crossPersonaCheck, formatRedivergencePrompt, DIVERSITY_THRESHOLD, } from '@olam/core/src/lib/diversity-check.js';
|
|
5
19
|
export function registerFlywheelDiversityCheck(parent) {
|
|
6
20
|
parent
|
|
7
21
|
.command('diversity-check')
|
|
8
|
-
.description('Cross-
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
.description('Cross-persona Jaccard similarity guard — flag persona pairs above threshold')
|
|
23
|
+
.requiredOption('--glob <pattern>', 'glob pattern matching persona-prompt files')
|
|
24
|
+
.option('--threshold <0.0-1.0>', 'Jaccard threshold (default 0.7)')
|
|
25
|
+
.option('--json', 'emit findings as JSON instead of human-readable')
|
|
26
|
+
.action((opts) => {
|
|
27
|
+
const threshold = opts.threshold !== undefined ? Number.parseFloat(opts.threshold) : DIVERSITY_THRESHOLD;
|
|
28
|
+
if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
|
|
29
|
+
process.stderr.write(`[diversity-check-reject] --threshold must be 0.0-1.0; got ${JSON.stringify(opts.threshold)}\n`);
|
|
30
|
+
process.exit(2);
|
|
31
|
+
}
|
|
32
|
+
// Use Node 22+'s native glob (no extra dep).
|
|
33
|
+
const files = globSync(opts.glob);
|
|
34
|
+
if (files.length === 0) {
|
|
35
|
+
process.stderr.write(`[diversity-check-reject] no files matched glob: ${opts.glob}\n`);
|
|
36
|
+
process.exit(2);
|
|
37
|
+
}
|
|
38
|
+
const personas = new Map();
|
|
39
|
+
for (const filepath of files) {
|
|
40
|
+
try {
|
|
41
|
+
const body = readFileSync(filepath, 'utf8');
|
|
42
|
+
if (body.trim().length > 0) {
|
|
43
|
+
personas.set(basename(filepath, '.md'), body);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
process.stderr.write(`[diversity-check-error] cannot read ${filepath}: ${err instanceof Error ? err.message : 'unknown'}\n`);
|
|
48
|
+
process.exit(2);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const flagged = crossPersonaCheck(personas, threshold);
|
|
52
|
+
if (opts.json) {
|
|
53
|
+
process.stdout.write(JSON.stringify({ threshold, persona_count: personas.size, flagged }) + '\n');
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
process.stdout.write(`[diversity-check] ${personas.size} personas; threshold ${threshold}; ${flagged.length} pair(s) over threshold\n`);
|
|
57
|
+
for (const { persona_a, persona_b, score } of flagged) {
|
|
58
|
+
process.stdout.write(`\n${formatRedivergencePrompt(persona_a, persona_b, score, undefined, undefined, threshold)}\n`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
process.exit(flagged.length > 0 ? 1 : 0);
|
|
12
62
|
});
|
|
13
63
|
}
|
|
14
64
|
//# sourceMappingURL=diversity-check.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diversity-check.js","sourceRoot":"","sources":["../../../src/commands/flywheel/diversity-check.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"diversity-check.js","sourceRoot":"","sources":["../../../src/commands/flywheel/diversity-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,uCAAuC,CAAC;AAQ/C,MAAM,UAAU,8BAA8B,CAAC,MAAe;IAC5D,MAAM;SACH,OAAO,CAAC,iBAAiB,CAAC;SAC1B,WAAW,CAAC,6EAA6E,CAAC;SAC1F,cAAc,CAAC,kBAAkB,EAAE,4CAA4C,CAAC;SAChF,MAAM,CAAC,uBAAuB,EAAE,iCAAiC,CAAC;SAClE,MAAM,CAAC,QAAQ,EAAE,iDAAiD,CAAC;SACnE,MAAM,CAAC,CAAC,IAAmC,EAAE,EAAE;QAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC;QACzG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;YAClE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6DAA6D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAA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CAAC,GAAG,IAAI,CAAC,CAAC;QACpG,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,qBAAqB,QAAQ,CAAC,IAAI,wBAAwB,SAAS,KAAK,OAAO,CAAC,MAAM,2BAA2B,CAClH,CAAC;YACF,KAAK,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,OAAO,EAAE,CAAC;gBACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,wBAAwB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;YACxH,CAAC;QACH,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiBvD"}
|
|
@@ -31,6 +31,7 @@ import { registerFlywheelCheckPersonaSkeleton } from './check-persona-skeleton.j
|
|
|
31
31
|
import { registerFlywheelDiversityCheck } from './diversity-check.js';
|
|
32
32
|
import { registerFlywheelPing } from './ping.js';
|
|
33
33
|
import { registerFlywheelInstallShims } from './install-shims.js';
|
|
34
|
+
import { registerFlywheelMigrateOverlays } from './migrate-overlays.js';
|
|
34
35
|
export function registerFlywheel(program) {
|
|
35
36
|
const flywheel = program
|
|
36
37
|
.command('flywheel')
|
|
@@ -44,5 +45,6 @@ export function registerFlywheel(program) {
|
|
|
44
45
|
registerFlywheelDiversityCheck(flywheel);
|
|
45
46
|
registerFlywheelPing(flywheel);
|
|
46
47
|
registerFlywheelInstallShims(flywheel);
|
|
48
|
+
registerFlywheelMigrateOverlays(flywheel);
|
|
47
49
|
}
|
|
48
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/flywheel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/flywheel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AAExE,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,QAAQ,GAAG,OAAO;SACrB,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CACV,qNAAqN,CACtN,CAAC;IAEJ,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IACzC,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAClC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACrC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACrC,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAChD,oCAAoC,CAAC,QAAQ,CAAC,CAAC;IAC/C,8BAA8B,CAAC,QAAQ,CAAC,CAAC;IACzC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC/B,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACvC,+BAA+B,CAAC,QAAQ,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,8 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `olam flywheel install-shims` —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* `olam flywheel install-shims` — write backwards-compat shims to ~/.claude/scripts/.
|
|
3
|
+
*
|
|
4
|
+
* Generates a bash shim per spec in SHIM_SPECS and writes it to
|
|
5
|
+
* ~/.claude/scripts/<basename>. Detects existing non-shim files (operator's
|
|
6
|
+
* own scripts or atlas-toolbox-shipped originals) and prompts/backs-up
|
|
7
|
+
* before overwriting. Idempotent — re-runs produce no diff when content
|
|
8
|
+
* matches.
|
|
9
|
+
*
|
|
10
|
+
* Replaces the A1 stub.
|
|
11
|
+
*
|
|
12
|
+
* Plan reference: docs/plans/olam-flywheel-cli-namespace/phase-a-tasks.md § A14
|
|
13
|
+
* Closes part of K1 OQ20 (correct hook-point for shim installation).
|
|
5
14
|
*/
|
|
6
15
|
import type { Command } from 'commander';
|
|
16
|
+
export interface InstallShimsOptions {
|
|
17
|
+
force?: boolean;
|
|
18
|
+
dryRun?: boolean;
|
|
19
|
+
targetDir?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ShimInstallStatus {
|
|
22
|
+
basename: string;
|
|
23
|
+
action: 'written' | 'overwritten' | 'unchanged' | 'preserved-existing';
|
|
24
|
+
targetPath: string;
|
|
25
|
+
backupPath?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface RefreshShimsResult {
|
|
28
|
+
results: ShimInstallStatus[];
|
|
29
|
+
written: number;
|
|
30
|
+
overwritten: number;
|
|
31
|
+
unchanged: number;
|
|
32
|
+
preserved: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Programmatic API for refreshing all shims. Used by:
|
|
36
|
+
* - `olam flywheel install-shims` CLI action (this file).
|
|
37
|
+
* - `olam skills source pull` post-step (B2 hook point).
|
|
38
|
+
*/
|
|
39
|
+
export declare function refreshShims(opts?: InstallShimsOptions): RefreshShimsResult;
|
|
7
40
|
export declare function registerFlywheelInstallShims(parent: Command): void;
|
|
8
41
|
//# sourceMappingURL=install-shims.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-shims.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/install-shims.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"install-shims.d.ts","sourceRoot":"","sources":["../../../src/commands/flywheel/install-shims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,oBAAoB,CAAC;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,mBAAwB,GAAG,kBAAkB,CAkB/E;AA8CD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAoClE"}
|