@agimon-ai/po-mode 0.0.0-alpha.163

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 (86) hide show
  1. package/LICENSE +149 -0
  2. package/README.md +3 -0
  3. package/dist/apiContracts.cjs +248 -0
  4. package/dist/apiContracts.cjs.map +1 -0
  5. package/dist/apiContracts.d.mts +53 -0
  6. package/dist/apiContracts.d.mts.map +1 -0
  7. package/dist/apiContracts.mjs +243 -0
  8. package/dist/apiContracts.mjs.map +1 -0
  9. package/dist/catalog-Crw6ltXH.cjs +229 -0
  10. package/dist/catalog-Crw6ltXH.cjs.map +1 -0
  11. package/dist/catalog-Dh61L8Fi.mjs +224 -0
  12. package/dist/catalog-Dh61L8Fi.mjs.map +1 -0
  13. package/dist/catalog.cjs +3 -0
  14. package/dist/catalog.d.mts +14 -0
  15. package/dist/catalog.d.mts.map +1 -0
  16. package/dist/catalog.mjs +1 -0
  17. package/dist/command-Bj1YCvqm.cjs +160 -0
  18. package/dist/command-Bj1YCvqm.cjs.map +1 -0
  19. package/dist/command-CnaY9sAT.mjs +131 -0
  20. package/dist/command-CnaY9sAT.mjs.map +1 -0
  21. package/dist/command.cjs +7 -0
  22. package/dist/command.d.mts +30 -0
  23. package/dist/command.d.mts.map +1 -0
  24. package/dist/command.mjs +1 -0
  25. package/dist/extensions/server.cjs +156 -0
  26. package/dist/extensions/server.cjs.map +1 -0
  27. package/dist/extensions/server.d.mts +5 -0
  28. package/dist/extensions/server.d.mts.map +1 -0
  29. package/dist/extensions/server.mjs +151 -0
  30. package/dist/extensions/server.mjs.map +1 -0
  31. package/dist/headlessCommand-DfTVaDKz.cjs +58 -0
  32. package/dist/headlessCommand-DfTVaDKz.cjs.map +1 -0
  33. package/dist/headlessCommand-Dtc7XT7M.mjs +53 -0
  34. package/dist/headlessCommand-Dtc7XT7M.mjs.map +1 -0
  35. package/dist/index-CgllUMVL.d.mts +34 -0
  36. package/dist/index-CgllUMVL.d.mts.map +1 -0
  37. package/dist/index-DF2V-Xui.d.mts +8 -0
  38. package/dist/index-DF2V-Xui.d.mts.map +1 -0
  39. package/dist/index.cjs +98 -0
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.mts +42 -0
  42. package/dist/index.d.mts.map +1 -0
  43. package/dist/index.mjs +55 -0
  44. package/dist/index.mjs.map +1 -0
  45. package/dist/mode-B-OJ-blt.d.mts +495 -0
  46. package/dist/mode-B-OJ-blt.d.mts.map +1 -0
  47. package/dist/mode-B89KaUVb.cjs +444 -0
  48. package/dist/mode-B89KaUVb.cjs.map +1 -0
  49. package/dist/mode-BaR34dNz.mjs +241 -0
  50. package/dist/mode-BaR34dNz.mjs.map +1 -0
  51. package/dist/mode.cjs +36 -0
  52. package/dist/mode.d.mts +2 -0
  53. package/dist/mode.mjs +1 -0
  54. package/dist/modeDefinition-B1dju0R7.mjs +46 -0
  55. package/dist/modeDefinition-B1dju0R7.mjs.map +1 -0
  56. package/dist/modeDefinition-Dqj1cmY-.cjs +51 -0
  57. package/dist/modeDefinition-Dqj1cmY-.cjs.map +1 -0
  58. package/dist/modeDefinition.cjs +3 -0
  59. package/dist/modeDefinition.d.mts +2 -0
  60. package/dist/modeDefinition.mjs +1 -0
  61. package/dist/owner-CJcPjXQM.cjs +14 -0
  62. package/dist/owner-CJcPjXQM.cjs.map +1 -0
  63. package/dist/owner-czjMUn4A.mjs +9 -0
  64. package/dist/owner-czjMUn4A.mjs.map +1 -0
  65. package/dist/owner.cjs +3 -0
  66. package/dist/owner.d.mts +2 -0
  67. package/dist/owner.mjs +1 -0
  68. package/dist/projection-64MAbQ5a.cjs +68 -0
  69. package/dist/projection-64MAbQ5a.cjs.map +1 -0
  70. package/dist/projection-CjM0cTV4.mjs +51 -0
  71. package/dist/projection-CjM0cTV4.mjs.map +1 -0
  72. package/dist/projection.cjs +5 -0
  73. package/dist/projection.d.mts +14 -0
  74. package/dist/projection.d.mts.map +1 -0
  75. package/dist/projection.mjs +1 -0
  76. package/dist/reloadHandoff.cjs +57 -0
  77. package/dist/reloadHandoff.cjs.map +1 -0
  78. package/dist/reloadHandoff.d.mts +11 -0
  79. package/dist/reloadHandoff.d.mts.map +1 -0
  80. package/dist/reloadHandoff.mjs +54 -0
  81. package/dist/reloadHandoff.mjs.map +1 -0
  82. package/dist/validation-B7tZJPQE.mjs +81 -0
  83. package/dist/validation-B7tZJPQE.mjs.map +1 -0
  84. package/dist/validation-BRyWCYXJ.cjs +104 -0
  85. package/dist/validation-BRyWCYXJ.cjs.map +1 -0
  86. package/package.json +133 -0
