@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.
Files changed (153) hide show
  1. package/dist/index.d.ts +23 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +23 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/vendor/ahp/action-origin.generated.d.ts +33 -0
  6. package/dist/vendor/ahp/action-origin.generated.d.ts.map +1 -0
  7. package/dist/vendor/ahp/action-origin.generated.js +71 -0
  8. package/dist/vendor/ahp/action-origin.generated.js.map +1 -0
  9. package/dist/vendor/ahp/actions.d.ts +14 -0
  10. package/dist/vendor/ahp/actions.d.ts.map +1 -0
  11. package/dist/vendor/ahp/actions.js +15 -0
  12. package/dist/vendor/ahp/actions.js.map +1 -0
  13. package/dist/vendor/ahp/channels-changeset/actions.d.ts +87 -0
  14. package/dist/vendor/ahp/channels-changeset/actions.d.ts.map +1 -0
  15. package/dist/vendor/ahp/channels-changeset/actions.js +9 -0
  16. package/dist/vendor/ahp/channels-changeset/actions.js.map +1 -0
  17. package/dist/vendor/ahp/channels-changeset/commands.d.ts +103 -0
  18. package/dist/vendor/ahp/channels-changeset/commands.d.ts.map +1 -0
  19. package/dist/vendor/ahp/channels-changeset/commands.js +22 -0
  20. package/dist/vendor/ahp/channels-changeset/commands.js.map +1 -0
  21. package/dist/vendor/ahp/channels-changeset/reducer.d.ts +18 -0
  22. package/dist/vendor/ahp/channels-changeset/reducer.d.ts.map +1 -0
  23. package/dist/vendor/ahp/channels-changeset/reducer.js +65 -0
  24. package/dist/vendor/ahp/channels-changeset/reducer.js.map +1 -0
  25. package/dist/vendor/ahp/channels-changeset/state.d.ts +155 -0
  26. package/dist/vendor/ahp/channels-changeset/state.d.ts.map +1 -0
  27. package/dist/vendor/ahp/channels-changeset/state.js +39 -0
  28. package/dist/vendor/ahp/channels-changeset/state.js.map +1 -0
  29. package/dist/vendor/ahp/channels-otlp/notifications.d.ts +121 -0
  30. package/dist/vendor/ahp/channels-otlp/notifications.d.ts.map +1 -0
  31. package/dist/vendor/ahp/channels-otlp/notifications.js +11 -0
  32. package/dist/vendor/ahp/channels-otlp/notifications.js.map +1 -0
  33. package/dist/vendor/ahp/channels-otlp/state.d.ts +65 -0
  34. package/dist/vendor/ahp/channels-otlp/state.d.ts.map +1 -0
  35. package/dist/vendor/ahp/channels-otlp/state.js +10 -0
  36. package/dist/vendor/ahp/channels-otlp/state.js.map +1 -0
  37. package/dist/vendor/ahp/channels-root/actions.d.ts +62 -0
  38. package/dist/vendor/ahp/channels-root/actions.d.ts.map +1 -0
  39. package/dist/vendor/ahp/channels-root/actions.js +8 -0
  40. package/dist/vendor/ahp/channels-root/actions.js.map +1 -0
  41. package/dist/vendor/ahp/channels-root/commands.d.ts +172 -0
  42. package/dist/vendor/ahp/channels-root/commands.d.ts.map +1 -0
  43. package/dist/vendor/ahp/channels-root/commands.js +10 -0
  44. package/dist/vendor/ahp/channels-root/commands.js.map +1 -0
  45. package/dist/vendor/ahp/channels-root/notifications.d.ts +136 -0
  46. package/dist/vendor/ahp/channels-root/notifications.d.ts.map +1 -0
  47. package/dist/vendor/ahp/channels-root/notifications.js +9 -0
  48. package/dist/vendor/ahp/channels-root/notifications.js.map +1 -0
  49. package/dist/vendor/ahp/channels-root/reducer.d.ts +12 -0
  50. package/dist/vendor/ahp/channels-root/reducer.d.ts.map +1 -0
  51. package/dist/vendor/ahp/channels-root/reducer.js +36 -0
  52. package/dist/vendor/ahp/channels-root/reducer.js.map +1 -0
  53. package/dist/vendor/ahp/channels-root/state.d.ts +123 -0
  54. package/dist/vendor/ahp/channels-root/state.d.ts.map +1 -0
  55. package/dist/vendor/ahp/channels-root/state.js +19 -0
  56. package/dist/vendor/ahp/channels-root/state.js.map +1 -0
  57. package/dist/vendor/ahp/channels-session/actions.d.ts +736 -0
  58. package/dist/vendor/ahp/channels-session/actions.d.ts.map +1 -0
  59. package/dist/vendor/ahp/channels-session/actions.js +8 -0
  60. package/dist/vendor/ahp/channels-session/actions.js.map +1 -0
  61. package/dist/vendor/ahp/channels-session/commands.d.ts +261 -0
  62. package/dist/vendor/ahp/channels-session/commands.d.ts.map +1 -0
  63. package/dist/vendor/ahp/channels-session/commands.js +23 -0
  64. package/dist/vendor/ahp/channels-session/commands.js.map +1 -0
  65. package/dist/vendor/ahp/channels-session/reducer.d.ts +14 -0
  66. package/dist/vendor/ahp/channels-session/reducer.d.ts.map +1 -0
  67. package/dist/vendor/ahp/channels-session/reducer.js +703 -0
  68. package/dist/vendor/ahp/channels-session/reducer.js.map +1 -0
  69. package/dist/vendor/ahp/channels-session/state.d.ts +1217 -0
  70. package/dist/vendor/ahp/channels-session/state.d.ts.map +1 -0
  71. package/dist/vendor/ahp/channels-session/state.js +229 -0
  72. package/dist/vendor/ahp/channels-session/state.js.map +1 -0
  73. package/dist/vendor/ahp/channels-terminal/actions.d.ts +185 -0
  74. package/dist/vendor/ahp/channels-terminal/actions.d.ts.map +1 -0
  75. package/dist/vendor/ahp/channels-terminal/actions.js +8 -0
  76. package/dist/vendor/ahp/channels-terminal/actions.js.map +1 -0
  77. package/dist/vendor/ahp/channels-terminal/commands.d.ts +50 -0
  78. package/dist/vendor/ahp/channels-terminal/commands.d.ts.map +1 -0
  79. package/dist/vendor/ahp/channels-terminal/commands.js +8 -0
  80. package/dist/vendor/ahp/channels-terminal/commands.js.map +1 -0
  81. package/dist/vendor/ahp/channels-terminal/reducer.d.ts +12 -0
  82. package/dist/vendor/ahp/channels-terminal/reducer.d.ts.map +1 -0
  83. package/dist/vendor/ahp/channels-terminal/reducer.js +80 -0
  84. package/dist/vendor/ahp/channels-terminal/reducer.js.map +1 -0
  85. package/dist/vendor/ahp/channels-terminal/state.d.ts +151 -0
  86. package/dist/vendor/ahp/channels-terminal/state.d.ts.map +1 -0
  87. package/dist/vendor/ahp/channels-terminal/state.js +18 -0
  88. package/dist/vendor/ahp/channels-terminal/state.js.map +1 -0
  89. package/dist/vendor/ahp/commands.d.ts +14 -0
  90. package/dist/vendor/ahp/commands.d.ts.map +1 -0
  91. package/dist/vendor/ahp/commands.js +15 -0
  92. package/dist/vendor/ahp/commands.js.map +1 -0
  93. package/dist/vendor/ahp/common/actions.d.ts +107 -0
  94. package/dist/vendor/ahp/common/actions.d.ts.map +1 -0
  95. package/dist/vendor/ahp/common/actions.js +77 -0
  96. package/dist/vendor/ahp/common/actions.js.map +1 -0
  97. package/dist/vendor/ahp/common/commands.d.ts +594 -0
  98. package/dist/vendor/ahp/common/commands.d.ts.map +1 -0
  99. package/dist/vendor/ahp/common/commands.js +32 -0
  100. package/dist/vendor/ahp/common/commands.js.map +1 -0
  101. package/dist/vendor/ahp/common/errors.d.ts +184 -0
  102. package/dist/vendor/ahp/common/errors.d.ts.map +1 -0
  103. package/dist/vendor/ahp/common/errors.js +82 -0
  104. package/dist/vendor/ahp/common/errors.js.map +1 -0
  105. package/dist/vendor/ahp/common/messages.d.ts +330 -0
  106. package/dist/vendor/ahp/common/messages.d.ts.map +1 -0
  107. package/dist/vendor/ahp/common/messages.js +11 -0
  108. package/dist/vendor/ahp/common/messages.js.map +1 -0
  109. package/dist/vendor/ahp/common/notifications.d.ts +58 -0
  110. package/dist/vendor/ahp/common/notifications.d.ts.map +1 -0
  111. package/dist/vendor/ahp/common/notifications.js +20 -0
  112. package/dist/vendor/ahp/common/notifications.js.map +1 -0
  113. package/dist/vendor/ahp/common/reducer-helpers.d.ts +24 -0
  114. package/dist/vendor/ahp/common/reducer-helpers.d.ts.map +1 -0
  115. package/dist/vendor/ahp/common/reducer-helpers.js +31 -0
  116. package/dist/vendor/ahp/common/reducer-helpers.js.map +1 -0
  117. package/dist/vendor/ahp/common/state.d.ts +286 -0
  118. package/dist/vendor/ahp/common/state.d.ts.map +1 -0
  119. package/dist/vendor/ahp/common/state.js +11 -0
  120. package/dist/vendor/ahp/common/state.js.map +1 -0
  121. package/dist/vendor/ahp/errors.d.ts +8 -0
  122. package/dist/vendor/ahp/errors.d.ts.map +1 -0
  123. package/dist/vendor/ahp/errors.js +9 -0
  124. package/dist/vendor/ahp/errors.js.map +1 -0
  125. package/dist/vendor/ahp/index.d.ts +24 -0
  126. package/dist/vendor/ahp/index.d.ts.map +1 -0
  127. package/dist/vendor/ahp/index.js +21 -0
  128. package/dist/vendor/ahp/index.js.map +1 -0
  129. package/dist/vendor/ahp/messages.d.ts +8 -0
  130. package/dist/vendor/ahp/messages.d.ts.map +1 -0
  131. package/dist/vendor/ahp/messages.js +9 -0
  132. package/dist/vendor/ahp/messages.js.map +1 -0
  133. package/dist/vendor/ahp/notifications.d.ts +11 -0
  134. package/dist/vendor/ahp/notifications.d.ts.map +1 -0
  135. package/dist/vendor/ahp/notifications.js +12 -0
  136. package/dist/vendor/ahp/notifications.js.map +1 -0
  137. package/dist/vendor/ahp/reducers.d.ts +12 -0
  138. package/dist/vendor/ahp/reducers.d.ts.map +1 -0
  139. package/dist/vendor/ahp/reducers.js +13 -0
  140. package/dist/vendor/ahp/reducers.js.map +1 -0
  141. package/dist/vendor/ahp/state.d.ts +15 -0
  142. package/dist/vendor/ahp/state.d.ts.map +1 -0
  143. package/dist/vendor/ahp/state.js +16 -0
  144. package/dist/vendor/ahp/state.js.map +1 -0
  145. package/dist/vendor/ahp/version/message-checks.d.ts +15 -0
  146. package/dist/vendor/ahp/version/message-checks.d.ts.map +1 -0
  147. package/dist/vendor/ahp/version/message-checks.js +16 -0
  148. package/dist/vendor/ahp/version/message-checks.js.map +1 -0
  149. package/dist/vendor/ahp/version/registry.d.ts +56 -0
  150. package/dist/vendor/ahp/version/registry.d.ts.map +1 -0
  151. package/dist/vendor/ahp/version/registry.js +138 -0
  152. package/dist/vendor/ahp/version/registry.js.map +1 -0
  153. package/package.json +47 -0
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Root Channel Commands — `listSessions`, `resolveSessionConfig`, and
3
+ * `sessionConfigCompletions`. These commands target `ahp-root://` even
4
+ * though they describe per-session metadata.
5
+ *
6
+ * @module channels-root/commands
7
+ */
8
+ import type { URI } from '../common/state.js';
9
+ import type { BaseParams } from '../common/commands.js';
10
+ import type { SessionSummary, SessionConfigSchema } from '../channels-session/state.js';
11
+ export type { ConfigPropertySchema, ConfigSchema } from '../common/state.js';
12
+ export type { SessionConfigPropertySchema, SessionConfigSchema } from '../channels-session/state.js';
13
+ /**
14
+ * Returns a list of session summaries. Used to populate session lists and sidebars.
15
+ *
16
+ * The session list is **not** part of the state tree because it can be arbitrarily
17
+ * large. Clients fetch it imperatively and maintain a local cache updated by
18
+ * `root/sessionAdded` and `root/sessionRemoved` notifications.
19
+ *
20
+ * @category Commands
21
+ * @method listSessions
22
+ * @direction Client → Server
23
+ * @messageType Request
24
+ * @version 1
25
+ */
26
+ export interface ListSessionsParams extends BaseParams {
27
+ channel: 'ahp-root://';
28
+ /** Optional filter criteria */
29
+ filter?: object;
30
+ }
31
+ /** Result of the `listSessions` command. */
32
+ export interface ListSessionsResult {
33
+ /** The list of session summaries. */
34
+ items: SessionSummary[];
35
+ }
36
+ /**
37
+ * Iteratively resolves the session configuration schema. The client sends the
38
+ * current partial session config and any user-filled metadata values. The server
39
+ * returns a property schema describing what additional metadata is needed,
40
+ * contextual to the current selections.
41
+ *
42
+ * The client calls this command whenever the user changes a significant input
43
+ * (e.g. picks a working directory, toggles a property). Each response returns
44
+ * the full current property set (not a delta). The returned `values` contain
45
+ * server-resolved defaults to pass to `createSession`.
46
+ *
47
+ * @category Commands
48
+ * @method resolveSessionConfig
49
+ * @direction Client → Server
50
+ * @messageType Request
51
+ * @version 1
52
+ * @example
53
+ * ```jsonc
54
+ * // Step 1: Client picks a working directory
55
+ * // Client → Server
56
+ * { "jsonrpc": "2.0", "id": 5, "method": "resolveSessionConfig",
57
+ * "params": { "workingDirectory": "file:///home/user/my-project" } }
58
+ *
59
+ * // Server → Client (git repo detected, offers worktree option)
60
+ * { "jsonrpc": "2.0", "id": 5, "result": {
61
+ * "schema": {
62
+ * "type": "object",
63
+ * "properties": {
64
+ * "target": { "type": "string", "title": "Target", "enum": ["workspace", "worktree"] }
65
+ * }
66
+ * },
67
+ * "values": {}
68
+ * }}
69
+ *
70
+ * // Step 2: User enables worktree
71
+ * // Client → Server
72
+ * { "jsonrpc": "2.0", "id": 6, "method": "resolveSessionConfig",
73
+ * "params": { "workingDirectory": "file:///home/user/my-project",
74
+ * "config": { "target": "worktree" } } }
75
+ *
76
+ * // Server → Client (now requires branch selection)
77
+ * { "jsonrpc": "2.0", "id": 6, "result": {
78
+ * "schema": {
79
+ * "type": "object",
80
+ * "properties": {
81
+ * "target": { "type": "string", "title": "Target", "enum": ["workspace", "worktree"] },
82
+ * "baseBranch": { "type": "string", "title": "Base Branch",
83
+ * "enum": ["main", "develop"],
84
+ * "enumLabels": ["main", "develop"] }
85
+ * },
86
+ * "required": ["baseBranch"]
87
+ * },
88
+ * "values": { "target": "worktree" }
89
+ * }}
90
+ * ```
91
+ */
92
+ export interface ResolveSessionConfigParams extends BaseParams {
93
+ channel: 'ahp-root://';
94
+ /** Agent provider ID */
95
+ provider?: string;
96
+ /** Working directory for the session */
97
+ workingDirectory?: URI;
98
+ /** Current user-filled configuration values */
99
+ config?: Record<string, unknown>;
100
+ }
101
+ /**
102
+ * Result of the `resolveSessionConfig` command.
103
+ */
104
+ export interface ResolveSessionConfigResult {
105
+ /** JSON Schema describing available configuration properties given the current context */
106
+ schema: SessionConfigSchema;
107
+ /** Current configuration values (echoed back with server-resolved defaults applied) */
108
+ values: Record<string, unknown>;
109
+ }
110
+ /**
111
+ * A single value item returned by `sessionConfigCompletions`.
112
+ *
113
+ * @category Commands
114
+ */
115
+ export interface SessionConfigValueItem {
116
+ /** The value to store in config */
117
+ value: string;
118
+ /** Human-readable display label */
119
+ label: string;
120
+ /** Optional secondary description */
121
+ description?: string;
122
+ }
123
+ /**
124
+ * Queries the server for allowed values of a dynamic session config property.
125
+ *
126
+ * Used when a property in the schema returned by `resolveSessionConfig` has
127
+ * `enumDynamic: true`. The client sends a search query and receives matching
128
+ * values with display metadata.
129
+ *
130
+ * @category Commands
131
+ * @method sessionConfigCompletions
132
+ * @direction Client → Server
133
+ * @messageType Request
134
+ * @version 1
135
+ * @example
136
+ * ```jsonc
137
+ * // Client → Server (user types "ma" in branch picker)
138
+ * { "jsonrpc": "2.0", "id": 7, "method": "sessionConfigCompletions",
139
+ * "params": { "workingDirectory": "file:///home/user/my-project",
140
+ * "config": { "target": "worktree" },
141
+ * "property": "baseBranch", "query": "ma" } }
142
+ *
143
+ * // Server → Client
144
+ * { "jsonrpc": "2.0", "id": 7, "result": {
145
+ * "items": [
146
+ * { "value": "main", "label": "main", "icon": "git-branch" },
147
+ * { "value": "main-v2", "label": "main-v2", "icon": "git-branch" }
148
+ * ]
149
+ * }}
150
+ * ```
151
+ */
152
+ export interface SessionConfigCompletionsParams extends BaseParams {
153
+ channel: 'ahp-root://';
154
+ /** Agent provider ID */
155
+ provider?: string;
156
+ /** Working directory for the session */
157
+ workingDirectory?: URI;
158
+ /** Current user-filled configuration values (provides context for the query) */
159
+ config?: Record<string, unknown>;
160
+ /** Property id from the schema to query values for */
161
+ property: string;
162
+ /** Search filter text (empty or omitted returns default/recent values) */
163
+ query?: string;
164
+ }
165
+ /**
166
+ * Result of the `sessionConfigCompletions` command.
167
+ */
168
+ export interface SessionConfigCompletionsResult {
169
+ /** Matching value items */
170
+ items: SessionConfigValueItem[];
171
+ }
172
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/commands.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAIxF,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,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E,GAAG,CAAC;IACvB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,2BAA2B;IAC3B,KAAK,EAAE,sBAAsB,EAAE,CAAC;CACjC"}
@@ -0,0 +1,10 @@
1
+ /* eslint-disable -- vendored third-party code, see SOURCE.md */
2
+ /**
3
+ * Root Channel Commands — `listSessions`, `resolveSessionConfig`, and
4
+ * `sessionConfigCompletions`. These commands target `ahp-root://` even
5
+ * though they describe per-session metadata.
6
+ *
7
+ * @module channels-root/commands
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/commands.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;;;GAMG"}
@@ -0,0 +1,136 @@
1
+ /**
2
+ * Root Channel Notifications — Session catalogue events delivered on the
3
+ * `ahp-root://` channel.
4
+ *
5
+ * @module channels-root/notifications
6
+ */
7
+ import type { URI } from '../common/state.js';
8
+ import type { SessionSummary } from '../channels-session/state.js';
9
+ /**
10
+ * Broadcast to all clients subscribed to the root channel when a new session
11
+ * is created.
12
+ *
13
+ * @category Protocol Notifications
14
+ * @method root/sessionAdded
15
+ * @direction Server → Client
16
+ * @messageType Notification
17
+ * @version 1
18
+ * @example
19
+ * ```json
20
+ * {
21
+ * "jsonrpc": "2.0",
22
+ * "method": "root/sessionAdded",
23
+ * "params": {
24
+ * "channel": "ahp-root://",
25
+ * "summary": {
26
+ * "resource": "ahp-session:/<uuid>",
27
+ * "provider": "copilot",
28
+ * "title": "New Session",
29
+ * "status": 1,
30
+ * "createdAt": 1710000000000,
31
+ * "modifiedAt": 1710000000000
32
+ * }
33
+ * }
34
+ * }
35
+ * ```
36
+ */
37
+ export interface SessionAddedParams {
38
+ /** Channel URI this notification belongs to (the root channel) */
39
+ channel: URI;
40
+ /** Summary of the new session */
41
+ summary: SessionSummary;
42
+ }
43
+ /**
44
+ * Broadcast to all clients subscribed to the root channel when a session is
45
+ * disposed.
46
+ *
47
+ * @category Protocol Notifications
48
+ * @method root/sessionRemoved
49
+ * @direction Server → Client
50
+ * @messageType Notification
51
+ * @version 1
52
+ * @example
53
+ * ```json
54
+ * {
55
+ * "jsonrpc": "2.0",
56
+ * "method": "root/sessionRemoved",
57
+ * "params": {
58
+ * "channel": "ahp-root://",
59
+ * "session": "ahp-session:/<uuid>"
60
+ * }
61
+ * }
62
+ * ```
63
+ */
64
+ export interface SessionRemovedParams {
65
+ /** Channel URI this notification belongs to (the root channel) */
66
+ channel: URI;
67
+ /** URI of the removed session */
68
+ session: URI;
69
+ }
70
+ /**
71
+ * Broadcast to all clients subscribed to the root channel when an existing
72
+ * session's summary changes (title, status, `modifiedAt`, model, working
73
+ * directory, read/done state, or diff statistics).
74
+ *
75
+ * This notification lets clients that maintain a cached session list — for
76
+ * example, the result of a previous `listSessions()` call — stay in sync with
77
+ * in-flight sessions without having to subscribe to every session URI
78
+ * individually. It is complementary to, not a replacement for,
79
+ * `root/sessionAdded` and `root/sessionRemoved`: those signal lifecycle
80
+ * (creation/disposal), while this signals summary-level mutations on an
81
+ * already-known session.
82
+ *
83
+ * Semantics:
84
+ *
85
+ * - Only fields present in `changes` have new values; omitted fields are
86
+ * unchanged on the client's cached summary.
87
+ * - Identity fields (`resource`, `provider`, `createdAt`) never change and
88
+ * are not carried.
89
+ * - Like all protocol notifications, this is ephemeral: it is **not**
90
+ * replayed on reconnect. On reconnect, clients should re-fetch the full
91
+ * catalog via `listSessions()` as usual.
92
+ * - The server SHOULD emit this notification whenever any mutable field on
93
+ * {@link SessionSummary | `SessionSummary`} changes for a session the
94
+ * server has surfaced via `listSessions()` or `root/sessionAdded`.
95
+ * Servers MAY coalesce or debounce updates for noisy fields (for example,
96
+ * `modifiedAt` bumps while a turn is streaming, or rapidly changing
97
+ * `changesets`) at their discretion.
98
+ * - Clients that have no cached entry for `session` MAY ignore the
99
+ * notification; it is not a substitute for `root/sessionAdded`.
100
+ *
101
+ * @category Protocol Notifications
102
+ * @method root/sessionSummaryChanged
103
+ * @direction Server → Client
104
+ * @messageType Notification
105
+ * @version 1
106
+ * @example
107
+ * ```json
108
+ * {
109
+ * "jsonrpc": "2.0",
110
+ * "method": "root/sessionSummaryChanged",
111
+ * "params": {
112
+ * "channel": "ahp-root://",
113
+ * "session": "ahp-session:/<uuid>",
114
+ * "changes": {
115
+ * "title": "Refactor auth middleware",
116
+ * "status": 8,
117
+ * "modifiedAt": 1710000123456
118
+ * }
119
+ * }
120
+ * }
121
+ * ```
122
+ */
123
+ export interface SessionSummaryChangedParams {
124
+ /** Channel URI this notification belongs to (the root channel) */
125
+ channel: URI;
126
+ /** URI of the session whose summary changed */
127
+ session: URI;
128
+ /**
129
+ * Mutable summary fields that changed; omitted fields are unchanged.
130
+ *
131
+ * Identity fields (`resource`, `provider`, `createdAt`) never change and
132
+ * MUST be omitted by senders; receivers SHOULD ignore them if present.
133
+ */
134
+ changes: Partial<SessionSummary>;
135
+ }
136
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/notifications.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAInE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,OAAO,EAAE,GAAG,CAAC;IACb,iCAAiC;IACjC,OAAO,EAAE,cAAc,CAAC;CACzB;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,OAAO,EAAE,GAAG,CAAC;IACb,iCAAiC;IACjC,OAAO,EAAE,GAAG,CAAC;CACd;AAID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kEAAkE;IAClE,OAAO,EAAE,GAAG,CAAC;IACb,+CAA+C;IAC/C,OAAO,EAAE,GAAG,CAAC;IACb;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAClC"}
@@ -0,0 +1,9 @@
1
+ /* eslint-disable -- vendored third-party code, see SOURCE.md */
2
+ /**
3
+ * Root Channel Notifications — Session catalogue events delivered on the
4
+ * `ahp-root://` channel.
5
+ *
6
+ * @module channels-root/notifications
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/notifications.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;;GAKG"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Root Channel Reducer — Pure reducer for `RootState`.
3
+ *
4
+ * @module channels-root/reducer
5
+ */
6
+ import type { RootState } from './state.js';
7
+ import type { RootAction } from '../action-origin.generated.js';
8
+ /**
9
+ * Pure reducer for root state. Handles all {@link RootAction} variants.
10
+ */
11
+ export declare function rootReducer(state: RootState, action: RootAction, log?: (msg: string) => void): RootState;
12
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/reducer.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,CA2BxG"}
@@ -0,0 +1,36 @@
1
+ /* eslint-disable -- vendored third-party code, see SOURCE.md */
2
+ /**
3
+ * Root Channel Reducer — Pure reducer for `RootState`.
4
+ *
5
+ * @module channels-root/reducer
6
+ */
7
+ import { ActionType } from '../common/actions.js';
8
+ import { softAssertNever } from '../common/reducer-helpers.js';
9
+ /**
10
+ * Pure reducer for root state. Handles all {@link RootAction} variants.
11
+ */
12
+ export function rootReducer(state, action, log) {
13
+ switch (action.type) {
14
+ case ActionType.RootAgentsChanged:
15
+ return { ...state, agents: action.agents };
16
+ case ActionType.RootActiveSessionsChanged:
17
+ return { ...state, activeSessions: action.activeSessions };
18
+ case ActionType.RootTerminalsChanged:
19
+ return { ...state, terminals: action.terminals };
20
+ case ActionType.RootConfigChanged:
21
+ if (!state.config) {
22
+ return state;
23
+ }
24
+ return {
25
+ ...state,
26
+ config: {
27
+ ...state.config,
28
+ values: action.replace ? { ...action.config } : { ...state.config.values, ...action.config },
29
+ },
30
+ };
31
+ default:
32
+ softAssertNever(action, log);
33
+ return state;
34
+ }
35
+ }
36
+ //# sourceMappingURL=reducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.js","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/reducer.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,KAAgB,EAAE,MAAkB,EAAE,GAA2B;IAC3F,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,UAAU,CAAC,iBAAiB;YAC/B,OAAO,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QAE7C,KAAK,UAAU,CAAC,yBAAyB;YACvC,OAAO,EAAE,GAAG,KAAK,EAAE,cAAc,EAAE,MAAM,CAAC,cAAc,EAAE,CAAC;QAE7D,KAAK,UAAU,CAAC,oBAAoB;YAClC,OAAO,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;QAEnD,KAAK,UAAU,CAAC,iBAAiB;YAC/B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;gBAClB,OAAO,KAAK,CAAC;YACf,CAAC;YACD,OAAO;gBACL,GAAG,KAAK;gBACR,MAAM,EAAE;oBACN,GAAG,KAAK,CAAC,MAAM;oBACf,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE;iBAC7F;aACF,CAAC;QAEJ;YACE,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC7B,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * Root State Types — Global state exposed on the `ahp-root://` channel.
3
+ *
4
+ * @module channels-root/state
5
+ */
6
+ import type { ConfigSchema, ProtectedResourceMetadata } from '../common/state.js';
7
+ import type { TerminalInfo } from '../channels-terminal/state.js';
8
+ import type { CustomizationRef } from '../channels-session/state.js';
9
+ /**
10
+ * Policy configuration state for a model.
11
+ *
12
+ * @category Root State
13
+ */
14
+ export declare enum PolicyState {
15
+ Enabled = "enabled",
16
+ Disabled = "disabled",
17
+ Unconfigured = "unconfigured"
18
+ }
19
+ /**
20
+ * Global state shared with every client subscribed to `ahp-root://`.
21
+ *
22
+ * @category Root State
23
+ */
24
+ export interface RootState {
25
+ /** Available agent backends and their models */
26
+ agents: AgentInfo[];
27
+ /** Number of active (non-disposed) sessions on the server */
28
+ activeSessions?: number;
29
+ /** Known terminals on the server. Subscribe to individual terminal URIs for full state. */
30
+ terminals?: TerminalInfo[];
31
+ /** Agent host configuration schema and current values */
32
+ config?: RootConfigState;
33
+ }
34
+ /**
35
+ * @category Root State
36
+ */
37
+ export interface AgentInfo {
38
+ /** Agent provider ID (e.g. `'copilot'`) */
39
+ provider: string;
40
+ /** Human-readable name */
41
+ displayName: string;
42
+ /** Description string */
43
+ description: string;
44
+ /** Available models for this agent */
45
+ models: SessionModelInfo[];
46
+ /**
47
+ * Protected resources this agent requires authentication for.
48
+ *
49
+ * Each entry describes an OAuth 2.0 protected resource using
50
+ * [RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728) semantics.
51
+ * Clients should obtain tokens from the declared `authorization_servers`
52
+ * and push them via the `authenticate` command before creating sessions
53
+ * with this agent.
54
+ *
55
+ * @see {@link /specification/authentication | Authentication}
56
+ */
57
+ protectedResources?: ProtectedResourceMetadata[];
58
+ /**
59
+ * Customizations (Open Plugins) associated with this agent.
60
+ *
61
+ * Each entry is a reference to an [Open Plugins](https://open-plugins.com/)
62
+ * plugin that the agent host can activate for sessions using this agent.
63
+ */
64
+ customizations?: CustomizationRef[];
65
+ }
66
+ /**
67
+ * @category Root State
68
+ */
69
+ export interface SessionModelInfo {
70
+ /** Model identifier */
71
+ id: string;
72
+ /** Provider this model belongs to */
73
+ provider: string;
74
+ /** Human-readable model name */
75
+ name: string;
76
+ /** Maximum context window size */
77
+ maxContextWindow?: number;
78
+ /** Whether the model supports vision */
79
+ supportsVision?: boolean;
80
+ /** Policy configuration state */
81
+ policyState?: PolicyState;
82
+ /**
83
+ * Configuration schema describing model-specific options (e.g. thinking
84
+ * level). Clients present this as a form and pass the resolved values in
85
+ * {@link ModelSelection.config} when creating or changing sessions.
86
+ */
87
+ configSchema?: ConfigSchema;
88
+ /**
89
+ * Additional provider-specific metadata for this model.
90
+ *
91
+ * Clients MAY look for well-known keys here to provide enhanced UI.
92
+ * For example, a `pricing` key may carry model pricing metadata.
93
+ */
94
+ _meta?: Record<string, unknown>;
95
+ }
96
+ /**
97
+ * A model selection: the chosen model ID together with any model-specific
98
+ * configuration values whose keys correspond to the model's
99
+ * {@link SessionModelInfo.configSchema}.
100
+ *
101
+ * @category Root State
102
+ */
103
+ export interface ModelSelection {
104
+ /** Model identifier */
105
+ id: string;
106
+ /** Model-specific configuration values */
107
+ config?: Record<string, string>;
108
+ }
109
+ /**
110
+ * Live agent-host configuration metadata.
111
+ *
112
+ * The schema describes the available configuration properties and the values
113
+ * contain the current value for each resolved property.
114
+ *
115
+ * @category Root State
116
+ */
117
+ export interface RootConfigState {
118
+ /** JSON Schema describing available configuration properties */
119
+ schema: ConfigSchema;
120
+ /** Current configuration values */
121
+ values: Record<string, unknown>;
122
+ }
123
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/state.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIrE;;;;GAIG;AACH,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,gDAAgD;IAChD,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,6DAA6D;IAC7D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B,yD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19 @@
1
+ /* eslint-disable -- vendored third-party code, see SOURCE.md */
2
+ /**
3
+ * Root State Types — Global state exposed on the `ahp-root://` channel.
4
+ *
5
+ * @module channels-root/state
6
+ */
7
+ // ─── Root State ──────────────────────────────────────────────────────────────
8
+ /**
9
+ * Policy configuration state for a model.
10
+ *
11
+ * @category Root State
12
+ */
13
+ export var PolicyState;
14
+ (function (PolicyState) {
15
+ PolicyState["Enabled"] = "enabled";
16
+ PolicyState["Disabled"] = "disabled";
17
+ PolicyState["Unconfigured"] = "unconfigured";
18
+ })(PolicyState || (PolicyState = {}));
19
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../src/vendor/ahp/channels-root/state.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE;;;;GAIG;AASH,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,4CAA6B,CAAA;AAC/B,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB"}