@cluesmith/codev-core 3.1.6 → 3.1.8

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.
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Canonical builder *stages* — the action axis the VSCode Builders tree groups
3
+ * by (#952). Where `area-grouping.ts` buckets by a static domain label, this
4
+ * module buckets by where a builder is in its lifecycle.
5
+ *
6
+ * The key design property is a **closed, fixed stage set**: every protocol's
7
+ * phase ids (the raw `OverviewBuilder.protocolPhase`) fold into one of six
8
+ * canonical stages via `PHASE_TO_STAGE`, rather than each phase id minting its
9
+ * own group. Across the 9 bundled protocols there are ~17 distinct phase ids;
10
+ * mapping them onto six stages caps the Builders tree at seven groups
11
+ * (six stages + `unknown`) **permanently** — a new protocol's phases route into
12
+ * an existing stage (or fall to `unknown` until mapped), so the group count
13
+ * never grows with the protocol catalog.
14
+ *
15
+ * Pure / dependency-free so it can be unit-tested under the vitest harness in
16
+ * the VSCode package, mirroring `area-grouping.ts`.
17
+ */
18
+ /**
19
+ * The closed set of canonical lifecycle stages, in the order the action axis
20
+ * reads top-to-bottom. `unknown` is the bounded catch-all for an empty or
21
+ * unmapped `protocolPhase`; it always sorts last.
22
+ */
23
+ export type BuilderStage = 'specify' | 'plan' | 'implement' | 'review' | 'pr' | 'verified' | 'unknown';
24
+ /**
25
+ * Fixed display order for the stages. `groupByStage` emits groups in exactly
26
+ * this order, skipping stages with no members. NOT alphabetical — the lifecycle
27
+ * sequence (`SPECIFY → PLAN → IMPLEMENT → REVIEW → PR → VERIFIED`) is what makes
28
+ * the view answer "where do I need to act?" at a glance.
29
+ */
30
+ export declare const STAGE_ORDER: readonly BuilderStage[];
31
+ /**
32
+ * Maps every phase id authored across the 9 bundled protocols (spir, aspir,
33
+ * pir, air, bugfix, maintain, experiment, research, spike) onto its canonical
34
+ * stage. Grouping by stage merges same-named phases across protocols (e.g.
35
+ * `implement` from spir/pir/air, `pr` from air/bugfix) into one bucket, which
36
+ * is the intent — "everything at implement" is a protocol-agnostic question.
37
+ *
38
+ * Notable folds:
39
+ * - `investigate → plan`: treated as pre-build diagnosis (correct for the
40
+ * common BUGFIX case; RESEARCH's `investigate` approximates here).
41
+ * - `verify`/`verified`/`complete → verified`: SPIR's in-progress verify phase
42
+ * and the two terminal synonyms (`complete` is the backward-compat spelling
43
+ * of `verified`) share one terminal bucket; the row's state icon still
44
+ * distinguishes an active verify from a finished builder.
45
+ *
46
+ * Adding a protocol with a new phase id: add one entry here. An unmapped id
47
+ * falls through to `unknown` (see `stageForPhase`) rather than expanding the
48
+ * group set — visible under UNKNOWN, never silently dropped.
49
+ */
50
+ export declare const PHASE_TO_STAGE: Record<string, BuilderStage>;
51
+ /**
52
+ * Canonical stage for a raw `protocolPhase`. Empty string and any unmapped id
53
+ * resolve to `unknown` — the bounded catch-all that keeps the group set fixed.
54
+ */
55
+ export declare function stageForPhase(phase: string): BuilderStage;
56
+ /**
57
+ * Bucket items by their canonical stage, returning groups in `STAGE_ORDER`.
58
+ * Empty stages are omitted (a group exists only if ≥1 item maps into it), so
59
+ * the caller renders just the populated stages. Within a group, input order is
60
+ * preserved — the caller has already applied its display-order sort.
61
+ *
62
+ * Pure and generic over the item type, mirroring `groupByArea`. The VSCode
63
+ * Builders tree (`views/builders.ts`) is the first consumer, keying off each
64
+ * builder's `protocolPhase`.
65
+ */
66
+ export declare function groupByStage<T>(items: T[], getPhase: (item: T) => string): Array<{
67
+ stage: BuilderStage;
68
+ items: T[];
69
+ }>;
70
+ //# sourceMappingURL=phase-grouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-grouping.d.ts","sourceRoot":"","sources":["../src/phase-grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,MAAM,GACN,WAAW,GACX,QAAQ,GACR,IAAI,GACJ,UAAU,GACV,SAAS,CAAC;AAEd;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,YAAY,EAQ9C,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA0BvD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAEzD;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,KAAK,EAAE,CAAC,EAAE,EACV,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAC5B,KAAK,CAAC;IAAE,KAAK,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,CAAC,EAAE,CAAA;CAAE,CAAC,CAoB5C"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Canonical builder *stages* — the action axis the VSCode Builders tree groups
3
+ * by (#952). Where `area-grouping.ts` buckets by a static domain label, this
4
+ * module buckets by where a builder is in its lifecycle.
5
+ *
6
+ * The key design property is a **closed, fixed stage set**: every protocol's
7
+ * phase ids (the raw `OverviewBuilder.protocolPhase`) fold into one of six
8
+ * canonical stages via `PHASE_TO_STAGE`, rather than each phase id minting its
9
+ * own group. Across the 9 bundled protocols there are ~17 distinct phase ids;
10
+ * mapping them onto six stages caps the Builders tree at seven groups
11
+ * (six stages + `unknown`) **permanently** — a new protocol's phases route into
12
+ * an existing stage (or fall to `unknown` until mapped), so the group count
13
+ * never grows with the protocol catalog.
14
+ *
15
+ * Pure / dependency-free so it can be unit-tested under the vitest harness in
16
+ * the VSCode package, mirroring `area-grouping.ts`.
17
+ */
18
+ /**
19
+ * Fixed display order for the stages. `groupByStage` emits groups in exactly
20
+ * this order, skipping stages with no members. NOT alphabetical — the lifecycle
21
+ * sequence (`SPECIFY → PLAN → IMPLEMENT → REVIEW → PR → VERIFIED`) is what makes
22
+ * the view answer "where do I need to act?" at a glance.
23
+ */
24
+ export const STAGE_ORDER = [
25
+ 'specify',
26
+ 'plan',
27
+ 'implement',
28
+ 'review',
29
+ 'pr',
30
+ 'verified',
31
+ 'unknown',
32
+ ];
33
+ /**
34
+ * Maps every phase id authored across the 9 bundled protocols (spir, aspir,
35
+ * pir, air, bugfix, maintain, experiment, research, spike) onto its canonical
36
+ * stage. Grouping by stage merges same-named phases across protocols (e.g.
37
+ * `implement` from spir/pir/air, `pr` from air/bugfix) into one bucket, which
38
+ * is the intent — "everything at implement" is a protocol-agnostic question.
39
+ *
40
+ * Notable folds:
41
+ * - `investigate → plan`: treated as pre-build diagnosis (correct for the
42
+ * common BUGFIX case; RESEARCH's `investigate` approximates here).
43
+ * - `verify`/`verified`/`complete → verified`: SPIR's in-progress verify phase
44
+ * and the two terminal synonyms (`complete` is the backward-compat spelling
45
+ * of `verified`) share one terminal bucket; the row's state icon still
46
+ * distinguishes an active verify from a finished builder.
47
+ *
48
+ * Adding a protocol with a new phase id: add one entry here. An unmapped id
49
+ * falls through to `unknown` (see `stageForPhase`) rather than expanding the
50
+ * group set — visible under UNKNOWN, never silently dropped.
51
+ */
52
+ export const PHASE_TO_STAGE = {
53
+ // SPECIFY — framing "what are we doing"
54
+ specify: 'specify',
55
+ hypothesis: 'specify',
56
+ scope: 'specify',
57
+ // PLAN — design / diagnosis before building
58
+ plan: 'plan',
59
+ design: 'plan',
60
+ investigate: 'plan',
61
+ // IMPLEMENT — the doing
62
+ implement: 'implement',
63
+ fix: 'implement',
64
+ execute: 'implement',
65
+ maintain: 'implement',
66
+ spike: 'implement',
67
+ // REVIEW — assessing the work
68
+ review: 'review',
69
+ synthesize: 'review',
70
+ analyze: 'review',
71
+ critique: 'review',
72
+ // PR — awaiting merge
73
+ pr: 'pr',
74
+ // VERIFIED — terminal / post-merge (plus SPIR's in-progress verify)
75
+ verify: 'verified',
76
+ verified: 'verified',
77
+ complete: 'verified',
78
+ };
79
+ /**
80
+ * Canonical stage for a raw `protocolPhase`. Empty string and any unmapped id
81
+ * resolve to `unknown` — the bounded catch-all that keeps the group set fixed.
82
+ */
83
+ export function stageForPhase(phase) {
84
+ return PHASE_TO_STAGE[phase] ?? 'unknown';
85
+ }
86
+ /**
87
+ * Bucket items by their canonical stage, returning groups in `STAGE_ORDER`.
88
+ * Empty stages are omitted (a group exists only if ≥1 item maps into it), so
89
+ * the caller renders just the populated stages. Within a group, input order is
90
+ * preserved — the caller has already applied its display-order sort.
91
+ *
92
+ * Pure and generic over the item type, mirroring `groupByArea`. The VSCode
93
+ * Builders tree (`views/builders.ts`) is the first consumer, keying off each
94
+ * builder's `protocolPhase`.
95
+ */
96
+ export function groupByStage(items, getPhase) {
97
+ const buckets = new Map();
98
+ for (const item of items) {
99
+ const stage = stageForPhase(getPhase(item));
100
+ const bucket = buckets.get(stage);
101
+ if (bucket) {
102
+ bucket.push(item);
103
+ }
104
+ else {
105
+ buckets.set(stage, [item]);
106
+ }
107
+ }
108
+ const result = [];
109
+ for (const stage of STAGE_ORDER) {
110
+ const bucket = buckets.get(stage);
111
+ if (bucket) {
112
+ result.push({ stage, items: bucket });
113
+ }
114
+ }
115
+ return result;
116
+ }
117
+ //# sourceMappingURL=phase-grouping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phase-grouping.js","sourceRoot":"","sources":["../src/phase-grouping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAA4B;IAClD,SAAS;IACT,MAAM;IACN,WAAW;IACX,QAAQ;IACR,IAAI;IACJ,UAAU;IACV,SAAS;CACV,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAiC;IAC1D,wCAAwC;IACxC,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAChB,4CAA4C;IAC5C,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,MAAM;IACd,WAAW,EAAE,MAAM;IACnB,wBAA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AAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,161 @@
1
+ /**
2
+ * ReconnectPolicy — transport-agnostic exponential-backoff reconnect logic.
3
+ *
4
+ * Extracted from four hand-rolled copies of the `Math.min(1000 * 2^attempt, cap)`
5
+ * curve (#961): the VSCode SSE health-check, the VSCode terminal WebSocket, the
6
+ * web terminal WebSocket, and the tunnel control channel. Pure logic — no
7
+ * `vscode`, DOM, or socket dependency, so it is usable from any host that wraps
8
+ * a flaky connection. Same cross-host discipline as `EscapeBuffer`.
9
+ *
10
+ * Three exports, layered by need:
11
+ *
12
+ * - `backoffDelayMs(attempt, opts)` — the one shared curve. Takes the attempt
13
+ * index explicitly, so each call site keeps its own counter and increment
14
+ * ordering (the tunnel increments *before* computing its delay; the terminals
15
+ * compute *then* increment). This is the single primitive that replaces every
16
+ * inline `Math.min(...)`.
17
+ * - `BackoffController` — a thin counter+status+give-up wrapper over the curve,
18
+ * for the two terminal surfaces that need a give-up threshold and a status
19
+ * machine. SSE and the tunnel keep bespoke counters and call the curve fn
20
+ * directly (they never give up — SSE retries forever, the tunnel floors).
21
+ * - `classifyUpgradeError(reason)` — encapsulates the Tower close-code rule so
22
+ * every site agrees on what's worth retrying (session-unknown → permanent).
23
+ */
24
+ export interface BackoffOptions {
25
+ /** Base delay in milliseconds (the attempt-0 delay before jitter). Default 1000. */
26
+ baseMs?: number;
27
+ /** Maximum delay in milliseconds (the curve is clamped to this). Default 30_000. */
28
+ capMs?: number;
29
+ /**
30
+ * Number of consecutive failures after which {@link BackoffController}
31
+ * gives up. Default 6. Use `Infinity` for surfaces that retry forever
32
+ * (SSE health-check, tunnel control channel). Ignored by the bare
33
+ * {@link backoffDelayMs} function — it only governs the controller.
34
+ */
35
+ maxAttempts?: number;
36
+ /**
37
+ * Upper bound of random jitter (in ms) added to each delay before the cap.
38
+ * Default 0 (no jitter). The tunnel sets 1000 to avoid thundering-herd
39
+ * reconnects against the cloud relay.
40
+ */
41
+ jitterMs?: number;
42
+ /**
43
+ * Escalation floor: once `attempt >= afterAttempts`, the delay is clamped
44
+ * to `delayMs` (bypassing the exponential curve, jitter, and cap). The
45
+ * tunnel uses `{ afterAttempts: 10, delayMs: 300_000 }` — a 5-minute holding
46
+ * pattern after sustained failure instead of giving up.
47
+ */
48
+ floor?: {
49
+ afterAttempts: number;
50
+ delayMs: number;
51
+ };
52
+ /** Injectable RNG for deterministic jitter in tests. Default `Math.random`. */
53
+ random?: () => number;
54
+ }
55
+ /**
56
+ * Compute the backoff delay for a given attempt index.
57
+ *
58
+ * `min(base * 2^attempt + jitter, cap)`, with an optional floor short-circuit
59
+ * applied first. Pure: the only impurity is `opts.random` (defaults to
60
+ * `Math.random`), which callers inject for deterministic tests.
61
+ *
62
+ * The `attempt` index is explicit so each call site owns its own counter and
63
+ * increment ordering.
64
+ */
65
+ export declare function backoffDelayMs(attempt: number, opts?: BackoffOptions): number;
66
+ export type BackoffStatus = 'idle' | 'connecting' | 'connected' | 'giving-up';
67
+ export type FailureAction = 'retry' | 'give-up';
68
+ /**
69
+ * Stateful reconnect controller: tracks the consecutive-failure count and a
70
+ * status machine, and decides retry-vs-give-up against `maxAttempts`.
71
+ *
72
+ * Usage (terminal surfaces):
73
+ *
74
+ * ```
75
+ * const ctrl = new BackoffController({ maxAttempts: 6 });
76
+ * onOpen = () => ctrl.recordSuccess();
77
+ * onClose = () => {
78
+ * if (ctrl.recordFailure() === 'give-up') { surfaceGiveUp(); return; }
79
+ * scheduleRetry(ctrl.nextDelayMs(), ctrl.attempt); // attempt is 1..maxAttempts
80
+ * };
81
+ * onUserReconnect = () => { ctrl.reset(); connect(); };
82
+ * ```
83
+ *
84
+ * The give-up sequencing reproduces the pre-extraction terminal-adapter
85
+ * behavior exactly: with `maxAttempts: 6` the delays are
86
+ * `[1000, 2000, 4000, 8000, 16000, 30000]` and the 7th `recordFailure()`
87
+ * returns `'give-up'`.
88
+ */
89
+ export declare class BackoffController {
90
+ private readonly opts;
91
+ private readonly maxAttempts;
92
+ private _attempt;
93
+ private _status;
94
+ constructor(opts?: BackoffOptions);
95
+ /** Current status of the connection lifecycle. */
96
+ get status(): BackoffStatus;
97
+ /**
98
+ * Consecutive failures recorded since the last success or reset. After a
99
+ * `recordFailure()` that returns `'retry'`, this is the 1-based attempt
100
+ * number (suitable for an `attempt/max` notice).
101
+ */
102
+ get attempt(): number;
103
+ /** Begin a connection attempt. */
104
+ start(): void;
105
+ /** A connection succeeded: reset the failure count and mark connected. */
106
+ recordSuccess(): void;
107
+ /**
108
+ * A connection failed. Advances the failure count and decides the next
109
+ * action. Returns `'give-up'` (and sets status to `'giving-up'`) once the
110
+ * attempt budget is exhausted; otherwise returns `'retry'` and the delay for
111
+ * that retry is available via {@link nextDelayMs}.
112
+ */
113
+ recordFailure(): FailureAction;
114
+ /**
115
+ * Delay (ms) before the retry just authorized by `recordFailure()`. Uses the
116
+ * pre-increment attempt index, so the first retry is the base delay.
117
+ */
118
+ nextDelayMs(): number;
119
+ /**
120
+ * Manual reconnect: clear the failure count and any give-up state, and mark
121
+ * connecting. Used for the user's "reconnect now" affordance.
122
+ */
123
+ reset(): void;
124
+ /** Tear down: return to the idle state. */
125
+ stop(): void;
126
+ }
127
+ /** A connection-error reason, as a transport surfaces it. */
128
+ export type UpgradeErrorReason = string | {
129
+ code?: number;
130
+ message?: string;
131
+ };
132
+ /**
133
+ * Application-range WebSocket close code Tower uses to tell a browser client
134
+ * that the terminal session is unknown/gone. Browsers can't read a failed
135
+ * *upgrade*'s HTTP status (they only see close `1006`), so Tower accepts the
136
+ * upgrade for browser clients and immediately closes with this code, which the
137
+ * dashboard reads via `CloseEvent.code` (#971). In the WS-spec private range
138
+ * (`4000–4999`); the mnemonic `4404` echoes HTTP 404.
139
+ */
140
+ export declare const WS_CLOSE_SESSION_UNKNOWN = 4404;
141
+ /**
142
+ * Classify a connection/upgrade error as worth retrying or not.
143
+ *
144
+ * The Tower convention: a "this session/resource is gone" signal means retrying
145
+ * is hopeless, so `'permanent'`. Everything else is a transport blip →
146
+ * `'transient'`.
147
+ *
148
+ * Accepts both forms a host can produce:
149
+ * - Node `ws` surfaces a rejected upgrade as `Error.message`
150
+ * `"Unexpected server response: 404"` — the string form (Tower 404s an unknown
151
+ * session ID at the HTTP upgrade stage).
152
+ * - A browser only learns a numeric `code`. This is overloaded: it may be an
153
+ * HTTP status (`400–499`, kept for any Node code-form caller) *or* a
154
+ * WebSocket `CloseEvent.code`. The two ranges are disjoint — valid WS close
155
+ * codes live in `1000–1015` / `3000–3999` / `4000–4999`, never `400–499` —
156
+ * so one predicate handles both. Tower's browser-visible session-unknown
157
+ * close code {@link WS_CLOSE_SESSION_UNKNOWN} is `'permanent'`; a transport
158
+ * blip (`1006`) is `'transient'`.
159
+ */
160
+ export declare function classifyUpgradeError(reason: UpgradeErrorReason): 'permanent' | 'transient';
161
+ //# sourceMappingURL=reconnect-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconnect-policy.d.ts","sourceRoot":"","sources":["../src/reconnect-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,MAAM,CAYjF;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,CAAC;AAC9E,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAiB;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,OAAO,CAAyB;gBAE5B,IAAI,GAAE,cAAmB;IAKrC,kDAAkD;IAClD,IAAI,MAAM,IAAI,aAAa,CAE1B;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,kCAAkC;IAClC,KAAK,IAAI,IAAI;IAIb,0EAA0E;IAC1E,aAAa,IAAI,IAAI;IAKrB;;;;;OAKG;IACH,aAAa,IAAI,aAAa;IAU9B;;;OAGG;IACH,WAAW,IAAI,MAAM;IAIrB;;;OAGG;IACH,KAAK,IAAI,IAAI;IAKb,2CAA2C;IAC3C,IAAI,IAAI,IAAI;CAGb;AAED,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9E;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,kBAAkB,GAAG,WAAW,GAAG,WAAW,CAc1F"}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * ReconnectPolicy — transport-agnostic exponential-backoff reconnect logic.
3
+ *
4
+ * Extracted from four hand-rolled copies of the `Math.min(1000 * 2^attempt, cap)`
5
+ * curve (#961): the VSCode SSE health-check, the VSCode terminal WebSocket, the
6
+ * web terminal WebSocket, and the tunnel control channel. Pure logic — no
7
+ * `vscode`, DOM, or socket dependency, so it is usable from any host that wraps
8
+ * a flaky connection. Same cross-host discipline as `EscapeBuffer`.
9
+ *
10
+ * Three exports, layered by need:
11
+ *
12
+ * - `backoffDelayMs(attempt, opts)` — the one shared curve. Takes the attempt
13
+ * index explicitly, so each call site keeps its own counter and increment
14
+ * ordering (the tunnel increments *before* computing its delay; the terminals
15
+ * compute *then* increment). This is the single primitive that replaces every
16
+ * inline `Math.min(...)`.
17
+ * - `BackoffController` — a thin counter+status+give-up wrapper over the curve,
18
+ * for the two terminal surfaces that need a give-up threshold and a status
19
+ * machine. SSE and the tunnel keep bespoke counters and call the curve fn
20
+ * directly (they never give up — SSE retries forever, the tunnel floors).
21
+ * - `classifyUpgradeError(reason)` — encapsulates the Tower close-code rule so
22
+ * every site agrees on what's worth retrying (session-unknown → permanent).
23
+ */
24
+ const DEFAULT_BASE_MS = 1000;
25
+ const DEFAULT_CAP_MS = 30_000;
26
+ const DEFAULT_MAX_ATTEMPTS = 6;
27
+ /**
28
+ * Compute the backoff delay for a given attempt index.
29
+ *
30
+ * `min(base * 2^attempt + jitter, cap)`, with an optional floor short-circuit
31
+ * applied first. Pure: the only impurity is `opts.random` (defaults to
32
+ * `Math.random`), which callers inject for deterministic tests.
33
+ *
34
+ * The `attempt` index is explicit so each call site owns its own counter and
35
+ * increment ordering.
36
+ */
37
+ export function backoffDelayMs(attempt, opts = {}) {
38
+ const { floor } = opts;
39
+ if (floor && attempt >= floor.afterAttempts) {
40
+ return floor.delayMs;
41
+ }
42
+ const base = opts.baseMs ?? DEFAULT_BASE_MS;
43
+ const cap = opts.capMs ?? DEFAULT_CAP_MS;
44
+ const jitterMs = opts.jitterMs ?? 0;
45
+ const random = opts.random ?? Math.random;
46
+ const safeAttempt = Math.max(0, attempt);
47
+ const jitter = jitterMs > 0 ? Math.floor(random() * jitterMs) : 0;
48
+ return Math.min(base * 2 ** safeAttempt + jitter, cap);
49
+ }
50
+ /**
51
+ * Stateful reconnect controller: tracks the consecutive-failure count and a
52
+ * status machine, and decides retry-vs-give-up against `maxAttempts`.
53
+ *
54
+ * Usage (terminal surfaces):
55
+ *
56
+ * ```
57
+ * const ctrl = new BackoffController({ maxAttempts: 6 });
58
+ * onOpen = () => ctrl.recordSuccess();
59
+ * onClose = () => {
60
+ * if (ctrl.recordFailure() === 'give-up') { surfaceGiveUp(); return; }
61
+ * scheduleRetry(ctrl.nextDelayMs(), ctrl.attempt); // attempt is 1..maxAttempts
62
+ * };
63
+ * onUserReconnect = () => { ctrl.reset(); connect(); };
64
+ * ```
65
+ *
66
+ * The give-up sequencing reproduces the pre-extraction terminal-adapter
67
+ * behavior exactly: with `maxAttempts: 6` the delays are
68
+ * `[1000, 2000, 4000, 8000, 16000, 30000]` and the 7th `recordFailure()`
69
+ * returns `'give-up'`.
70
+ */
71
+ export class BackoffController {
72
+ opts;
73
+ maxAttempts;
74
+ _attempt = 0;
75
+ _status = 'idle';
76
+ constructor(opts = {}) {
77
+ this.opts = opts;
78
+ this.maxAttempts = opts.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
79
+ }
80
+ /** Current status of the connection lifecycle. */
81
+ get status() {
82
+ return this._status;
83
+ }
84
+ /**
85
+ * Consecutive failures recorded since the last success or reset. After a
86
+ * `recordFailure()` that returns `'retry'`, this is the 1-based attempt
87
+ * number (suitable for an `attempt/max` notice).
88
+ */
89
+ get attempt() {
90
+ return this._attempt;
91
+ }
92
+ /** Begin a connection attempt. */
93
+ start() {
94
+ this._status = 'connecting';
95
+ }
96
+ /** A connection succeeded: reset the failure count and mark connected. */
97
+ recordSuccess() {
98
+ this._attempt = 0;
99
+ this._status = 'connected';
100
+ }
101
+ /**
102
+ * A connection failed. Advances the failure count and decides the next
103
+ * action. Returns `'give-up'` (and sets status to `'giving-up'`) once the
104
+ * attempt budget is exhausted; otherwise returns `'retry'` and the delay for
105
+ * that retry is available via {@link nextDelayMs}.
106
+ */
107
+ recordFailure() {
108
+ if (this._attempt >= this.maxAttempts) {
109
+ this._status = 'giving-up';
110
+ return 'give-up';
111
+ }
112
+ this._attempt++;
113
+ this._status = 'connecting';
114
+ return 'retry';
115
+ }
116
+ /**
117
+ * Delay (ms) before the retry just authorized by `recordFailure()`. Uses the
118
+ * pre-increment attempt index, so the first retry is the base delay.
119
+ */
120
+ nextDelayMs() {
121
+ return backoffDelayMs(this._attempt - 1, this.opts);
122
+ }
123
+ /**
124
+ * Manual reconnect: clear the failure count and any give-up state, and mark
125
+ * connecting. Used for the user's "reconnect now" affordance.
126
+ */
127
+ reset() {
128
+ this._attempt = 0;
129
+ this._status = 'connecting';
130
+ }
131
+ /** Tear down: return to the idle state. */
132
+ stop() {
133
+ this._status = 'idle';
134
+ }
135
+ }
136
+ /**
137
+ * Application-range WebSocket close code Tower uses to tell a browser client
138
+ * that the terminal session is unknown/gone. Browsers can't read a failed
139
+ * *upgrade*'s HTTP status (they only see close `1006`), so Tower accepts the
140
+ * upgrade for browser clients and immediately closes with this code, which the
141
+ * dashboard reads via `CloseEvent.code` (#971). In the WS-spec private range
142
+ * (`4000–4999`); the mnemonic `4404` echoes HTTP 404.
143
+ */
144
+ export const WS_CLOSE_SESSION_UNKNOWN = 4404;
145
+ /**
146
+ * Classify a connection/upgrade error as worth retrying or not.
147
+ *
148
+ * The Tower convention: a "this session/resource is gone" signal means retrying
149
+ * is hopeless, so `'permanent'`. Everything else is a transport blip →
150
+ * `'transient'`.
151
+ *
152
+ * Accepts both forms a host can produce:
153
+ * - Node `ws` surfaces a rejected upgrade as `Error.message`
154
+ * `"Unexpected server response: 404"` — the string form (Tower 404s an unknown
155
+ * session ID at the HTTP upgrade stage).
156
+ * - A browser only learns a numeric `code`. This is overloaded: it may be an
157
+ * HTTP status (`400–499`, kept for any Node code-form caller) *or* a
158
+ * WebSocket `CloseEvent.code`. The two ranges are disjoint — valid WS close
159
+ * codes live in `1000–1015` / `3000–3999` / `4000–4999`, never `400–499` —
160
+ * so one predicate handles both. Tower's browser-visible session-unknown
161
+ * close code {@link WS_CLOSE_SESSION_UNKNOWN} is `'permanent'`; a transport
162
+ * blip (`1006`) is `'transient'`.
163
+ */
164
+ export function classifyUpgradeError(reason) {
165
+ if (typeof reason === 'string') {
166
+ return isPermanentMessage(reason) ? 'permanent' : 'transient';
167
+ }
168
+ if (reason.code === WS_CLOSE_SESSION_UNKNOWN) {
169
+ return 'permanent';
170
+ }
171
+ if (typeof reason.code === 'number' && reason.code >= 400 && reason.code < 500) {
172
+ return 'permanent';
173
+ }
174
+ if (typeof reason.message === 'string' && isPermanentMessage(reason.message)) {
175
+ return 'permanent';
176
+ }
177
+ return 'transient';
178
+ }
179
+ /** Tower's `ws`-client upgrade-rejection signature: a 4xx HTTP upgrade response. */
180
+ const UPGRADE_CLIENT_ERROR = /Unexpected server response: 4\d\d/;
181
+ function isPermanentMessage(message) {
182
+ return UPGRADE_CLIENT_ERROR.test(message);
183
+ }
184
+ //# sourceMappingURL=reconnect-policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconnect-policy.js","sourceRoot":"","sources":["../src/reconnect-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AA+BH,MAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B;;;;;;;;;GASG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,OAAuB,EAAE;IACvE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IACvB,IAAI,KAAK,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;QAC5C,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,IAAI,eAAe,CAAC;IAC5C,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC;IAC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;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,oFAAoF;AACpF,MAAM,oBAAoB,GAAG,mCAAmC,CAAC;AAEjE,SAAS,kBAAkB,CAAC,OAAe;IACzC,OAAO,oBAAoB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC"}
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Extracted from packages/codev/src/agent-farm/lib/tower-client.ts
8
8
  */
9
- import type { DashboardState, OverviewData, IssueView, ResolvedWorktreeConfig } from '@cluesmith/codev-types';
9
+ import type { DashboardState, OverviewData, IssueView, IssueSearchResponse, ResolvedWorktreeConfig, TowerVersionInfo } from '@cluesmith/codev-types';
10
10
  /**
11
11
  * All terminal kinds Tower can host. Used wherever a terminal is created or
12
12
  * enumerated. `'dev'` is the ephemeral dev-server PTY spawned by `afx dev`;
@@ -61,6 +61,14 @@ export interface TowerWorkspaceStatus {
61
61
  }
62
62
  export interface TowerHealth {
63
63
  status: 'healthy' | 'degraded';
64
+ /**
65
+ * Readiness (#997): true once the startup terminal-session reconcile has
66
+ * completed. Distinct from `status` (process liveness) — after a Tower
67
+ * restart, `/api/state` only reflects the full role→terminalId mapping once
68
+ * `ready` is true. Optional for back-compat with older Tower builds that
69
+ * predate the field.
70
+ */
71
+ ready?: boolean;
64
72
  uptime: number;
65
73
  activeWorkspaces: number;
66
74
  totalWorkspaces: number;
@@ -111,6 +119,22 @@ export declare class TowerClient {
111
119
  }>;
112
120
  isRunning(): Promise<boolean>;
113
121
  getHealth(): Promise<TowerHealth | null>;
122
+ /**
123
+ * Probe the *running* Tower process's version (#983, `GET /api/version`).
124
+ *
125
+ * Returns the raw request result rather than a bare `TowerVersionInfo | null`
126
+ * so the caller can tell the cases apart: `status === 404` means the Tower is
127
+ * too old to expose the endpoint (a divergence signal in its own right),
128
+ * while `status === 0` means unreachable. Keeping that distinction here would
129
+ * bake preflight policy into the wire client — the VS Code preflight owns the
130
+ * interpretation.
131
+ */
132
+ getVersion(): Promise<{
133
+ ok: boolean;
134
+ status: number;
135
+ data?: TowerVersionInfo;
136
+ error?: string;
137
+ }>;
114
138
  listWorkspaces(): Promise<TowerWorkspace[]>;
115
139
  activateWorkspace(workspacePath: string): Promise<{
116
140
  ok: boolean;
@@ -157,6 +181,14 @@ export declare class TowerClient {
157
181
  * resolved (forge unavailable, bad number) so callers can degrade.
158
182
  */
159
183
  getIssue(issueNumber: string, workspacePath?: string): Promise<IssueView | null>;
184
+ /**
185
+ * Fetch the searchable issue dataset (incl. body) from Tower's
186
+ * GET /api/issue-search. Powers the VSCode "Search Backlog" panel,
187
+ * which filters/sorts the returned rows host-side. `state` selects the
188
+ * issue set (default `open` = the sidebar backlog; `closed`/`all` lift
189
+ * the PR-exclusion). Returns null on transport failure so callers degrade.
190
+ */
191
+ searchIssues(workspacePath?: string, state?: 'open' | 'closed' | 'all'): Promise<IssueSearchResponse | null>;
160
192
  /**
161
193
  * Fetch the canonical resolved worktree config (defaults / cache /
162
194
  * global / project / project-local layers, deep-merged) from Tower's
@@ -1 +1 @@
1
- {"version":3,"file":"tower-client.d.ts","sourceRoot":"","sources":["../src/tower-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAQ9G;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAErE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,S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AAM,CAAC;QACvB,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,GACA,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IA2B1D,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAI7D,eAAe,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAKpD,SAAS,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAKxC,gBAAgB,CAAC,OAAO,EAAE;QAC9B,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,OAAO,CAAC;IAQpB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAG7C;AAMD,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAKzD"}
@@ -75,6 +75,19 @@ export class TowerClient {
75
75
  const result = await this.request('/health');
76
76
  return result.ok ? result.data : null;
77
77
  }
78
+ /**
79
+ * Probe the *running* Tower process's version (#983, `GET /api/version`).
80
+ *
81
+ * Returns the raw request result rather than a bare `TowerVersionInfo | null`
82
+ * so the caller can tell the cases apart: `status === 404` means the Tower is
83
+ * too old to expose the endpoint (a divergence signal in its own right),
84
+ * while `status === 0` means unreachable. Keeping that distinction here would
85
+ * bake preflight policy into the wire client — the VS Code preflight owns the
86
+ * interpretation.
87
+ */
88
+ async getVersion() {
89
+ return this.request('/api/version');
90
+ }
78
91
  async listWorkspaces() {
79
92
  const result = await this.request('/api/workspaces');
80
93
  return result.ok ? result.data.workspaces : [];
@@ -177,6 +190,25 @@ export class TowerClient {
177
190
  const result = await this.request(`/api/issue?${params.toString()}`);
178
191
  return result.ok ? result.data : null;
179
192
  }
193
+ /**
194
+ * Fetch the searchable issue dataset (incl. body) from Tower's
195
+ * GET /api/issue-search. Powers the VSCode "Search Backlog" panel,
196
+ * which filters/sorts the returned rows host-side. `state` selects the
197
+ * issue set (default `open` = the sidebar backlog; `closed`/`all` lift
198
+ * the PR-exclusion). Returns null on transport failure so callers degrade.
199
+ */
200
+ async searchIssues(workspacePath, state) {
201
+ const params = new URLSearchParams();
202
+ if (workspacePath) {
203
+ params.set('workspace', workspacePath);
204
+ }
205
+ if (state) {
206
+ params.set('state', state);
207
+ }
208
+ const qs = params.toString();
209
+ const result = await this.request(`/api/issue-search${qs ? `?${qs}` : ''}`);
210
+ return result.ok ? result.data : null;
211
+ }
180
212
  /**
181
213
  * Fetch the canonical resolved worktree config (defaults / cache /
182
214
  * global / project / project-local layers, deep-merged) from Tower's
@@ -1 +1 @@
1
- {"version":3,"file":"tower-client.js","sourceRoot":"","sources":["../src/tower-client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAsGjC,kEAAkE;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,OAAO,WAAW;IACL,OAAO,CAAS;IAChB,UAAU,CAAsB;IAEjD,YAAY,aAA2C;QACrD,MAAM,OAAO,GAAuB,OAAO,aAAa,KAAK,QAAQ;YACnE,CAAC,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE;YACzB,CAAC,CAAC,aAAa,IAAI,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,WAAW,CAAC;QAC1E,MA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AAM,CAAC,EAAE,CAAC;IACnB,CAAC;IAED,gBAAgB,CAAC,UAAkB;QACjC,OAAO,kBAAkB,IAAI,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,gBAAgB,UAAU,EAAE,CAAC;IAClF,CAAC;CACF;AAED,kEAAkE;AAElE,IAAI,aAAa,GAAuB,IAAI,CAAC;AAE7C,MAAM,UAAU,cAAc,CAAC,IAAa;IAC1C,IAAI,CAAC,aAAa,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,kBAAkB,CAAC,EAAE,CAAC;QAC5D,aAAa,GAAG,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cluesmith/codev-core",
3
- "version": "3.1.6",
3
+ "version": "3.1.8",
4
4
  "description": "Core runtime utilities for Codev — Tower client, auth, workspace helpers, escape buffer",
5
5
  "type": "module",
6
6
  "exports": {
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/escape-buffer.d.ts",
25
25
  "default": "./dist/escape-buffer.js"
26
26
  },
27
+ "./reconnect-policy": {
28
+ "types": "./dist/reconnect-policy.d.ts",
29
+ "default": "./dist/reconnect-policy.js"
30
+ },
27
31
  "./agent-names": {
28
32
  "types": "./dist/agent-names.d.ts",
29
33
  "default": "./dist/agent-names.js"
@@ -35,19 +39,26 @@
35
39
  "./area-grouping": {
36
40
  "types": "./dist/area-grouping.d.ts",
37
41
  "default": "./dist/area-grouping.js"
42
+ },
43
+ "./phase-grouping": {
44
+ "types": "./dist/phase-grouping.d.ts",
45
+ "default": "./dist/phase-grouping.js"
38
46
  }
39
47
  },
40
48
  "files": [
41
49
  "dist"
42
50
  ],
51
+ "scripts": {
52
+ "build": "tsc",
53
+ "check-types": "tsc --noEmit",
54
+ "test": "vitest run",
55
+ "prepublishOnly": "pnpm build"
56
+ },
43
57
  "devDependencies": {
58
+ "@cluesmith/codev-types": "workspace:*",
44
59
  "@types/node": "22.x",
45
60
  "typescript": "^5.7.0",
46
- "@cluesmith/codev-types": "3.1.6"
61
+ "vitest": "^4.0.15"
47
62
  },
48
- "license": "Apache-2.0",
49
- "scripts": {
50
- "build": "tsc",
51
- "check-types": "tsc --noEmit"
52
- }
53
- }
63
+ "license": "Apache-2.0"
64
+ }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.