@grackle-ai/ahp 0.131.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/vendor/ahp/action-origin.generated.d.ts +33 -0
- package/dist/vendor/ahp/action-origin.generated.d.ts.map +1 -0
- package/dist/vendor/ahp/action-origin.generated.js +71 -0
- package/dist/vendor/ahp/action-origin.generated.js.map +1 -0
- package/dist/vendor/ahp/actions.d.ts +14 -0
- package/dist/vendor/ahp/actions.d.ts.map +1 -0
- package/dist/vendor/ahp/actions.js +15 -0
- package/dist/vendor/ahp/actions.js.map +1 -0
- package/dist/vendor/ahp/channels-changeset/actions.d.ts +87 -0
- package/dist/vendor/ahp/channels-changeset/actions.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-changeset/actions.js +9 -0
- package/dist/vendor/ahp/channels-changeset/actions.js.map +1 -0
- package/dist/vendor/ahp/channels-changeset/commands.d.ts +103 -0
- package/dist/vendor/ahp/channels-changeset/commands.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-changeset/commands.js +22 -0
- package/dist/vendor/ahp/channels-changeset/commands.js.map +1 -0
- package/dist/vendor/ahp/channels-changeset/reducer.d.ts +18 -0
- package/dist/vendor/ahp/channels-changeset/reducer.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-changeset/reducer.js +65 -0
- package/dist/vendor/ahp/channels-changeset/reducer.js.map +1 -0
- package/dist/vendor/ahp/channels-changeset/state.d.ts +155 -0
- package/dist/vendor/ahp/channels-changeset/state.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-changeset/state.js +39 -0
- package/dist/vendor/ahp/channels-changeset/state.js.map +1 -0
- package/dist/vendor/ahp/channels-otlp/notifications.d.ts +121 -0
- package/dist/vendor/ahp/channels-otlp/notifications.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-otlp/notifications.js +11 -0
- package/dist/vendor/ahp/channels-otlp/notifications.js.map +1 -0
- package/dist/vendor/ahp/channels-otlp/state.d.ts +65 -0
- package/dist/vendor/ahp/channels-otlp/state.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-otlp/state.js +10 -0
- package/dist/vendor/ahp/channels-otlp/state.js.map +1 -0
- package/dist/vendor/ahp/channels-root/actions.d.ts +62 -0
- package/dist/vendor/ahp/channels-root/actions.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-root/actions.js +8 -0
- package/dist/vendor/ahp/channels-root/actions.js.map +1 -0
- package/dist/vendor/ahp/channels-root/commands.d.ts +172 -0
- package/dist/vendor/ahp/channels-root/commands.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-root/commands.js +10 -0
- package/dist/vendor/ahp/channels-root/commands.js.map +1 -0
- package/dist/vendor/ahp/channels-root/notifications.d.ts +136 -0
- package/dist/vendor/ahp/channels-root/notifications.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-root/notifications.js +9 -0
- package/dist/vendor/ahp/channels-root/notifications.js.map +1 -0
- package/dist/vendor/ahp/channels-root/reducer.d.ts +12 -0
- package/dist/vendor/ahp/channels-root/reducer.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-root/reducer.js +36 -0
- package/dist/vendor/ahp/channels-root/reducer.js.map +1 -0
- package/dist/vendor/ahp/channels-root/state.d.ts +123 -0
- package/dist/vendor/ahp/channels-root/state.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-root/state.js +19 -0
- package/dist/vendor/ahp/channels-root/state.js.map +1 -0
- package/dist/vendor/ahp/channels-session/actions.d.ts +736 -0
- package/dist/vendor/ahp/channels-session/actions.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-session/actions.js +8 -0
- package/dist/vendor/ahp/channels-session/actions.js.map +1 -0
- package/dist/vendor/ahp/channels-session/commands.d.ts +261 -0
- package/dist/vendor/ahp/channels-session/commands.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-session/commands.js +23 -0
- package/dist/vendor/ahp/channels-session/commands.js.map +1 -0
- package/dist/vendor/ahp/channels-session/reducer.d.ts +14 -0
- package/dist/vendor/ahp/channels-session/reducer.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-session/reducer.js +703 -0
- package/dist/vendor/ahp/channels-session/reducer.js.map +1 -0
- package/dist/vendor/ahp/channels-session/state.d.ts +1217 -0
- package/dist/vendor/ahp/channels-session/state.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-session/state.js +229 -0
- package/dist/vendor/ahp/channels-session/state.js.map +1 -0
- package/dist/vendor/ahp/channels-terminal/actions.d.ts +185 -0
- package/dist/vendor/ahp/channels-terminal/actions.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-terminal/actions.js +8 -0
- package/dist/vendor/ahp/channels-terminal/actions.js.map +1 -0
- package/dist/vendor/ahp/channels-terminal/commands.d.ts +50 -0
- package/dist/vendor/ahp/channels-terminal/commands.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-terminal/commands.js +8 -0
- package/dist/vendor/ahp/channels-terminal/commands.js.map +1 -0
- package/dist/vendor/ahp/channels-terminal/reducer.d.ts +12 -0
- package/dist/vendor/ahp/channels-terminal/reducer.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-terminal/reducer.js +80 -0
- package/dist/vendor/ahp/channels-terminal/reducer.js.map +1 -0
- package/dist/vendor/ahp/channels-terminal/state.d.ts +151 -0
- package/dist/vendor/ahp/channels-terminal/state.d.ts.map +1 -0
- package/dist/vendor/ahp/channels-terminal/state.js +18 -0
- package/dist/vendor/ahp/channels-terminal/state.js.map +1 -0
- package/dist/vendor/ahp/commands.d.ts +14 -0
- package/dist/vendor/ahp/commands.d.ts.map +1 -0
- package/dist/vendor/ahp/commands.js +15 -0
- package/dist/vendor/ahp/commands.js.map +1 -0
- package/dist/vendor/ahp/common/actions.d.ts +107 -0
- package/dist/vendor/ahp/common/actions.d.ts.map +1 -0
- package/dist/vendor/ahp/common/actions.js +77 -0
- package/dist/vendor/ahp/common/actions.js.map +1 -0
- package/dist/vendor/ahp/common/commands.d.ts +594 -0
- package/dist/vendor/ahp/common/commands.d.ts.map +1 -0
- package/dist/vendor/ahp/common/commands.js +32 -0
- package/dist/vendor/ahp/common/commands.js.map +1 -0
- package/dist/vendor/ahp/common/errors.d.ts +184 -0
- package/dist/vendor/ahp/common/errors.d.ts.map +1 -0
- package/dist/vendor/ahp/common/errors.js +82 -0
- package/dist/vendor/ahp/common/errors.js.map +1 -0
- package/dist/vendor/ahp/common/messages.d.ts +330 -0
- package/dist/vendor/ahp/common/messages.d.ts.map +1 -0
- package/dist/vendor/ahp/common/messages.js +11 -0
- package/dist/vendor/ahp/common/messages.js.map +1 -0
- package/dist/vendor/ahp/common/notifications.d.ts +58 -0
- package/dist/vendor/ahp/common/notifications.d.ts.map +1 -0
- package/dist/vendor/ahp/common/notifications.js +20 -0
- package/dist/vendor/ahp/common/notifications.js.map +1 -0
- package/dist/vendor/ahp/common/reducer-helpers.d.ts +24 -0
- package/dist/vendor/ahp/common/reducer-helpers.d.ts.map +1 -0
- package/dist/vendor/ahp/common/reducer-helpers.js +31 -0
- package/dist/vendor/ahp/common/reducer-helpers.js.map +1 -0
- package/dist/vendor/ahp/common/state.d.ts +286 -0
- package/dist/vendor/ahp/common/state.d.ts.map +1 -0
- package/dist/vendor/ahp/common/state.js +11 -0
- package/dist/vendor/ahp/common/state.js.map +1 -0
- package/dist/vendor/ahp/errors.d.ts +8 -0
- package/dist/vendor/ahp/errors.d.ts.map +1 -0
- package/dist/vendor/ahp/errors.js +9 -0
- package/dist/vendor/ahp/errors.js.map +1 -0
- package/dist/vendor/ahp/index.d.ts +24 -0
- package/dist/vendor/ahp/index.d.ts.map +1 -0
- package/dist/vendor/ahp/index.js +21 -0
- package/dist/vendor/ahp/index.js.map +1 -0
- package/dist/vendor/ahp/messages.d.ts +8 -0
- package/dist/vendor/ahp/messages.d.ts.map +1 -0
- package/dist/vendor/ahp/messages.js +9 -0
- package/dist/vendor/ahp/messages.js.map +1 -0
- package/dist/vendor/ahp/notifications.d.ts +11 -0
- package/dist/vendor/ahp/notifications.d.ts.map +1 -0
- package/dist/vendor/ahp/notifications.js +12 -0
- package/dist/vendor/ahp/notifications.js.map +1 -0
- package/dist/vendor/ahp/reducers.d.ts +12 -0
- package/dist/vendor/ahp/reducers.d.ts.map +1 -0
- package/dist/vendor/ahp/reducers.js +13 -0
- package/dist/vendor/ahp/reducers.js.map +1 -0
- package/dist/vendor/ahp/state.d.ts +15 -0
- package/dist/vendor/ahp/state.d.ts.map +1 -0
- package/dist/vendor/ahp/state.js +16 -0
- package/dist/vendor/ahp/state.js.map +1 -0
- package/dist/vendor/ahp/version/message-checks.d.ts +15 -0
- package/dist/vendor/ahp/version/message-checks.d.ts.map +1 -0
- package/dist/vendor/ahp/version/message-checks.js +16 -0
- package/dist/vendor/ahp/version/message-checks.js.map +1 -0
- package/dist/vendor/ahp/version/registry.d.ts +56 -0
- package/dist/vendor/ahp/version/registry.d.ts.map +1 -0
- package/dist/vendor/ahp/version/registry.js +138 -0
- package/dist/vendor/ahp/version/registry.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable -- vendored third-party code, see SOURCE.md */
|
|
2
|
+
/**
|
|
3
|
+
* Reducer Functions — Aggregator shim that re-exports the channel-organized
|
|
4
|
+
* pure state reducers and dispatch helpers.
|
|
5
|
+
*
|
|
6
|
+
* @module reducers
|
|
7
|
+
*/
|
|
8
|
+
export { rootReducer } from './channels-root/reducer.js';
|
|
9
|
+
export { sessionReducer } from './channels-session/reducer.js';
|
|
10
|
+
export { terminalReducer } from './channels-terminal/reducer.js';
|
|
11
|
+
export { changesetReducer } from './channels-changeset/reducer.js';
|
|
12
|
+
export { softAssertNever, isClientDispatchable } from './common/reducer-helpers.js';
|
|
13
|
+
//# sourceMappingURL=reducers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducers.js","sourceRoot":"","sources":["../../../src/vendor/ahp/reducers.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State Types — Aggregator shim that re-exports channel-organized state
|
|
3
|
+
* declarations. New code should import directly from the per-channel files
|
|
4
|
+
* under `types/common/`, `types/channels-root/`, `types/channels-session/`,
|
|
5
|
+
* `types/channels-terminal/`, and `types/channels-changeset/`.
|
|
6
|
+
*
|
|
7
|
+
* @module state
|
|
8
|
+
*/
|
|
9
|
+
export * from './common/state.js';
|
|
10
|
+
export * from './channels-root/state.js';
|
|
11
|
+
export * from './channels-session/state.js';
|
|
12
|
+
export * from './channels-terminal/state.js';
|
|
13
|
+
export * from './channels-changeset/state.js';
|
|
14
|
+
export * from './channels-otlp/state.js';
|
|
15
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/vendor/ahp/state.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable -- vendored third-party code, see SOURCE.md */
|
|
2
|
+
/**
|
|
3
|
+
* State Types — Aggregator shim that re-exports channel-organized state
|
|
4
|
+
* declarations. New code should import directly from the per-channel files
|
|
5
|
+
* under `types/common/`, `types/channels-root/`, `types/channels-session/`,
|
|
6
|
+
* `types/channels-terminal/`, and `types/channels-changeset/`.
|
|
7
|
+
*
|
|
8
|
+
* @module state
|
|
9
|
+
*/
|
|
10
|
+
export * from './common/state.js';
|
|
11
|
+
export * from './channels-root/state.js';
|
|
12
|
+
export * from './channels-session/state.js';
|
|
13
|
+
export * from './channels-terminal/state.js';
|
|
14
|
+
export * from './channels-changeset/state.js';
|
|
15
|
+
export * from './channels-otlp/state.js';
|
|
16
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/vendor/ahp/state.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;;;;GAOG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Map Exhaustiveness Checks — Compile-time verification that the
|
|
3
|
+
* command and notification maps in messages.ts stay in sync with the actual
|
|
4
|
+
* method definitions, and that every command and notification carries a
|
|
5
|
+
* top-level `channel: URI`.
|
|
6
|
+
*
|
|
7
|
+
* If a method is added to commands.ts or notifications.ts but not
|
|
8
|
+
* registered in the maps (or vice versa), the compiler will surface an
|
|
9
|
+
* error here. If any command or notification's params shape is missing
|
|
10
|
+
* `channel: URI`, the compiler will also surface an error.
|
|
11
|
+
*
|
|
12
|
+
* @module version/message-checks
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=message-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-checks.d.ts","sourceRoot":"","sources":["../../../../src/vendor/ahp/version/message-checks.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* eslint-disable -- vendored third-party code, see SOURCE.md */
|
|
2
|
+
/**
|
|
3
|
+
* Message Map Exhaustiveness Checks — Compile-time verification that the
|
|
4
|
+
* command and notification maps in messages.ts stay in sync with the actual
|
|
5
|
+
* method definitions, and that every command and notification carries a
|
|
6
|
+
* top-level `channel: URI`.
|
|
7
|
+
*
|
|
8
|
+
* If a method is added to commands.ts or notifications.ts but not
|
|
9
|
+
* registered in the maps (or vice versa), the compiler will surface an
|
|
10
|
+
* error here. If any command or notification's params shape is missing
|
|
11
|
+
* `channel: URI`, the compiler will also surface an error.
|
|
12
|
+
*
|
|
13
|
+
* @module version/message-checks
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=message-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-checks.js","sourceRoot":"","sources":["../../../../src/vendor/ahp/version/message-checks.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Registry — Maps action types and features to protocol versions.
|
|
3
|
+
*
|
|
4
|
+
* @module version/registry
|
|
5
|
+
*/
|
|
6
|
+
import type { StateAction } from '../actions.js';
|
|
7
|
+
import type { ServerNotificationMap } from '../messages.js';
|
|
8
|
+
/**
|
|
9
|
+
* The current protocol version that new code speaks.
|
|
10
|
+
*
|
|
11
|
+
* Formatted as a [SemVer](https://semver.org) `MAJOR.MINOR.PATCH` string.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PROTOCOL_VERSION = "0.2.0";
|
|
14
|
+
/**
|
|
15
|
+
* Compares two `MAJOR.MINOR.PATCH` SemVer strings.
|
|
16
|
+
*
|
|
17
|
+
* Returns a negative number if `a < b`, zero if `a === b`, and a positive
|
|
18
|
+
* number if `a > b`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function compareProtocolVersions(a: string, b: string): number;
|
|
21
|
+
/**
|
|
22
|
+
* Maps every action type to the protocol version that introduced it.
|
|
23
|
+
* Adding a new action to `StateAction` without adding it here is a compile error.
|
|
24
|
+
*
|
|
25
|
+
* Versions are SemVer `MAJOR.MINOR.PATCH` strings (see `PROTOCOL_VERSION`).
|
|
26
|
+
*/
|
|
27
|
+
export declare const ACTION_INTRODUCED_IN: {
|
|
28
|
+
readonly [K in StateAction['type']]: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Returns whether the given action type is known to the specified protocol version.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isActionKnownToVersion(action: StateAction, clientVersion: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Server → client notification method names that are part of the AHP
|
|
36
|
+
* protocol surface. The set is a subset of {@link ServerNotificationMap}
|
|
37
|
+
* keys that excludes `action` (the action envelope) since action versions
|
|
38
|
+
* are tracked via {@link ACTION_INTRODUCED_IN}.
|
|
39
|
+
*/
|
|
40
|
+
export type ProtocolNotificationMethod = Exclude<keyof ServerNotificationMap, 'action'>;
|
|
41
|
+
/**
|
|
42
|
+
* Maps every server → client protocol notification method to the protocol
|
|
43
|
+
* version that introduced it. Adding a new notification method to
|
|
44
|
+
* {@link ServerNotificationMap} without adding it here is a compile error.
|
|
45
|
+
*
|
|
46
|
+
* Versions are SemVer `MAJOR.MINOR.PATCH` strings (see `PROTOCOL_VERSION`).
|
|
47
|
+
*/
|
|
48
|
+
export declare const NOTIFICATION_INTRODUCED_IN: {
|
|
49
|
+
readonly [K in ProtocolNotificationMethod]: string;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Returns whether the given notification method is known to the specified
|
|
53
|
+
* protocol version.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isNotificationKnownToVersion(method: ProtocolNotificationMethod, clientVersion: string): boolean;
|
|
56
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/vendor/ahp/version/registry.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAI5D;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAmBxC;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAIpE;AAID;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM;CA4D/E,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAE1F;AAID;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,MAAM,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AAExF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,EAAE;IAAE,QAAQ,EAAE,CAAC,IAAI,0BAA0B,GAAG,MAAM;CAQ5F,CAAC;AAEF;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,0BAA0B,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAE/G"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* eslint-disable -- vendored third-party code, see SOURCE.md */
|
|
2
|
+
/**
|
|
3
|
+
* Version Registry — Maps action types and features to protocol versions.
|
|
4
|
+
*
|
|
5
|
+
* @module version/registry
|
|
6
|
+
*/
|
|
7
|
+
import { ActionType } from '../actions.js';
|
|
8
|
+
// ─── Protocol Version Constants ──────────────────────────────────────────────
|
|
9
|
+
/**
|
|
10
|
+
* The current protocol version that new code speaks.
|
|
11
|
+
*
|
|
12
|
+
* Formatted as a [SemVer](https://semver.org) `MAJOR.MINOR.PATCH` string.
|
|
13
|
+
*/
|
|
14
|
+
export const PROTOCOL_VERSION = '0.2.0';
|
|
15
|
+
// ─── SemVer Comparison ───────────────────────────────────────────────────────
|
|
16
|
+
/**
|
|
17
|
+
* Parses a `MAJOR.MINOR.PATCH` SemVer string into its three numeric
|
|
18
|
+
* components. Pre-release and build metadata are not supported and MUST NOT
|
|
19
|
+
* be present in protocol version strings.
|
|
20
|
+
*
|
|
21
|
+
* Throws if `version` is not a well-formed `MAJOR.MINOR.PATCH` string.
|
|
22
|
+
*/
|
|
23
|
+
function parseSemver(version) {
|
|
24
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
|
|
25
|
+
if (!match) {
|
|
26
|
+
throw new Error(`Invalid protocol version: ${version}`);
|
|
27
|
+
}
|
|
28
|
+
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Compares two `MAJOR.MINOR.PATCH` SemVer strings.
|
|
32
|
+
*
|
|
33
|
+
* Returns a negative number if `a < b`, zero if `a === b`, and a positive
|
|
34
|
+
* number if `a > b`.
|
|
35
|
+
*/
|
|
36
|
+
export function compareProtocolVersions(a, b) {
|
|
37
|
+
const [aMajor, aMinor, aPatch] = parseSemver(a);
|
|
38
|
+
const [bMajor, bMinor, bPatch] = parseSemver(b);
|
|
39
|
+
return (aMajor - bMajor) || (aMinor - bMinor) || (aPatch - bPatch);
|
|
40
|
+
}
|
|
41
|
+
// ─── Exhaustive Action → Version Map ─────────────────────────────────────────
|
|
42
|
+
/**
|
|
43
|
+
* Maps every action type to the protocol version that introduced it.
|
|
44
|
+
* Adding a new action to `StateAction` without adding it here is a compile error.
|
|
45
|
+
*
|
|
46
|
+
* Versions are SemVer `MAJOR.MINOR.PATCH` strings (see `PROTOCOL_VERSION`).
|
|
47
|
+
*/
|
|
48
|
+
export const ACTION_INTRODUCED_IN = {
|
|
49
|
+
[ActionType.RootAgentsChanged]: '0.1.0',
|
|
50
|
+
[ActionType.RootActiveSessionsChanged]: '0.1.0',
|
|
51
|
+
[ActionType.SessionReady]: '0.1.0',
|
|
52
|
+
[ActionType.SessionCreationFailed]: '0.1.0',
|
|
53
|
+
[ActionType.SessionTurnStarted]: '0.1.0',
|
|
54
|
+
[ActionType.SessionDelta]: '0.1.0',
|
|
55
|
+
[ActionType.SessionResponsePart]: '0.1.0',
|
|
56
|
+
[ActionType.SessionToolCallStart]: '0.1.0',
|
|
57
|
+
[ActionType.SessionToolCallDelta]: '0.1.0',
|
|
58
|
+
[ActionType.SessionToolCallReady]: '0.1.0',
|
|
59
|
+
[ActionType.SessionToolCallConfirmed]: '0.1.0',
|
|
60
|
+
[ActionType.SessionToolCallComplete]: '0.1.0',
|
|
61
|
+
[ActionType.SessionToolCallResultConfirmed]: '0.1.0',
|
|
62
|
+
[ActionType.SessionToolCallContentChanged]: '0.1.0',
|
|
63
|
+
[ActionType.SessionTurnComplete]: '0.1.0',
|
|
64
|
+
[ActionType.SessionTurnCancelled]: '0.1.0',
|
|
65
|
+
[ActionType.SessionError]: '0.1.0',
|
|
66
|
+
[ActionType.SessionTitleChanged]: '0.1.0',
|
|
67
|
+
[ActionType.SessionUsage]: '0.1.0',
|
|
68
|
+
[ActionType.SessionReasoning]: '0.1.0',
|
|
69
|
+
[ActionType.SessionModelChanged]: '0.1.0',
|
|
70
|
+
[ActionType.SessionAgentChanged]: '0.2.0',
|
|
71
|
+
[ActionType.SessionServerToolsChanged]: '0.1.0',
|
|
72
|
+
[ActionType.SessionActiveClientChanged]: '0.1.0',
|
|
73
|
+
[ActionType.SessionActiveClientToolsChanged]: '0.1.0',
|
|
74
|
+
[ActionType.SessionPendingMessageSet]: '0.1.0',
|
|
75
|
+
[ActionType.SessionPendingMessageRemoved]: '0.1.0',
|
|
76
|
+
[ActionType.SessionQueuedMessagesReordered]: '0.1.0',
|
|
77
|
+
[ActionType.SessionInputRequested]: '0.1.0',
|
|
78
|
+
[ActionType.SessionInputAnswerChanged]: '0.1.0',
|
|
79
|
+
[ActionType.SessionInputCompleted]: '0.1.0',
|
|
80
|
+
[ActionType.SessionCustomizationsChanged]: '0.1.0',
|
|
81
|
+
[ActionType.SessionCustomizationToggled]: '0.1.0',
|
|
82
|
+
[ActionType.SessionCustomizationUpdated]: '0.1.0',
|
|
83
|
+
[ActionType.SessionTruncated]: '0.1.0',
|
|
84
|
+
[ActionType.SessionIsReadChanged]: '0.1.0',
|
|
85
|
+
[ActionType.SessionIsArchivedChanged]: '0.1.0',
|
|
86
|
+
[ActionType.SessionActivityChanged]: '0.1.0',
|
|
87
|
+
[ActionType.SessionChangesetsChanged]: '0.2.0',
|
|
88
|
+
[ActionType.SessionConfigChanged]: '0.1.0',
|
|
89
|
+
[ActionType.SessionMetaChanged]: '0.1.0',
|
|
90
|
+
[ActionType.ChangesetStatusChanged]: '0.2.0',
|
|
91
|
+
[ActionType.ChangesetFileSet]: '0.2.0',
|
|
92
|
+
[ActionType.ChangesetFileRemoved]: '0.2.0',
|
|
93
|
+
[ActionType.ChangesetOperationsChanged]: '0.2.0',
|
|
94
|
+
[ActionType.ChangesetCleared]: '0.2.0',
|
|
95
|
+
[ActionType.RootTerminalsChanged]: '0.1.0',
|
|
96
|
+
[ActionType.RootConfigChanged]: '0.1.0',
|
|
97
|
+
[ActionType.TerminalData]: '0.1.0',
|
|
98
|
+
[ActionType.TerminalInput]: '0.1.0',
|
|
99
|
+
[ActionType.TerminalResized]: '0.1.0',
|
|
100
|
+
[ActionType.TerminalClaimed]: '0.1.0',
|
|
101
|
+
[ActionType.TerminalTitleChanged]: '0.1.0',
|
|
102
|
+
[ActionType.TerminalCwdChanged]: '0.1.0',
|
|
103
|
+
[ActionType.TerminalExited]: '0.1.0',
|
|
104
|
+
[ActionType.TerminalCleared]: '0.1.0',
|
|
105
|
+
[ActionType.TerminalCommandDetectionAvailable]: '0.1.0',
|
|
106
|
+
[ActionType.TerminalCommandExecuted]: '0.1.0',
|
|
107
|
+
[ActionType.TerminalCommandFinished]: '0.1.0',
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Returns whether the given action type is known to the specified protocol version.
|
|
111
|
+
*/
|
|
112
|
+
export function isActionKnownToVersion(action, clientVersion) {
|
|
113
|
+
return compareProtocolVersions(ACTION_INTRODUCED_IN[action.type], clientVersion) <= 0;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Maps every server → client protocol notification method to the protocol
|
|
117
|
+
* version that introduced it. Adding a new notification method to
|
|
118
|
+
* {@link ServerNotificationMap} without adding it here is a compile error.
|
|
119
|
+
*
|
|
120
|
+
* Versions are SemVer `MAJOR.MINOR.PATCH` strings (see `PROTOCOL_VERSION`).
|
|
121
|
+
*/
|
|
122
|
+
export const NOTIFICATION_INTRODUCED_IN = {
|
|
123
|
+
'root/sessionAdded': '0.1.0',
|
|
124
|
+
'root/sessionRemoved': '0.1.0',
|
|
125
|
+
'root/sessionSummaryChanged': '0.1.0',
|
|
126
|
+
'auth/required': '0.1.0',
|
|
127
|
+
'otlp/exportLogs': '0.2.0',
|
|
128
|
+
'otlp/exportTraces': '0.2.0',
|
|
129
|
+
'otlp/exportMetrics': '0.2.0',
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Returns whether the given notification method is known to the specified
|
|
133
|
+
* protocol version.
|
|
134
|
+
*/
|
|
135
|
+
export function isNotificationKnownToVersion(method, clientVersion) {
|
|
136
|
+
return compareProtocolVersions(NOTIFICATION_INTRODUCED_IN[method], clientVersion) <= 0;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/vendor/ahp/version/registry.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;GAIG;AAGH,O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CAAC,kBAAkB,CAAC,EAAE,OAAO;IACxC,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,OAAO;IACpC,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,OAAO;IACrC,CAAC,UAAU,CAAC,iCAAiC,CAAC,EAAE,OAAO;IACvD,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,OAAO;IAC7C,CAAC,UAAU,CAAC,uBAAuB,CAAC,EAAE,OAAO;CAC9C,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAmB,EAAE,aAAqB;IAC/E,OAAO,uBAAuB,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;AACxF,CAAC;AAYD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA2D;IAChG,mBAAmB,EAAE,OAAO;IAC5B,qBAAqB,EAAE,OAAO;IAC9B,4BAA4B,EAAE,OAAO;IACrC,eAAe,EAAE,OAAO;IACxB,iBAAiB,EAAE,OAAO;IAC1B,mBAAmB,EAAE,OAAO;IAC5B,oBAAoB,EAAE,OAAO;CAC9B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAkC,EAAE,aAAqB;IACpG,OAAO,uBAAuB,CAAC,0BAA0B,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;AACzF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grackle-ai/ahp",
|
|
3
|
+
"version": "0.131.0",
|
|
4
|
+
"description": "Agent Host Protocol (AHP) type definitions and reducers — vendored from Microsoft's open-source AHP repo, built via prebuild transform step.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/nick-pape/grackle.git",
|
|
9
|
+
"directory": "packages/ahp"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"grackle",
|
|
13
|
+
"ahp",
|
|
14
|
+
"agent-host-protocol",
|
|
15
|
+
"microsoft"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/nick-pape/grackle#readme",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/nick-pape/grackle/issues"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.0.0 <24.0.0"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist/"
|
|
29
|
+
],
|
|
30
|
+
"dependencies": {},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"agent-host-protocol": "git+https://github.com/microsoft/agent-host-protocol.git#7c6b727bde61bc2c490201fb0e47a86759172782",
|
|
33
|
+
"@rushstack/heft": "1.2.7",
|
|
34
|
+
"@types/node": "^22.0.0",
|
|
35
|
+
"vitest": "^3.1.1",
|
|
36
|
+
"@grackle-ai/heft-rig": "0.0.1"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "node scripts/prebuild.mjs && heft build --clean",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"pretest": "node scripts/prebuild.mjs",
|
|
42
|
+
"clean": "heft clean",
|
|
43
|
+
"prebuild": "node scripts/prebuild.mjs",
|
|
44
|
+
"_phase:build": "node scripts/prebuild.mjs && heft run --only build -- --clean",
|
|
45
|
+
"_phase:test": "vitest run"
|
|
46
|
+
}
|
|
47
|
+
}
|