package/LICENSE ADDED
@@ -0,0 +1,149 @@
1
+ License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
2
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
3
+
4
+ Parameters
5
+
6
+ Licensor: Agimon Pty Ltd
7
+ Licensed Work: Po, the software in the Po source repository and the
8
+ packages released from it, in each version released by
9
+ the Licensor.
10
+ The Licensed Work is (c) 2026 Agimon Pty Ltd.
11
+ Material identified as third-party in the "Third-party
12
+ components" section at the end of this file or in a
13
+ NOTICE file, and any package or directory whose own
14
+ license file grants a different license, is not part of
15
+ the Licensed Work and remains under its own license.
16
+ Additional Use Grant: You may make production use of the Licensed Work if
17
+ your use is Eligible Use. "Eligible Use" is production use that falls
18
+ within at least one of the following:
19
+
20
+ (a) Personal Use. Use by an individual for their own personal purposes,
21
+ and not on behalf of, or for the benefit of, an employer, client, or
22
+ other Organization. Use by an individual in the course of employment
23
+ or engagement by an Organization is use by that Organization.
24
+
25
+ (b) Small Organization Use. Use by or on behalf of an Organization whose
26
+ Annual Revenue is less than USD 1,000,000.
27
+
28
+ (c) Non-profit, Education and Research Use. Use, regardless of Annual
29
+ Revenue, by (i) an Organization registered or recognized as a
30
+ non-profit or charitable organization under the laws of its
31
+ jurisdiction, for its non-profit purposes; (ii) an accredited school,
32
+ college, or university, for teaching, learning, or academic research;
33
+ or (iii) a publicly funded research institution, for its research.
34
+
35
+ (d) Service Provider Use. Use by a consultant, contractor, agency, or other
36
+ service provider, regardless of its own Annual Revenue, solely to
37
+ build, deploy, host, operate, or support the Licensed Work for a client
38
+ whose own use would be Eligible Use under (a), (b), or (c). A service
39
+ provider's use for its own purposes is Eligible Use only if the service
40
+ provider itself qualifies under (b) or (c).
41
+
42
+
43
+ Hosted services. Offering the Licensed Work to third parties as a hosted
44
+ or managed service whose primary value is the Licensed Work is Eligible
45
+ Use only if each such third party's own use would be Eligible Use.
46
+
47
+ Definitions. "Organization" means any company, partnership, sole
48
+ proprietorship, trust, association, government body, or other entity, and
49
+ includes an individual acting in a business or professional capacity.
50
+ "Affiliate" means any entity that directly or indirectly controls, is
51
+ controlled by, or is under common control with an Organization, where
52
+ "control" means ownership of more than 50% of the voting interests of an
53
+ entity or the power to direct its management and policies by contract or
54
+ otherwise. "Annual Revenue" means the total gross revenue of an
55
+ Organization and all of its Affiliates combined, from all sources and
56
+ whether or not related to the Licensed Work, for its most recently
57
+ completed fiscal year, or, if it has not completed a fiscal year, for the
58
+ twelve months before the use (or since its formation, if shorter),
59
+ converted into US dollars at the average exchange rate for that period.
60
+ Proceeds of equity or debt financing are not revenue.
61
+
62
+ Threshold. If an Organization stops qualifying under (b), its existing
63
+ production use remains Eligible Use for 90 days after it stops
64
+ qualifying, after which it must obtain a commercial license or stop
65
+ production use. Use that was Eligible Use when it occurred never requires
66
+ a commercial license after the fact.
67
+ Change Date: Four years from the date a version of the Licensed Work
68
+ is first publicly released by the Licensor.
69
+ Change License: Apache License, Version 2.0
70
+
71
+ For information about alternative licensing arrangements for the Licensed
72
+ Work, please visit: https://agimon.ai/licensing
73
+
74
+ Notice
75
+
76
+ The Business Source License (this document, or the "License") is not an Open
77
+ Source license. However, the Licensed Work will eventually be made available
78
+ under an Open Source License, as stated in this License.
79
+
80
+ -----------------------------------------------------------------------------
81
+
82
+ Business Source License 1.1
83
+
84
+ Terms
85
+
86
+ The Licensor hereby grants you the right to copy, modify, create derivative
87
+ works, redistribute, and make non-production use of the Licensed Work. The
88
+ Licensor may make an Additional Use Grant, above, permitting limited
89
+ production use.
90
+
91
+ Effective on the Change Date, or the fourth anniversary of the first publicly
92
+ available distribution of a specific version of the Licensed Work under this
93
+ License, whichever comes first, the Licensor hereby grants you rights under
94
+ the terms of the Change License, and the rights granted in the paragraph
95
+ above terminate.
96
+
97
+ If your use of the Licensed Work does not comply with the requirements
98
+ currently in effect as described in this License, you must purchase a
99
+ commercial license from the Licensor, its affiliated entities, or authorized
100
+ resellers, or you must refrain from using the Licensed Work.
101
+
102
+ All copies of the original and modified Licensed Work, and derivative works
103
+ of the Licensed Work, are subject to this License. This License applies
104
+ separately for each version of the Licensed Work and the Change Date may vary
105
+ for each version of the Licensed Work released by Licensor.
106
+
107
+ You must conspicuously display this License on each original or modified copy
108
+ of the Licensed Work. If you receive the Licensed Work in original or
109
+ modified form from a third party, the terms and conditions set forth in this
110
+ License apply to your use of that work.
111
+
112
+ Any use of the Licensed Work in violation of this License will automatically
113
+ terminate your rights under this License for the current and all other
114
+ versions of the Licensed Work.
115
+
116
+ This License does not grant you any right in any trademark or logo of
117
+ Licensor or its affiliates (provided that you may use a trademark or logo of
118
+ Licensor as expressly required by this License).
119
+
120
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
121
+ AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
122
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
123
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
124
+ TITLE.
125
+
126
+ MariaDB hereby grants you permission to use this License’s text to license
127
+ your works, and to refer to it using the trademark “Business Source License”,
128
+ as long as you comply with the Covenants of Licensor below.
129
+
130
+ Covenants of Licensor
131
+
132
+ In consideration of the right to use this License’s text and the “Business
133
+ Source License” name and trademark, Licensor covenants to MariaDB, and to all
134
+ other recipients of the licensed work to be provided by Licensor:
135
+
136
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
137
+ or a license that is compatible with GPL Version 2.0 or a later version,
138
+ where “compatible” means that software provided under the Change License can
139
+ be included in a program with software provided under GPL Version 2.0 or a
140
+ later version. Licensor may specify additional Change Licenses without
141
+ limitation.
142
+
143
+ 2. To either: (a) specify an additional grant of rights to use that does not
144
+ impose any additional restriction on the right granted in this License, as
145
+ the Additional Use Grant; or (b) insert the text “None”.
146
+
147
+ 3. To specify a Change Date.
148
+
149
+ 4. Not to modify this License in any other way.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Po modes
2
+
3
+ Owns mode definitions, catalog lifecycle, commands, projections, and reload state. The server entry installs the feature through Po core services.
@@ -0,0 +1,248 @@
1
+ Object.defineProperties(exports, {
2
+ __esModule: { value: true },
3
+ [Symbol.toStringTag]: { value: "Module" }
4
+ });
5
+ let _agimon_ai_po_core_apiContracts = require("@agimon-ai/po-core/apiContracts");
6
+ let typebox = require("typebox");
7
+ const MODE_MAX_ARGUMENT_LENGTH = 4096;
8
+ const MAX_SOURCE_LENGTH = 128;
9
+ const MAX_ID_LENGTH = 128;
10
+ const MAX_GENERATION_LENGTH = 256;
11
+ const MAX_LABEL_LENGTH = 48;
12
+ const MAX_DESCRIPTION_LENGTH = 240;
13
+ const MAX_DETAIL_LENGTH = 160;
14
+ const ModeSourceSchema = typebox.Type.String({
15
+ minLength: 1,
16
+ maxLength: MAX_SOURCE_LENGTH,
17
+ pattern: "^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$"
18
+ });
19
+ const ModeIdSchema = typebox.Type.String({
20
+ minLength: 1,
21
+ maxLength: MAX_ID_LENGTH,
22
+ pattern: "^[a-z0-9][a-z0-9._:-]*$"
23
+ });
24
+ const ModeParameterNameSchema = typebox.Type.String({
25
+ minLength: 1,
26
+ maxLength: MAX_ID_LENGTH,
27
+ pattern: "^[a-z][A-Za-z0-9._:-]*$"
28
+ });
29
+ const GenerationSchema = typebox.Type.String({
30
+ minLength: 1,
31
+ maxLength: MAX_GENERATION_LENGTH
32
+ });
33
+ const LabelSchema = typebox.Type.String({
34
+ minLength: 1,
35
+ maxLength: MAX_LABEL_LENGTH
36
+ });
37
+ const DescriptionSchema = typebox.Type.String({
38
+ minLength: 1,
39
+ maxLength: MAX_DESCRIPTION_LENGTH
40
+ });
41
+ const OperationIdSchema = typebox.Type.String({
42
+ minLength: 1,
43
+ maxLength: MAX_GENERATION_LENGTH
44
+ });
45
+ const ModeTextColorSchema = typebox.Type.Union([
46
+ typebox.Type.Literal("accent"),
47
+ typebox.Type.Literal("warning"),
48
+ typebox.Type.Literal("mdHeading"),
49
+ typebox.Type.Literal("muted"),
50
+ typebox.Type.Literal("dim")
51
+ ]);
52
+ const ModeSessionKindSchema = typebox.Type.Union([typebox.Type.Literal("tui"), typebox.Type.Literal("headless")]);
53
+ const ModeActivationSchema = typebox.Type.Union([
54
+ typebox.Type.Literal("inactive"),
55
+ typebox.Type.Literal("activating"),
56
+ typebox.Type.Literal("active"),
57
+ typebox.Type.Literal("deactivating")
58
+ ]);
59
+ const ModeConditionSchema = typebox.Type.Union([
60
+ typebox.Type.Literal("ready"),
61
+ typebox.Type.Literal("paused"),
62
+ typebox.Type.Literal("blocked"),
63
+ typebox.Type.Literal("limited"),
64
+ typebox.Type.Literal("queued"),
65
+ typebox.Type.Literal("degraded"),
66
+ typebox.Type.Literal("failed")
67
+ ]);
68
+ const ModeScalarSchema = typebox.Type.Union([
69
+ typebox.Type.String({ maxLength: MODE_MAX_ARGUMENT_LENGTH }),
70
+ typebox.Type.Number(),
71
+ typebox.Type.Boolean()
72
+ ]);
73
+ const ParameterBase = {
74
+ name: ModeParameterNameSchema,
75
+ label: LabelSchema,
76
+ description: typebox.Type.Optional(DescriptionSchema),
77
+ required: typebox.Type.Boolean()
78
+ };
79
+ const ModeActionParameterSchema = typebox.Type.Union([
80
+ typebox.Type.Object({
81
+ ...ParameterBase,
82
+ kind: typebox.Type.Literal("string"),
83
+ minLength: typebox.Type.Optional(typebox.Type.Integer({
84
+ minimum: 0,
85
+ maximum: MODE_MAX_ARGUMENT_LENGTH
86
+ })),
87
+ maxLength: typebox.Type.Optional(typebox.Type.Integer({
88
+ minimum: 1,
89
+ maximum: MODE_MAX_ARGUMENT_LENGTH
90
+ }))
91
+ }, { additionalProperties: false }),
92
+ typebox.Type.Object({
93
+ ...ParameterBase,
94
+ kind: typebox.Type.Literal("number"),
95
+ integer: typebox.Type.Optional(typebox.Type.Boolean()),
96
+ minimum: typebox.Type.Optional(typebox.Type.Number()),
97
+ maximum: typebox.Type.Optional(typebox.Type.Number())
98
+ }, { additionalProperties: false }),
99
+ typebox.Type.Object({
100
+ ...ParameterBase,
101
+ kind: typebox.Type.Literal("boolean")
102
+ }, { additionalProperties: false }),
103
+ typebox.Type.Object({
104
+ ...ParameterBase,
105
+ kind: typebox.Type.Literal("enum"),
106
+ choices: typebox.Type.Array(typebox.Type.Object({
107
+ value: typebox.Type.String({
108
+ minLength: 1,
109
+ maxLength: MAX_ID_LENGTH
110
+ }),
111
+ label: LabelSchema
112
+ }, { additionalProperties: false }), {
113
+ minItems: 1,
114
+ maxItems: 32
115
+ })
116
+ }, { additionalProperties: false })
117
+ ]);
118
+ const ModeActionDescriptorSchema = typebox.Type.Object({
119
+ id: ModeIdSchema,
120
+ label: LabelSchema,
121
+ description: DescriptionSchema,
122
+ contexts: typebox.Type.Array(ModeSessionKindSchema, {
123
+ minItems: 1,
124
+ maxItems: 2,
125
+ uniqueItems: true
126
+ }),
127
+ parameters: typebox.Type.Array(ModeActionParameterSchema, { maxItems: 16 })
128
+ }, { additionalProperties: false });
129
+ const ModeDescriptorSchema = typebox.Type.Object({
130
+ source: ModeSourceSchema,
131
+ id: ModeIdSchema,
132
+ label: LabelSchema,
133
+ description: DescriptionSchema,
134
+ order: typebox.Type.Integer({
135
+ minimum: 0,
136
+ maximum: 1e3
137
+ }),
138
+ actions: typebox.Type.Array(ModeActionDescriptorSchema, { maxItems: 16 })
139
+ }, { additionalProperties: false });
140
+ const ModeActionAvailabilitySchema = typebox.Type.Object({
141
+ id: ModeIdSchema,
142
+ enabled: typebox.Type.Boolean(),
143
+ disabledReason: typebox.Type.Optional(typebox.Type.String({
144
+ minLength: 1,
145
+ maxLength: MAX_DETAIL_LENGTH
146
+ }))
147
+ }, { additionalProperties: false });
148
+ const ModeStateSchema = typebox.Type.Object({
149
+ activation: ModeActivationSchema,
150
+ condition: ModeConditionSchema,
151
+ detail: typebox.Type.Optional(typebox.Type.String({
152
+ minLength: 1,
153
+ maxLength: MAX_DETAIL_LENGTH
154
+ })),
155
+ color: typebox.Type.Optional(ModeTextColorSchema),
156
+ modelContextVariant: typebox.Type.Optional(typebox.Type.String({
157
+ minLength: 1,
158
+ maxLength: MAX_ID_LENGTH
159
+ })),
160
+ actions: typebox.Type.Array(ModeActionAvailabilitySchema, { maxItems: 16 })
161
+ }, { additionalProperties: false });
162
+ const ModeRegistrationRefSchema = typebox.Type.Object({
163
+ source: ModeSourceSchema,
164
+ id: ModeIdSchema,
165
+ ownerGeneration: GenerationSchema,
166
+ registrationId: GenerationSchema
167
+ }, { additionalProperties: false });
168
+ const ModeRecordSchema = typebox.Type.Object({
169
+ descriptor: ModeDescriptorSchema,
170
+ state: ModeStateSchema,
171
+ ownerGeneration: GenerationSchema,
172
+ registrationId: GenerationSchema,
173
+ stateRevision: typebox.Type.Integer({ minimum: 0 })
174
+ }, { additionalProperties: false });
175
+ typebox.Type.Object({
176
+ hostGeneration: GenerationSchema,
177
+ revision: typebox.Type.Integer({ minimum: 0 }),
178
+ modes: typebox.Type.Array(ModeRecordSchema, { maxItems: 128 })
179
+ }, { additionalProperties: false });
180
+ const ModeArgumentsSchema = typebox.Type.Record(ModeParameterNameSchema, ModeScalarSchema, { maxProperties: 16 });
181
+ typebox.Type.Object({
182
+ action: typebox.Type.Union([typebox.Type.Literal("list"), typebox.Type.Literal("invoke")]),
183
+ source: typebox.Type.Optional(ModeSourceSchema),
184
+ id: typebox.Type.Optional(ModeIdSchema),
185
+ ownerGeneration: typebox.Type.Optional(GenerationSchema),
186
+ registrationId: typebox.Type.Optional(GenerationSchema),
187
+ modeAction: typebox.Type.Optional(ModeIdSchema),
188
+ arguments: typebox.Type.Optional(ModeArgumentsSchema)
189
+ }, { additionalProperties: false });
190
+ typebox.Type.Unknown();
191
+ typebox.Type.Object({
192
+ operationId: OperationIdSchema,
193
+ mode: ModeRegistrationRefSchema,
194
+ actionId: ModeIdSchema,
195
+ arguments: ModeArgumentsSchema
196
+ }, { additionalProperties: false });
197
+ typebox.Type.Object({
198
+ operationId: OperationIdSchema,
199
+ catalogRevision: typebox.Type.Integer({ minimum: 0 }),
200
+ mode: ModeRecordSchema,
201
+ message: typebox.Type.Optional(typebox.Type.String({
202
+ minLength: 1,
203
+ maxLength: MAX_DETAIL_LENGTH
204
+ }))
205
+ }, { additionalProperties: false });
206
+ //#endregion
207
+ //#region src/schemas/apiContracts.ts
208
+ const ModeProjectionSchema = typebox.Type.Object({
209
+ version: typebox.Type.Literal(1),
210
+ revision: typebox.Type.Number(),
211
+ modes: typebox.Type.Array(typebox.Type.Object({
212
+ id: typebox.Type.String(),
213
+ label: typebox.Type.String(),
214
+ description: typebox.Type.String(),
215
+ order: typebox.Type.Number(),
216
+ activation: ModeActivationSchema,
217
+ condition: ModeConditionSchema,
218
+ detail: typebox.Type.Optional(typebox.Type.String()),
219
+ actions: typebox.Type.Array(typebox.Type.Object({
220
+ id: typebox.Type.String(),
221
+ label: typebox.Type.String(),
222
+ description: typebox.Type.String(),
223
+ enabled: typebox.Type.Boolean(),
224
+ disabledReason: typebox.Type.Optional(typebox.Type.String()),
225
+ needsInput: typebox.Type.Boolean()
226
+ }))
227
+ }))
228
+ });
229
+ const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
230
+ version: 1,
231
+ http: [{
232
+ id: "modes.current",
233
+ scope: "session",
234
+ basePath: "modes",
235
+ path: "/current",
236
+ method: "GET",
237
+ authentication: "owner",
238
+ description: "Read the current headless mode projection.",
239
+ responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(ModeProjectionSchema)
240
+ }],
241
+ sockets: [],
242
+ dynamic: []
243
+ });
244
+ //#endregion
245
+ exports.apiContracts = apiContracts;
246
+ exports.default = apiContracts;
247
+
248
+ //# sourceMappingURL=apiContracts.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.cjs","names":["Type","Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/mode.ts","../src/schemas/apiContracts.ts"],"sourcesContent":["import type { PoClientMetadata } from '@agimon-ai/po-core/clientMetadata';\nimport type { PoExtensionContext } from '@agimon-ai/po-core/runtimeConfig';\nimport type { Context } from '@deepseek-ai/cordis';\nimport { type Static, Type } from 'typebox';\n\nexport const MODE_CATALOG_SOURCE = '@agimon-ai/po/mode-catalog';\nexport const PO_MODE_CATALOG_SERVICE = 'po/mode-catalog';\nexport const MODE_TOOL_NAME = 'mode';\nexport const MODE_ACTION_TIMEOUT_MS = 30_000;\nexport const MODE_MAX_RECORDS = 128;\nexport const MODE_MAX_ACTIONS = 16;\nexport const MODE_MAX_PARAMETERS = 16;\nexport const MODE_MAX_ENUM_CHOICES = 32;\nexport const MODE_MAX_ARGUMENT_LENGTH = 4_096;\n\nconst MAX_SOURCE_LENGTH = 128;\nconst MAX_ID_LENGTH = 128;\nconst MAX_GENERATION_LENGTH = 256;\nconst MAX_LABEL_LENGTH = 48;\nconst MAX_DESCRIPTION_LENGTH = 240;\nconst MAX_DETAIL_LENGTH = 160;\n\nexport const MODE_ERROR_CODE = {\n actionAborted: 'MODE_ACTION_ABORTED',\n actionDisabled: 'MODE_ACTION_DISABLED',\n actionNotFound: 'MODE_ACTION_NOT_FOUND',\n actionTimeout: 'MODE_ACTION_TIMEOUT',\n invalidArguments: 'MODE_INVALID_ARGUMENTS',\n modeBusy: 'MODE_BUSY',\n modeNotFound: 'MODE_NOT_FOUND',\n ownerFailed: 'MODE_OWNER_FAILED',\n registrationConflict: 'MODE_REGISTRATION_CONFLICT',\n sessionReplaced: 'MODE_SESSION_REPLACED',\n staleRegistration: 'MODE_STALE_REGISTRATION',\n unsupportedContext: 'MODE_UNSUPPORTED_CONTEXT',\n} as const;\n\nexport const ModeSourceSchema = Type.String({\n minLength: 1,\n maxLength: MAX_SOURCE_LENGTH,\n pattern: '^[A-Za-z0-9@][A-Za-z0-9@/._:-]*$',\n});\nexport const ModeIdSchema = Type.String({\n minLength: 1,\n maxLength: MAX_ID_LENGTH,\n pattern: '^[a-z0-9][a-z0-9._:-]*$',\n});\nexport const ModeParameterNameSchema = Type.String({\n minLength: 1,\n maxLength: MAX_ID_LENGTH,\n pattern: '^[a-z][A-Za-z0-9._:-]*$',\n});\nconst GenerationSchema = Type.String({ minLength: 1, maxLength: MAX_GENERATION_LENGTH });\nconst LabelSchema = Type.String({ minLength: 1, maxLength: MAX_LABEL_LENGTH });\nconst DescriptionSchema = Type.String({ minLength: 1, maxLength: MAX_DESCRIPTION_LENGTH });\nconst OperationIdSchema = Type.String({ minLength: 1, maxLength: MAX_GENERATION_LENGTH });\n\nexport const ModeTextColorSchema = Type.Union([\n Type.Literal('accent'),\n Type.Literal('warning'),\n Type.Literal('mdHeading'),\n Type.Literal('muted'),\n Type.Literal('dim'),\n]);\nexport type ModeTextColor = Static<typeof ModeTextColorSchema>;\n\nexport const ModeSessionKindSchema = Type.Union([Type.Literal('tui'), Type.Literal('headless')]);\nexport type ModeSessionKind = Static<typeof ModeSessionKindSchema>;\n\nexport const ModeActivationSchema = Type.Union([\n Type.Literal('inactive'),\n Type.Literal('activating'),\n Type.Literal('active'),\n Type.Literal('deactivating'),\n]);\nexport type ModeActivation = Static<typeof ModeActivationSchema>;\n\nexport const ModeConditionSchema = Type.Union([\n Type.Literal('ready'),\n Type.Literal('paused'),\n Type.Literal('blocked'),\n Type.Literal('limited'),\n Type.Literal('queued'),\n Type.Literal('degraded'),\n Type.Literal('failed'),\n]);\nexport type ModeCondition = Static<typeof ModeConditionSchema>;\n\nexport const ModeScalarSchema = Type.Union([\n Type.String({ maxLength: MODE_MAX_ARGUMENT_LENGTH }),\n Type.Number(),\n Type.Boolean(),\n]);\nexport type ModeScalar = Static<typeof ModeScalarSchema>;\n\nconst ParameterBase = {\n name: ModeParameterNameSchema,\n label: LabelSchema,\n description: Type.Optional(DescriptionSchema),\n required: Type.Boolean(),\n};\n\nexport const ModeActionParameterSchema = Type.Union([\n Type.Object(\n {\n ...ParameterBase,\n kind: Type.Literal('string'),\n minLength: Type.Optional(Type.Integer({ minimum: 0, maximum: MODE_MAX_ARGUMENT_LENGTH })),\n maxLength: Type.Optional(Type.Integer({ minimum: 1, maximum: MODE_MAX_ARGUMENT_LENGTH })),\n },\n { additionalProperties: false },\n ),\n Type.Object(\n {\n ...ParameterBase,\n kind: Type.Literal('number'),\n integer: Type.Optional(Type.Boolean()),\n minimum: Type.Optional(Type.Number()),\n maximum: Type.Optional(Type.Number()),\n },\n { additionalProperties: false },\n ),\n Type.Object({ ...ParameterBase, kind: Type.Literal('boolean') }, { additionalProperties: false }),\n Type.Object(\n {\n ...ParameterBase,\n kind: Type.Literal('enum'),\n choices: Type.Array(\n Type.Object(\n {\n value: Type.String({ minLength: 1, maxLength: MAX_ID_LENGTH }),\n label: LabelSchema,\n },\n { additionalProperties: false },\n ),\n { minItems: 1, maxItems: MODE_MAX_ENUM_CHOICES },\n ),\n },\n { additionalProperties: false },\n ),\n]);\nexport type ModeActionParameter = Static<typeof ModeActionParameterSchema>;\n\nexport const ModeActionDescriptorSchema = Type.Object(\n {\n id: ModeIdSchema,\n label: LabelSchema,\n description: DescriptionSchema,\n contexts: Type.Array(ModeSessionKindSchema, { minItems: 1, maxItems: 2, uniqueItems: true }),\n parameters: Type.Array(ModeActionParameterSchema, { maxItems: MODE_MAX_PARAMETERS }),\n },\n { additionalProperties: false },\n);\nexport type ModeActionDescriptor = Static<typeof ModeActionDescriptorSchema>;\n\nexport const ModeDescriptorSchema = Type.Object(\n {\n source: ModeSourceSchema,\n id: ModeIdSchema,\n label: LabelSchema,\n description: DescriptionSchema,\n order: Type.Integer({ minimum: 0, maximum: 1_000 }),\n actions: Type.Array(ModeActionDescriptorSchema, { maxItems: MODE_MAX_ACTIONS }),\n },\n { additionalProperties: false },\n);\nexport type ModeDescriptor = Static<typeof ModeDescriptorSchema>;\n\nexport const ModeActionAvailabilitySchema = Type.Object(\n {\n id: ModeIdSchema,\n enabled: Type.Boolean(),\n disabledReason: Type.Optional(Type.String({ minLength: 1, maxLength: MAX_DETAIL_LENGTH })),\n },\n { additionalProperties: false },\n);\nexport type ModeActionAvailability = Static<typeof ModeActionAvailabilitySchema>;\n\nexport const ModeStateSchema = Type.Object(\n {\n activation: ModeActivationSchema,\n condition: ModeConditionSchema,\n detail: Type.Optional(Type.String({ minLength: 1, maxLength: MAX_DETAIL_LENGTH })),\n color: Type.Optional(ModeTextColorSchema),\n modelContextVariant: Type.Optional(Type.String({ minLength: 1, maxLength: MAX_ID_LENGTH })),\n actions: Type.Array(ModeActionAvailabilitySchema, { maxItems: MODE_MAX_ACTIONS }),\n },\n { additionalProperties: false },\n);\nexport type ModeState = Static<typeof ModeStateSchema>;\n\nexport const ModeRegistrationRefSchema = Type.Object(\n {\n source: ModeSourceSchema,\n id: ModeIdSchema,\n ownerGeneration: GenerationSchema,\n registrationId: GenerationSchema,\n },\n { additionalProperties: false },\n);\nexport type ModeRegistrationRef = Static<typeof ModeRegistrationRefSchema>;\n\nexport const ModeRecordSchema = Type.Object(\n {\n descriptor: ModeDescriptorSchema,\n state: ModeStateSchema,\n ownerGeneration: GenerationSchema,\n registrationId: GenerationSchema,\n stateRevision: Type.Integer({ minimum: 0 }),\n },\n { additionalProperties: false },\n);\nexport type ModeRecord = Static<typeof ModeRecordSchema>;\n\nexport const ModeCatalogSnapshotSchema = Type.Object(\n {\n hostGeneration: GenerationSchema,\n revision: Type.Integer({ minimum: 0 }),\n modes: Type.Array(ModeRecordSchema, { maxItems: MODE_MAX_RECORDS }),\n },\n { additionalProperties: false },\n);\nexport type ModeCatalogSnapshot = Static<typeof ModeCatalogSnapshotSchema>;\n\nexport const ModeArgumentsSchema = Type.Record(ModeParameterNameSchema, ModeScalarSchema, {\n maxProperties: MODE_MAX_PARAMETERS,\n});\nexport type ModeArguments = Static<typeof ModeArgumentsSchema>;\n\nexport const ModeToolInputSchema = Type.Object(\n {\n action: Type.Union([Type.Literal('list'), Type.Literal('invoke')]),\n source: Type.Optional(ModeSourceSchema),\n id: Type.Optional(ModeIdSchema),\n ownerGeneration: Type.Optional(GenerationSchema),\n registrationId: Type.Optional(GenerationSchema),\n modeAction: Type.Optional(ModeIdSchema),\n arguments: Type.Optional(ModeArgumentsSchema),\n },\n { additionalProperties: false },\n);\nexport type ModeToolInput = Static<typeof ModeToolInputSchema>;\nexport const ModeToolResultSchema = Type.Unknown();\n\nexport const ModeActionRequestSchema = Type.Object(\n {\n operationId: OperationIdSchema,\n mode: ModeRegistrationRefSchema,\n actionId: ModeIdSchema,\n arguments: ModeArgumentsSchema,\n },\n { additionalProperties: false },\n);\nexport type ModeActionRequest = Static<typeof ModeActionRequestSchema>;\n\nexport const ModeActionResponseSchema = Type.Object(\n {\n operationId: OperationIdSchema,\n catalogRevision: Type.Integer({ minimum: 0 }),\n mode: ModeRecordSchema,\n message: Type.Optional(Type.String({ minLength: 1, maxLength: MAX_DETAIL_LENGTH })),\n },\n { additionalProperties: false },\n);\nexport type ModeActionResponse = Static<typeof ModeActionResponseSchema>;\n\n/**\n * The custom session entry the catalog host journals whenever its projection\n * changes. It rides Pi's entry_appended frames, so any RPC client (the web\n * cockpit) sees mode state live and on replay without a new protocol.\n */\nexport const PO_MODE_ENTRY_TYPE = 'po-modes';\n\nexport interface ModeActionProjection {\n readonly id: string;\n readonly label: string;\n readonly description: string;\n readonly enabled: boolean;\n readonly disabledReason?: string;\n /** Whether invoking it needs arguments a client must ask for first. */\n readonly needsInput: boolean;\n}\n\nexport interface ModeRecordProjection {\n readonly id: string;\n readonly label: string;\n readonly description: string;\n readonly order: number;\n readonly activation: ModeActivation;\n readonly condition: ModeCondition;\n readonly detail?: string;\n readonly actions: readonly ModeActionProjection[];\n}\n\nexport interface ModeProjection {\n readonly version: 1;\n readonly revision: number;\n readonly modes: readonly ModeRecordProjection[];\n}\n\nexport interface ModeOwnerActionResult {\n message?: string;\n}\n\nexport interface ModeOwnerActionContext<ExtensionContext extends PoExtensionContext> {\n context: ExtensionContext;\n operationId: string;\n sessionKind: ModeSessionKind;\n signal: AbortSignal;\n /** The device that sent the command, when it came from a connected client. Never authorization. */\n clientMetadata?: PoClientMetadata;\n}\n\nexport interface ModeOwnerDefinition<ExtensionContext extends PoExtensionContext> {\n descriptor: ModeDescriptor;\n initialState: ModeState;\n handleAction(\n actionId: string,\n argumentsValue: ModeArguments,\n execution: ModeOwnerActionContext<ExtensionContext>,\n ): ModeOwnerActionResult | void | Promise<ModeOwnerActionResult | void>;\n onError?(error: unknown): void;\n}\n\nexport interface ModeOwnerHandle {\n getState(): ModeState;\n publish(state: ModeState): void;\n dispose(): void;\n}\n\nexport interface ModeInvokeOptions {\n readonly signal?: AbortSignal;\n}\n\n/** Direct session-local catalog shared through Cordis. */\nexport interface ModeCatalogService {\n readonly generation: string;\n getSnapshot(): ModeCatalogSnapshot;\n list(): ModeRecord[];\n subscribe(listener: () => void): () => void;\n registerOwner<ExtensionContext extends PoExtensionContext>(\n definition: ModeOwnerDefinition<ExtensionContext>,\n ): ModeOwnerHandle;\n invoke(\n request: ModeActionRequest,\n requesterSource: string,\n signal?: AbortSignal,\n clientMetadata?: PoClientMetadata,\n ): Promise<ModeActionResponse>;\n dispose(): void;\n}\n\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/mode-catalog': ModeCatalogService;\n }\n}\n\nexport function readModeCatalog(context: Context): ModeCatalogService | undefined {\n return context.get(PO_MODE_CATALOG_SERVICE) as ModeCatalogService | undefined;\n}\n\nexport function requireModeCatalog(context: Context): ModeCatalogService {\n const catalog = readModeCatalog(context);\n if (!catalog) throw new Error('Po mode catalog is unavailable.');\n return catalog;\n}\n","import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nimport { ModeActivationSchema, ModeConditionSchema } from './mode';\n\nexport const ModeProjectionSchema = Type.Object({\n version: Type.Literal(1),\n revision: Type.Number(),\n modes: Type.Array(\n Type.Object({\n id: Type.String(),\n label: Type.String(),\n description: Type.String(),\n order: Type.Number(),\n activation: ModeActivationSchema,\n condition: ModeConditionSchema,\n detail: Type.Optional(Type.String()),\n actions: Type.Array(\n Type.Object({\n id: Type.String(),\n label: Type.String(),\n description: Type.String(),\n enabled: Type.Boolean(),\n disabledReason: Type.Optional(Type.String()),\n needsInput: Type.Boolean(),\n }),\n ),\n }),\n ),\n});\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'modes.current',\n scope: 'session',\n basePath: 'modes',\n path: '/current',\n method: 'GET',\n authentication: 'owner',\n description: 'Read the current headless mode projection.',\n responses: jsonApiResponses(ModeProjectionSchema),\n },\n ],\n sockets: [],\n dynamic: [],\n});\nexport default apiContracts;\n"],"mappings":";;;;;;AAaA,MAAa,2BAA2B;AAExC,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AACtB,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB;AAiB1B,MAAa,mBAAmBA,QAAAA,KAAK,OAAO;CAC1C,WAAW;CACX,WAAW;CACX,SAAS;AACX,CAAC;AACD,MAAa,eAAeA,QAAAA,KAAK,OAAO;CACtC,WAAW;CACX,WAAW;CACX,SAAS;AACX,CAAC;AACD,MAAa,0BAA0BA,QAAAA,KAAK,OAAO;CACjD,WAAW;CACX,WAAW;CACX,SAAS;AACX,CAAC;AACD,MAAM,mBAAmBA,QAAAA,KAAK,OAAO;CAAE,WAAW;CAAG,WAAW;AAAsB,CAAC;AACvF,MAAM,cAAcA,QAAAA,KAAK,OAAO;CAAE,W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;;AClQA,MAAa,uBAAuBC,QAAAA,KAAK,OAAO;CAC9C,SAASA,QAAAA,KAAK,QAAQ,CAAC;CACvB,UAAUA,QAAAA,KAAK,OAAO;CACtB,OAAOA,QAAAA,KAAK,MACVA,QAAAA,KAAK,OAAO;EACV,IAAIA,QAAAA,KAAK,OAAO;EAChB,OAAOA,QAAAA,KAAK,OAAO;EACnB,aAAaA,QAAAA,KAAK,OAAO;EACzB,OAAOA,QAAAA,KAAK,OAAO;EACnB,YAAY;EACZ,WAAW;EACX,QAAQA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;EACnC,SAASA,QAAAA,KAAK,MACZA,QAAAA,KAAK,OAAO;GACV,IAAIA,QAAAA,KAAK,OAAO;GAChB,OAAOA,QAAAA,KAAK,OAAO;GACnB,aAAaA,QAAAA,KAAK,OAAO;GACzB,SAASA,QAAAA,KAAK,QAAQ;GACtB,gBAAgBA,QAAAA,KAAK,SAASA,QAAAA,KAAK,OAAO,CAAC;GAC3C,YAAYA,QAAAA,KAAK,QAAQ;EAC3B,CAAC,CACH;CACF,CAAC,CACH;AACF,CAAC;AAED,MAAa,gBAAA,GAAeC,gCAAAA,kBAAAA,CAAkB;CAC5C,SAAS;CACT,MAAM,CACJ;EACE,IAAI;EACJ,OAAO;EACP,UAAU;EACV,MAAM;EACN,QAAQ;EACR,gBAAgB;EAChB,aAAa;EACb,YAAA,GAAWC,gCAAAA,iBAAAA,CAAiB,oBAAoB;CAClD,CACF;CACA,SAAS,CAAC;CACV,SAAS,CAAC;AACZ,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Type } from "typebox";
2
+ //#region src/schemas/apiContracts.d.ts
3
+ export declare const apiContracts: {
4
+ version: 1;
5
+ protocols?: Record<string, string> | undefined;
6
+ schemas?: Record<string, boolean | object> | undefined;
7
+ http: {
8
+ id: string;
9
+ scope: "host" | "session" | "workspace";
10
+ basePath?: string | undefined;
11
+ path: string;
12
+ method: "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT";
13
+ description: string;
14
+ availability?: string | undefined;
15
+ authentication: "device" | "none" | "owner";
16
+ parameters?: {
17
+ name: string;
18
+ in: "header" | "path" | "query";
19
+ required: boolean;
20
+ schema: boolean | object;
21
+ }[] | undefined;
22
+ body?: {
23
+ contentType: string;
24
+ contentTypes?: string[] | undefined;
25
+ required: boolean;
26
+ schema: boolean | object;
27
+ } | undefined;
28
+ responses: Record<string, {
29
+ description: string;
30
+ contentType?: string | undefined;
31
+ schema?: boolean | object | undefined;
32
+ events?: Record<string, boolean | object> | undefined;
33
+ }>;
34
+ }[];
35
+ sockets: {
36
+ id: string;
37
+ scope: "host" | "session" | "workspace";
38
+ description: string;
39
+ availability?: string | undefined;
40
+ service: string;
41
+ member: string;
42
+ direction: "client-to-server" | "server-to-client";
43
+ kind: "channel" | "method" | "state";
44
+ input: boolean | object;
45
+ output?: boolean | object | undefined;
46
+ errors?: boolean | object | undefined;
47
+ }[];
48
+ dynamic: string[];
49
+ gaps?: string[] | undefined;
50
+ };
51
+ //#endregion
52
+ export { apiContracts as default };
53
+ //# sourceMappingURL=apiContracts.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";;qBA+Ba"}