@productbrain/cli 0.1.0-beta.7186 → 0.1.0-beta.7194
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/__tests__/handshake.e2e.test.js +2 -2
- package/dist/__tests__/handshake.e2e.test.js.map +1 -1
- package/dist/__tests__/handshake.test.js +4 -138
- package/dist/__tests__/handshake.test.js.map +1 -1
- package/dist/__tests__/health-gap-kinds-drift.test.js +4 -3
- package/dist/__tests__/health-gap-kinds-drift.test.js.map +1 -1
- package/dist/commands/admin/seed.d.ts +0 -14
- package/dist/commands/admin/seed.d.ts.map +1 -1
- package/dist/commands/admin/seed.js +13 -201
- package/dist/commands/admin/seed.js.map +1 -1
- package/dist/commands/admin/seed.test.d.ts +3 -4
- package/dist/commands/admin/seed.test.d.ts.map +1 -1
- package/dist/commands/admin/seed.test.js +8 -64
- package/dist/commands/admin/seed.test.js.map +1 -1
- package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -1
- package/dist/commands/admin/seedRegistryEntries.generated.js +0 -9
- package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -1
- package/dist/commands/admin/seedRegistryEntries.test.js +3 -3
- package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -1
- package/dist/commands/connect-context.d.ts +11 -11
- package/dist/commands/connect-context.d.ts.map +1 -1
- package/dist/commands/connect-context.js +14 -27
- package/dist/commands/connect-context.js.map +1 -1
- package/dist/commands/connect-context.test.js +16 -60
- package/dist/commands/connect-context.test.js.map +1 -1
- package/dist/commands/handshake.d.ts +0 -16
- package/dist/commands/handshake.d.ts.map +1 -1
- package/dist/commands/handshake.js +0 -47
- package/dist/commands/handshake.js.map +1 -1
- package/dist/commands/workspace.d.ts +0 -7
- package/dist/commands/workspace.d.ts.map +1 -1
- package/dist/commands/workspace.js.map +1 -1
- package/dist/generated/healthGapKinds.generated.d.ts +1 -1
- package/dist/generated/healthGapKinds.generated.d.ts.map +1 -1
- package/dist/generated/healthGapKinds.generated.js +0 -1
- package/dist/generated/healthGapKinds.generated.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedRegistryEntries.test.js","sourceRoot":"","sources":["../../../src/commands/admin/seedRegistryEntries.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,iFAAiF;AACjF,iFAAiF;AACjF,iEAAiE;AACjE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAEnF,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;AAC9G,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC;AAE3E,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC9C,2EAA2E;IAC3E,gFAAgF;IAChF,EAAE,CAAC,2HAA2H,EAAE,GAAG,EAAE;QACpI,MAAM,MAAM,GAAG,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACpD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACvC,4EAA4E;QAC5E,MAAM,CAAC,OAAO,CAAC,MAAM,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
|
3
3
|
*
|
|
4
|
-
* Extracted from connect-screens.tsx so the
|
|
5
|
-
*
|
|
6
|
-
* the result of prepareConnectContext().
|
|
4
|
+
* Extracted from connect-screens.tsx so the context handshake can be tested without
|
|
5
|
+
* rendering Ink. The screens render purely from the result of prepareConnectContext().
|
|
7
6
|
*
|
|
8
|
-
* Chain: WP-433 (pb connect handoff), WP-439 S4 (strict-by-default handshake)
|
|
9
|
-
*
|
|
7
|
+
* Chain: WP-433 (pb connect handoff), WP-439 S4 (strict-by-default handshake).
|
|
8
|
+
*
|
|
9
|
+
* WP-776 S0 round-1 review (Codex P1): the seed-readiness poll (WP-379 S3b) that used to run
|
|
10
|
+
* before the handshake is deleted — nothing seeds setup-assets any more, so there is nothing
|
|
11
|
+
* left to wait for. `seedGaps` stays on `ConnectContext` (connect-screens.tsx still reads it)
|
|
12
|
+
* but is never populated now; it degrades to a permanent no-op, not a compile-time dead field.
|
|
10
13
|
*/
|
|
11
14
|
import { type HealthGap, type LeftoverProjection } from './handshake.js';
|
|
12
15
|
export interface ConnectContext {
|
|
@@ -14,7 +17,8 @@ export interface ConnectContext {
|
|
|
14
17
|
handshakeFailed: boolean;
|
|
15
18
|
/** Handshake error message, when handshakeFailed. */
|
|
16
19
|
handshakeError?: string;
|
|
17
|
-
/**
|
|
20
|
+
/** WP-776 S0: never populated any more (the seed-readiness poll it came from is deleted) —
|
|
21
|
+
* kept only so connect-screens.tsx's existing read stays type-valid. */
|
|
18
22
|
seedGaps?: ReadonlyArray<HealthGap>;
|
|
19
23
|
/**
|
|
20
24
|
* Adapter files PB left untouched because they already existed without its
|
|
@@ -39,11 +43,7 @@ export interface ConnectContext {
|
|
|
39
43
|
/**
|
|
40
44
|
* Prepare the workspace context after `pb connect` redeems a token:
|
|
41
45
|
*
|
|
42
|
-
*
|
|
43
|
-
* seeded setup-asset bodies (skills/rules); on a fresh workspace those seeds
|
|
44
|
-
* land asynchronously (WP-379 S3b), so running the handshake before they are
|
|
45
|
-
* ready makes its body fetch fail.
|
|
46
|
-
* 2. Run the handshake LENIENT. This is an automatic onboarding handshake — it
|
|
46
|
+
* Run the handshake LENIENT. This is an automatic onboarding handshake — it
|
|
47
47
|
* follows the precedent set for the automatic refresh at session close
|
|
48
48
|
* (session.ts, WP-439 S4): automatic runs must not hard-fail on a body-fetch
|
|
49
49
|
* error; orphaned assets are surfaced when the user runs `pb handshake`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-context.d.ts","sourceRoot":"","sources":["../../src/commands/connect-context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connect-context.d.ts","sourceRoot":"","sources":["../../src/commands/connect-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAgB,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGvF,MAAM,WAAW,cAAc;IAC7B,+EAA+E;IAC/E,eAAe,EAAE,OAAO,CAAC;IACzB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;6EACyE;IACzE,QAAQ,CAAC,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAClD;kGAC8F;IAC9F,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,cAAc,CAAC,CAgBrE"}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* connect-context — non-UI orchestration for the post-connect wizard.
|
|
3
3
|
*
|
|
4
|
-
* Extracted from connect-screens.tsx so the
|
|
5
|
-
*
|
|
6
|
-
* the result of prepareConnectContext().
|
|
4
|
+
* Extracted from connect-screens.tsx so the context handshake can be tested without
|
|
5
|
+
* rendering Ink. The screens render purely from the result of prepareConnectContext().
|
|
7
6
|
*
|
|
8
|
-
* Chain: WP-433 (pb connect handoff), WP-439 S4 (strict-by-default handshake)
|
|
9
|
-
*
|
|
7
|
+
* Chain: WP-433 (pb connect handoff), WP-439 S4 (strict-by-default handshake).
|
|
8
|
+
*
|
|
9
|
+
* WP-776 S0 round-1 review (Codex P1): the seed-readiness poll (WP-379 S3b) that used to run
|
|
10
|
+
* before the handshake is deleted — nothing seeds setup-assets any more, so there is nothing
|
|
11
|
+
* left to wait for. `seedGaps` stays on `ConnectContext` (connect-screens.tsx still reads it)
|
|
12
|
+
* but is never populated now; it degrades to a permanent no-op, not a compile-time dead field.
|
|
10
13
|
*/
|
|
11
|
-
import { runHandshake
|
|
14
|
+
import { runHandshake } from './handshake.js';
|
|
12
15
|
import { setSpinnersSilenced, areSpinnersSilenced } from '../lib/runner.js';
|
|
13
16
|
/**
|
|
14
17
|
* Prepare the workspace context after `pb connect` redeems a token:
|
|
15
18
|
*
|
|
16
|
-
*
|
|
17
|
-
* seeded setup-asset bodies (skills/rules); on a fresh workspace those seeds
|
|
18
|
-
* land asynchronously (WP-379 S3b), so running the handshake before they are
|
|
19
|
-
* ready makes its body fetch fail.
|
|
20
|
-
* 2. Run the handshake LENIENT. This is an automatic onboarding handshake — it
|
|
19
|
+
* Run the handshake LENIENT. This is an automatic onboarding handshake — it
|
|
21
20
|
* follows the precedent set for the automatic refresh at session close
|
|
22
21
|
* (session.ts, WP-439 S4): automatic runs must not hard-fail on a body-fetch
|
|
23
22
|
* error; orphaned assets are surfaced when the user runs `pb handshake`
|
|
@@ -46,22 +45,10 @@ export async function prepareConnectContext() {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
async function prepareConnectContextInner() {
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
try {
|
|
54
|
-
const seedResult = await pollUntilSeedsReady();
|
|
55
|
-
if (seedResult.status === 'seeds-pending') {
|
|
56
|
-
seedGaps = seedResult.gaps;
|
|
57
|
-
}
|
|
58
|
-
// seeds-ready and probe-failed both leave seedGaps undefined (no warning).
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
// Future-proofing: pollUntilSeedsReady does not throw today (its probe
|
|
62
|
-
// catches everything into 'probe-failed'); this guards that contract drifting.
|
|
63
|
-
}
|
|
64
|
-
// 2. Run handshake lenient — capture failure for display rather than aborting.
|
|
48
|
+
// WP-776 S0: seedGaps is never populated any more — the seed-readiness poll that used to
|
|
49
|
+
// set it is deleted. See the ConnectContext.seedGaps doc comment.
|
|
50
|
+
const seedGaps = undefined;
|
|
51
|
+
// Run handshake lenient — capture failure for display rather than aborting.
|
|
65
52
|
let handshakeFailed = false;
|
|
66
53
|
let handshakeError;
|
|
67
54
|
let skippedFiles;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-context.js","sourceRoot":"","sources":["../../src/commands/connect-context.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connect-context.js","sourceRoot":"","sources":["../../src/commands/connect-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,YAAY,EAA2C,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AA+B5E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,wFAAwF;IACxF,sFAAsF;IACtF,uFAAuF;IACvF,qFAAqF;IACrF,0FAA0F;IAC1F,wFAAwF;IACxF,0FAA0F;IAC1F,+BAA+B;IAC/B,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;IAC5C,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAI,CAAC;QACH,OAAO,MAAM,0BAA0B,EAAE,CAAC;IAC5C,CAAC;YAAS,CAAC;QACT,mBAAmB,CA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
|
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tests for prepareConnectContext — the non-UI orchestration behind the
|
|
3
|
-
* post-connect wizard (
|
|
3
|
+
* post-connect wizard (context handshake).
|
|
4
4
|
*
|
|
5
|
-
* Root cause (P1): `pb connect`'s automatic handshake ran STRICT
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* refresh follows that same precedent.
|
|
5
|
+
* Root cause (P1): `pb connect`'s automatic handshake ran STRICT. On a fresh
|
|
6
|
+
* workspace or with an orphan setup-asset body, the handshake's body fetch failed
|
|
7
|
+
* and — being strict (WP-439 S4) — threw, surfacing only a dim "⚠ Context sync
|
|
8
|
+
* skipped" and leaving CLAUDE.md / rules unwritten. WP-439 S4 made the automatic
|
|
9
|
+
* refresh at session close LENIENT (session.ts) for exactly this reason; connect's
|
|
10
|
+
* automatic refresh follows that same precedent.
|
|
12
11
|
*
|
|
13
|
-
* Fix:
|
|
12
|
+
* Fix: run the handshake LENIENT.
|
|
13
|
+
*
|
|
14
|
+
* WP-776 S0 round-1 review (Codex P1): the seed-readiness poll that used to run
|
|
15
|
+
* before the handshake (WP-379 S3b) is deleted — nothing seeds setup-assets any
|
|
16
|
+
* more, so there is nothing left to wait for. `seedGaps` on the result stays
|
|
17
|
+
* declared (connect-screens.tsx still reads it) but is never populated.
|
|
14
18
|
*/
|
|
15
19
|
import { describe, it, expect, beforeEach, vi } from 'vitest';
|
|
16
20
|
vi.mock('./handshake.js', () => ({
|
|
17
21
|
runHandshake: vi.fn(async () => { }),
|
|
18
|
-
pollUntilSeedsReady: vi.fn(async () => ({ status: 'seeds-ready' })),
|
|
19
22
|
}));
|
|
20
23
|
import * as handshake from './handshake.js';
|
|
21
24
|
import { prepareConnectContext } from './connect-context.js';
|
|
22
25
|
import { areSpinnersSilenced, setSpinnersSilenced, getQuietMode, setQuietMode } from '../lib/runner.js';
|
|
23
26
|
const runHandshake = vi.mocked(handshake.runHandshake);
|
|
24
|
-
const pollUntilSeedsReady = vi.mocked(handshake.pollUntilSeedsReady);
|
|
25
|
-
const PENDING_GAPS = [
|
|
26
|
-
{ kind: 'starter-setup-missing', severity: 'warn', message: 'Starter setup seeds are still running.' },
|
|
27
|
-
];
|
|
28
27
|
describe('prepareConnectContext', () => {
|
|
29
28
|
beforeEach(() => {
|
|
30
29
|
vi.clearAllMocks();
|
|
31
|
-
pollUntilSeedsReady.mockResolvedValue({ status: 'seeds-ready' });
|
|
32
30
|
runHandshake.mockResolvedValue(undefined);
|
|
33
31
|
});
|
|
34
32
|
it('runs the handshake in lenient mode (matches session.ts automatic-handshake policy)', async () => {
|
|
@@ -36,32 +34,7 @@ describe('prepareConnectContext', () => {
|
|
|
36
34
|
expect(runHandshake).toHaveBeenCalledTimes(1);
|
|
37
35
|
expect(runHandshake).toHaveBeenCalledWith(expect.objectContaining({ force: false, apply: true, quiet: true, lenient: true }));
|
|
38
36
|
});
|
|
39
|
-
it('
|
|
40
|
-
const order = [];
|
|
41
|
-
pollUntilSeedsReady.mockImplementation(async () => {
|
|
42
|
-
order.push('poll');
|
|
43
|
-
return { status: 'seeds-ready' };
|
|
44
|
-
});
|
|
45
|
-
runHandshake.mockImplementation(async () => {
|
|
46
|
-
order.push('handshake');
|
|
47
|
-
return undefined;
|
|
48
|
-
});
|
|
49
|
-
await prepareConnectContext();
|
|
50
|
-
expect(order).toEqual(['poll', 'handshake']);
|
|
51
|
-
});
|
|
52
|
-
it('surfaces seed gaps when starter setup is still pending', async () => {
|
|
53
|
-
pollUntilSeedsReady.mockResolvedValue({ status: 'seeds-pending', gaps: PENDING_GAPS });
|
|
54
|
-
const result = await prepareConnectContext();
|
|
55
|
-
expect(result.seedGaps).toEqual(PENDING_GAPS);
|
|
56
|
-
expect(result.handshakeFailed).toBe(false);
|
|
57
|
-
});
|
|
58
|
-
it('reports no seed gaps when seeds are ready', async () => {
|
|
59
|
-
pollUntilSeedsReady.mockResolvedValue({ status: 'seeds-ready' });
|
|
60
|
-
const result = await prepareConnectContext();
|
|
61
|
-
expect(result.seedGaps).toBeUndefined();
|
|
62
|
-
});
|
|
63
|
-
it('reports no seed gaps when the health probe fails (non-blocking)', async () => {
|
|
64
|
-
pollUntilSeedsReady.mockResolvedValue({ status: 'probe-failed', error: 'network down' });
|
|
37
|
+
it('WP-776 S0: seedGaps is always undefined — the seed-readiness poll that used to populate it is deleted', async () => {
|
|
65
38
|
const result = await prepareConnectContext();
|
|
66
39
|
expect(result.seedGaps).toBeUndefined();
|
|
67
40
|
});
|
|
@@ -71,16 +44,6 @@ describe('prepareConnectContext', () => {
|
|
|
71
44
|
expect(result.handshakeFailed).toBe(true);
|
|
72
45
|
expect(result.handshakeError).toBe('boom');
|
|
73
46
|
});
|
|
74
|
-
it('surfaces seed gaps AND a handshake failure together (fresh-workspace worst case)', async () => {
|
|
75
|
-
// Seeds time out, then the lenient handshake still throws on a genuinely
|
|
76
|
-
// orphaned body — both signals must surface independently.
|
|
77
|
-
pollUntilSeedsReady.mockResolvedValue({ status: 'seeds-pending', gaps: PENDING_GAPS });
|
|
78
|
-
runHandshake.mockRejectedValue(new Error('orphan body'));
|
|
79
|
-
const result = await prepareConnectContext();
|
|
80
|
-
expect(result.seedGaps).toEqual(PENDING_GAPS);
|
|
81
|
-
expect(result.handshakeFailed).toBe(true);
|
|
82
|
-
expect(result.handshakeError).toBe('orphan body');
|
|
83
|
-
});
|
|
84
47
|
it('reports success when the handshake completes', async () => {
|
|
85
48
|
const result = await prepareConnectContext();
|
|
86
49
|
expect(result.handshakeFailed).toBe(false);
|
|
@@ -138,26 +101,20 @@ describe('prepareConnectContext', () => {
|
|
|
138
101
|
});
|
|
139
102
|
});
|
|
140
103
|
describe('prepareConnectContext — spinner-silence seam (WP-2 / TEN-2561)', () => {
|
|
141
|
-
// The
|
|
104
|
+
// The handshake makes kernelCalls whose spinners render raw internal labels
|
|
142
105
|
// ("Loading chain getVocabulary", …). The fn must suppress those during its work via the
|
|
143
106
|
// SPINNER-silence flag — and must NOT touch global quiet mode, which gates interactive
|
|
144
107
|
// prompts (so the handshake's adopt/revert prompts for tampered files still run). The
|
|
145
108
|
// flag is restored afterward, even when the (lenient) handshake throws.
|
|
146
109
|
beforeEach(() => {
|
|
147
110
|
vi.clearAllMocks();
|
|
148
|
-
pollUntilSeedsReady.mockResolvedValue({ status: 'seeds-ready' });
|
|
149
111
|
runHandshake.mockResolvedValue(undefined);
|
|
150
112
|
setSpinnersSilenced(false);
|
|
151
113
|
setQuietMode(false);
|
|
152
114
|
});
|
|
153
|
-
it('silences spinners during
|
|
154
|
-
let silencedDuringPoll;
|
|
115
|
+
it('silences spinners during the handshake, then restores — WITHOUT touching quiet', async () => {
|
|
155
116
|
let silencedDuringHandshake;
|
|
156
117
|
let quietDuringHandshake;
|
|
157
|
-
pollUntilSeedsReady.mockImplementation(async () => {
|
|
158
|
-
silencedDuringPoll = areSpinnersSilenced();
|
|
159
|
-
return { status: 'seeds-ready' };
|
|
160
|
-
});
|
|
161
118
|
runHandshake.mockImplementation(async () => {
|
|
162
119
|
silencedDuringHandshake = areSpinnersSilenced();
|
|
163
120
|
quietDuringHandshake = getQuietMode();
|
|
@@ -165,7 +122,6 @@ describe('prepareConnectContext — spinner-silence seam (WP-2 / TEN-2561)', ()
|
|
|
165
122
|
});
|
|
166
123
|
expect(areSpinnersSilenced()).toBe(false);
|
|
167
124
|
await prepareConnectContext();
|
|
168
|
-
expect(silencedDuringPoll).toBe(true);
|
|
169
125
|
expect(silencedDuringHandshake).toBe(true);
|
|
170
126
|
// Quiet (the interactive-prompt gate) must stay off — otherwise the handshake's
|
|
171
127
|
// adopt/revert tamper prompts would throw NON_INTERACTIVE (TEN-2561 regression).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect-context.test.js","sourceRoot":"","sources":["../../src/commands/connect-context.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"connect-context.test.js","sourceR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AC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW;IACxD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,KAAK,IAAI,EAAE;QAC1F,YAAY,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAElD,MAAM,MAAM,GAAG,MAAM,qBAAqB,EAAE,CAAC;QAE7C,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,6BAA6B;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qEAAqE,EAAE,KAAK,IAAI,EAAE;QACnF,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC1B,MAAM,qBAAqB,EAAE,CAAC;QAC9B,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -9,22 +9,6 @@ import { type StartupResolutionSignals } from '../lib/startup-resolution-signals
|
|
|
9
9
|
import { type SurfaceName } from '../surfaces/registry.js';
|
|
10
10
|
/** Wire-safe alias for a single health gap — derived from the CLI mirror in workspace.ts. */
|
|
11
11
|
export type HealthGap = WorkspaceHealthResult['gaps'][number];
|
|
12
|
-
/** Structured result from probeStarterSetupSeeded when seeds are pending or health is unavailable. */
|
|
13
|
-
export type SeedsPendingResult = {
|
|
14
|
-
status: 'seeds-pending';
|
|
15
|
-
gaps: ReadonlyArray<HealthGap>;
|
|
16
|
-
} | {
|
|
17
|
-
status: 'seeds-ready';
|
|
18
|
-
} | {
|
|
19
|
-
status: 'probe-failed';
|
|
20
|
-
error: string;
|
|
21
|
-
};
|
|
22
|
-
/** Single-shot health probe (no internal polling — caller's job, connect-context.ts). Returns
|
|
23
|
-
* `seeds-ready`/`seeds-pending` (query ok) or `probe-failed` (query threw). */
|
|
24
|
-
export declare function probeStarterSetupSeeded(): Promise<SeedsPendingResult>;
|
|
25
|
-
/** Poll `probeStarterSetupSeeded` up to MAX_POLLS times (10s @ 500ms); returns the final probe
|
|
26
|
-
* result (caller renders it). Exported for connect-context.ts's reuse. */
|
|
27
|
-
export declare function pollUntilSeedsReady(): Promise<SeedsPendingResult>;
|
|
28
12
|
export declare function runHandshakeInit(options?: {
|
|
29
13
|
level?: string;
|
|
30
14
|
dryRun?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/commands/handshake.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8CH,OAAO,EAAyB,KAAK,eAAe,EAAsB,MAAM,4BAA4B,CAAC;AAe7G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,EAAoC,KAAK,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGvH,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"handshake.d.ts","sourceRoot":"","sources":["../../src/commands/handshake.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8CH,OAAO,EAAyB,KAAK,eAAe,EAAsB,MAAM,4BAA4B,CAAC;AAe7G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAG5D,OAAO,EAAE,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAE1F,OAAO,EAAoC,KAAK,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGvH,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAYjC,6FAA6F;AAC7F,MAAM,MAAM,SAAS,GAAG,qBA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,EAAE,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CA2ErD;AAgBD,wBAAsB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAo6CvG;AAGD,eAAO,MAAM,MAAM;;;;CAAyD,CAAC"}
|
|
@@ -44,53 +44,6 @@ import { assertSetupWritePath } from '../setup/perimeter.js';
|
|
|
44
44
|
// WP-421 S3: SurfaceAdapter reverse-map for tampered prompts (DEC-952, doneWhen #34).
|
|
45
45
|
import { canonicalPathForAnySurface, SURFACE_GOVERN_NO_SURFACES, SURFACE_REGISTRY, validateSurfacesForMode, } from '../surfaces/registry.js';
|
|
46
46
|
import { getReverseMapFallbackMessage, reportReverseMapMissing } from '../surfaces/telemetry.js';
|
|
47
|
-
const MAX_HANDSHAKE_WAIT_MS = 10_000; // 10 seconds
|
|
48
|
-
const POLL_INTERVAL_MS = 500; // 500 ms per poll
|
|
49
|
-
const MAX_POLLS = MAX_HANDSHAKE_WAIT_MS / POLL_INTERVAL_MS; // 20
|
|
50
|
-
/** Single-shot health probe (no internal polling — caller's job, connect-context.ts). Returns
|
|
51
|
-
* `seeds-ready`/`seeds-pending` (query ok) or `probe-failed` (query threw). */
|
|
52
|
-
export async function probeStarterSetupSeeded() {
|
|
53
|
-
try {
|
|
54
|
-
const health = await kernelCall('workspace.health', {});
|
|
55
|
-
if (health.starterSetupSeeded) {
|
|
56
|
-
return { status: 'seeds-ready' };
|
|
57
|
-
}
|
|
58
|
-
const starterGaps = (health.gaps ?? []).filter((g) => g.kind === 'starter-setup-missing' || g.kind === 'platform-domains-missing');
|
|
59
|
-
return {
|
|
60
|
-
status: 'seeds-pending',
|
|
61
|
-
gaps: starterGaps.length > 0 ? starterGaps : [
|
|
62
|
-
{
|
|
63
|
-
kind: 'starter-setup-missing',
|
|
64
|
-
severity: 'warn',
|
|
65
|
-
message: 'Starter setup seeds are still running.',
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
return {
|
|
72
|
-
status: 'probe-failed',
|
|
73
|
-
error: err instanceof Error ? err.message : String(err),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/** Poll `probeStarterSetupSeeded` up to MAX_POLLS times (10s @ 500ms); returns the final probe
|
|
78
|
-
* result (caller renders it). Exported for connect-context.ts's reuse. */
|
|
79
|
-
export async function pollUntilSeedsReady() {
|
|
80
|
-
for (let poll = 0; poll < MAX_POLLS; poll++) {
|
|
81
|
-
const result = await probeStarterSetupSeeded();
|
|
82
|
-
if (result.status === 'seeds-ready')
|
|
83
|
-
return result;
|
|
84
|
-
if (result.status === 'probe-failed')
|
|
85
|
-
return result; // don't retry on auth/network errors
|
|
86
|
-
// seeds-pending — wait before next poll
|
|
87
|
-
if (poll < MAX_POLLS - 1) {
|
|
88
|
-
await new Promise((res) => setTimeout(res, POLL_INTERVAL_MS));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
// Final probe after exhausting waits — return whatever state we have
|
|
92
|
-
return probeStarterSetupSeeded();
|
|
93
|
-
}
|
|
94
47
|
const LEVELS = {
|
|
95
48
|
guide: {
|
|
96
49
|
label: 'Guide me',
|