@agimon-ai/po-image-gen 0.0.0-alpha.13 → 0.0.0-alpha.131
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/LICENSE +149 -21
- package/README.md +13 -4
- package/dist/apiContracts.cjs +46 -24
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +46 -24
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/extensions/native.mjs +285 -0
- package/dist/extensions/native.mjs.map +1 -0
- package/dist/extensions/server.cjs +403 -38
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +405 -40
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +114 -218
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/imagegenTool-BjNsLs9o.cjs +581 -0
- package/dist/imagegenTool-BjNsLs9o.cjs.map +1 -0
- package/dist/imagegenTool-tnDwaYpe.mjs +528 -0
- package/dist/imagegenTool-tnDwaYpe.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts +9 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/llms.txt +1 -1
- package/package.json +56 -14
- package/src/prompts/codemode-how-to-image-gen/SKILL.md +31 -0
- package/dist/imagegenTool-DDb0F5QH.cjs +0 -287
- package/dist/imagegenTool-DDb0F5QH.cjs.map +0 -1
- package/dist/imagegenTool-DMrMZjfO.mjs +0 -258
- package/dist/imagegenTool-DMrMZjfO.mjs.map +0 -1
- package/src/prompts/po-use-image-gen/SKILL.md +0 -14
package/LICENSE
CHANGED
|
@@ -1,21 +1,149 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
CHANGED
|
@@ -14,15 +14,24 @@ Sign in to **ChatGPT for Po features** under Settings > Providers (or with `/log
|
|
|
14
14
|
|
|
15
15
|
- `prompt`: non-blank image instructions.
|
|
16
16
|
- `transparent_background`: optional boolean.
|
|
17
|
-
- `referenced_image_paths`: optional list of up to five absolute local PNG, JPEG, or
|
|
17
|
+
- `referenced_image_paths`: optional list of up to five absolute local PNG, JPEG, WebP, or GIF file paths. Omit for a new image; supply for an edit. A GIF is sent as a PNG of its first frame. Each file is limited to 20 MiB, with 50 MiB total.
|
|
18
|
+
- `num_last_images_to_include`: optional 1 to 5. Edits the most recent images from user messages and tool results instead, for targets without a local path. Never combined with `referenced_image_paths`; fails when fewer images are available. Same size limits.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
These match Codex's `image_gen.imagegen` arguments. Codex fixes model, quality and size rather than exposing them, and so does Po.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
The result includes an inline PNG and a save hint. Files are created exclusively at `<poHome>/generated_images/<session>/<call>.png`; existing files are never overwritten. A save failure returns the image with a warning. Output is limited to 32 MiB. Details record each local input file as `{ path, sha256 }` of the bytes read, and the card lists them.
|
|
23
|
+
|
|
24
|
+
In code mode, `imagegen.generate` also shows each image to the model when the exec run returns. When the run's image limit refuses one, the result carries `modelVisibilityWarning` and the image stays saved.
|
|
25
|
+
|
|
26
|
+
Quota, account denial, and network failures are returned without retrying. Cancelling propagates the abort signal. Model/quality/size selection and MCP are not included.
|
|
27
|
+
|
|
28
|
+
## Code mode
|
|
29
|
+
|
|
30
|
+
When code mode is bound, the package registers the `imagegen` namespace (`imagegen.generate(prompt, { transparentBackground?, referencedImagePaths?, numLastImagesToInclude? })`, resolving to `{ savedPath }` or `{ saveWarning }`) and withdraws the `imagegen` tool, so the model sees one surface. Both run the same generate, save and artifact-copy path, and the cockpit draws namespace calls with the tool's image card. The pinned `codemode-how-to-image-gen` skill teaches its use.
|
|
22
31
|
|
|
23
32
|
## Structure and lifecycle
|
|
24
33
|
|
|
25
|
-
The generated server entry discovers the routed `imagegen.server.ts` tool. The web entry discovers its matching `imagegen.web.tsx` renderer. Tool execution uses the host's provider-neutral `imageGeneration` capability; extensions never receive tokens or headers. The host guards readiness and disposal, and refreshes existing OAuth credentials per call.
|
|
34
|
+
The generated server entry discovers the routed `root.server.ts`, which builds the tool and registers the code-mode namespace, and the `imagegen.server.ts` tool that reads it. The web entry discovers its matching `imagegen.web.tsx` renderer. Tool execution uses the host's provider-neutral `imageGeneration` capability; extensions never receive tokens or headers. The host guards readiness and disposal, and refreshes existing OAuth credentials per call.
|
|
26
35
|
|
|
27
36
|
## Development
|
|
28
37
|
|
package/dist/apiContracts.cjs
CHANGED
|
@@ -16,33 +16,55 @@ const Artifact = typebox.Type.Object({
|
|
|
16
16
|
originalPath: typebox.Type.String(),
|
|
17
17
|
sourceSha256: typebox.Type.String(),
|
|
18
18
|
data: typebox.Type.String(),
|
|
19
|
-
mimeType: typebox.Type.Literal("image/png")
|
|
19
|
+
mimeType: typebox.Type.Literal("image/png"),
|
|
20
|
+
offset: typebox.Type.Optional(typebox.Type.Integer({ minimum: 0 }))
|
|
20
21
|
});
|
|
21
22
|
const apiContracts = (0, _agimon_ai_po_core_apiContracts.defineApiContract)({
|
|
22
23
|
version: 1,
|
|
23
|
-
http: [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
http: [
|
|
25
|
+
{
|
|
26
|
+
id: "promoteImage",
|
|
27
|
+
scope: "session",
|
|
28
|
+
basePath: "images",
|
|
29
|
+
path: "/promote",
|
|
30
|
+
method: "POST",
|
|
31
|
+
authentication: "owner",
|
|
32
|
+
description: "Copy one preserved session image into session artifacts for Author.",
|
|
33
|
+
body: {
|
|
34
|
+
contentType: "application/json",
|
|
35
|
+
required: true,
|
|
36
|
+
schema: typebox.Type.Object({ id: typebox.Type.String({ pattern: "^[A-Za-z0-9_-]{1,128}$" }) }, { additionalProperties: false })
|
|
37
|
+
},
|
|
38
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
|
|
39
|
+
sessionId: typebox.Type.String(),
|
|
40
|
+
path: typebox.Type.String()
|
|
41
|
+
}))
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "listImages",
|
|
45
|
+
scope: "session",
|
|
46
|
+
basePath: "images",
|
|
47
|
+
path: "/artifacts",
|
|
48
|
+
method: "GET",
|
|
49
|
+
authentication: "owner",
|
|
50
|
+
description: "List preserved images in the current session.",
|
|
51
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(typebox.Type.Object({
|
|
52
|
+
sessionId: typebox.Type.String(),
|
|
53
|
+
items: typebox.Type.Array(typebox.Type.Object(Metadata)),
|
|
54
|
+
nextCursor: typebox.Type.Union([typebox.Type.String(), typebox.Type.Null()])
|
|
55
|
+
}))
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "readImage",
|
|
59
|
+
scope: "session",
|
|
60
|
+
basePath: "images",
|
|
61
|
+
path: "/artifact",
|
|
62
|
+
method: "GET",
|
|
63
|
+
authentication: "owner",
|
|
64
|
+
description: "Read a verified preserved session image by artifact or tool call identity.",
|
|
65
|
+
responses: (0, _agimon_ai_po_core_apiContracts.jsonApiResponses)(Artifact)
|
|
66
|
+
}
|
|
67
|
+
],
|
|
46
68
|
sockets: [],
|
|
47
69
|
dynamic: []
|
|
48
70
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst Metadata = { id: Type.String(), createdAt: Type.String(), byteLength: Type.Integer() };\nconst Artifact = Type.Object({\n ...Metadata,\n sessionId: Type.String(),\n originalPath: Type.String(),\n sourceSha256: Type.String(),\n data: Type.String(),\n mimeType: Type.Literal('image/png'),\n});\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'listImages',\n scope: 'session',\n basePath: 'images',\n path: '/artifacts',\n method: 'GET',\n authentication: 'owner',\n description: 'List preserved images in the current session.',\n responses: jsonApiResponses(\n Type.Object({\n sessionId: Type.String(),\n items: Type.Array(Type.Object(Metadata)),\n nextCursor: Type.Union([Type.String(), Type.Null()]),\n }),\n ),\n },\n {\n id: 'readImage',\n scope: 'session',\n basePath: 'images',\n path: '/artifact',\n method: 'GET',\n authentication: 'owner',\n description: 'Read a verified preserved session image by artifact or tool call identity.',\n responses: jsonApiResponses(Artifact),\n },\n ],\n sockets: [],\n dynamic: [],\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAM,WAAW;CAAE,IAAIA,QAAAA,KAAK,OAAO;CAAG,WAAWA,QAAAA,KAAK,OAAO;CAAG,YAAYA,QAAAA,KAAK,QAAQ;AAAE;AAC3F,MAAM,WAAWA,QAAAA,KAAK,OAAO;CAC3B,GAAG;CACH,WAAWA,QAAAA,KAAK,OAAO;CACvB,cAAcA,QAAAA,KAAK,OAAO;CAC1B,cAAcA,QAAAA,KAAK,OAAO;CAC1B,MAAMA,QAAAA,KAAK,OAAO;CAClB,UAAUA,QAAAA,KAAK,QAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"apiContracts.cjs","names":["Type","defineApiContract","jsonApiResponses"],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst Metadata = { id: Type.String(), createdAt: Type.String(), byteLength: Type.Integer() };\nconst Artifact = Type.Object({\n ...Metadata,\n sessionId: Type.String(),\n originalPath: Type.String(),\n sourceSha256: Type.String(),\n data: Type.String(),\n mimeType: Type.Literal('image/png'),\n offset: Type.Optional(Type.Integer({ minimum: 0 })),\n});\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'promoteImage',\n scope: 'session',\n basePath: 'images',\n path: '/promote',\n method: 'POST',\n authentication: 'owner',\n description: 'Copy one preserved session image into session artifacts for Author.',\n body: {\n contentType: 'application/json',\n required: true,\n schema: Type.Object(\n { id: Type.String({ pattern: '^[A-Za-z0-9_-]{1,128}$' }) },\n { additionalProperties: false },\n ),\n },\n responses: jsonApiResponses(Type.Object({ sessionId: Type.String(), path: Type.String() })),\n },\n {\n id: 'listImages',\n scope: 'session',\n basePath: 'images',\n path: '/artifacts',\n method: 'GET',\n authentication: 'owner',\n description: 'List preserved images in the current session.',\n responses: jsonApiResponses(\n Type.Object({\n sessionId: Type.String(),\n items: Type.Array(Type.Object(Metadata)),\n nextCursor: Type.Union([Type.String(), Type.Null()]),\n }),\n ),\n },\n {\n id: 'readImage',\n scope: 'session',\n basePath: 'images',\n path: '/artifact',\n method: 'GET',\n authentication: 'owner',\n description: 'Read a verified preserved session image by artifact or tool call identity.',\n responses: jsonApiResponses(Artifact),\n },\n ],\n sockets: [],\n dynamic: [],\n});\nexport default apiContracts;\n"],"mappings":";;;;;;;AAGA,MAAM,WAAW;CAAE,IAAIA,QAAAA,KAAK,OAAO;CAAG,WAAWA,QAAAA,KAAK,OAAO;CAAG,YAAYA,QAAAA,KAAK,QAAQ;AAAE;AAC3F,MAAM,WAAWA,QAAAA,KAAK,OAAO;CAC3B,GAAG;CACH,WAAWA,QAAAA,KAAK,OAAO;CACvB,cAAcA,QAAAA,KAAK,OAAO;CAC1B,cAAcA,QAAAA,KAAK,OAAO;CAC1B,MAAMA,QAAAA,KAAK,OAAO;CAClB,UAAUA,QAAAA,KAAK,QAAQ,WAAW;CAClC,QAAQA,QAAAA,KAAK,SAASA,QAAAA,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAa,gBAAA,GAAeC,gCAAAA,kBAAAA,CAAkB;CAC5C,SAAS;CACT,MAAM;EACJ;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,MAAM;IACJ,aAAa;IACb,UAAU;IACV,QAAQD,QAAAA,KAAK,OACX,EAAE,IAAIA,QAAAA,KAAK,OAAO,EAAE,SAAS,yBAAyB,CAAC,EAAE,GACzD,EAAE,sBAAsB,MAAM,CAChC;GACF;GACA,YAAA,GAAWE,gCAAAA,iBAAAA,CAAiBF,QAAAA,KAAK,OAAO;IAAE,WAAWA,QAAAA,KAAK,OAAO;IAAG,MAAMA,QAAAA,KAAK,OAAO;GAAE,CAAC,CAAC;EAC5F;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,YAAA,GAAWE,gCAAAA,iBAAAA,CACTF,QAAAA,KAAK,OAAO;IACV,WAAWA,QAAAA,KAAK,OAAO;IACvB,OAAOA,QAAAA,KAAK,MAAMA,QAAAA,KAAK,OAAO,QAAQ,CAAC;IACvC,YAAYA,QAAAA,KAAK,MAAM,CAACA,QAAAA,KAAK,OAAO,GAAGA,QAAAA,KAAK,KAAK,CAAC,CAAC;GACrD,CAAC,CACH;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,YAAA,GAAWE,gCAAAA,iBAAAA,CAAiB,QAAQ;EACtC;CACF;CACA,SAAS,CAAC;CACV,SAAS,CAAC;AACZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"apiContracts.d.mts","names":[],"sources":["../src/schemas/apiContracts.ts"],"mappings":";qBAca"}
|
package/dist/apiContracts.mjs
CHANGED
|
@@ -12,33 +12,55 @@ const Artifact = Type.Object({
|
|
|
12
12
|
originalPath: Type.String(),
|
|
13
13
|
sourceSha256: Type.String(),
|
|
14
14
|
data: Type.String(),
|
|
15
|
-
mimeType: Type.Literal("image/png")
|
|
15
|
+
mimeType: Type.Literal("image/png"),
|
|
16
|
+
offset: Type.Optional(Type.Integer({ minimum: 0 }))
|
|
16
17
|
});
|
|
17
18
|
const apiContracts = defineApiContract({
|
|
18
19
|
version: 1,
|
|
19
|
-
http: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
20
|
+
http: [
|
|
21
|
+
{
|
|
22
|
+
id: "promoteImage",
|
|
23
|
+
scope: "session",
|
|
24
|
+
basePath: "images",
|
|
25
|
+
path: "/promote",
|
|
26
|
+
method: "POST",
|
|
27
|
+
authentication: "owner",
|
|
28
|
+
description: "Copy one preserved session image into session artifacts for Author.",
|
|
29
|
+
body: {
|
|
30
|
+
contentType: "application/json",
|
|
31
|
+
required: true,
|
|
32
|
+
schema: Type.Object({ id: Type.String({ pattern: "^[A-Za-z0-9_-]{1,128}$" }) }, { additionalProperties: false })
|
|
33
|
+
},
|
|
34
|
+
responses: jsonApiResponses(Type.Object({
|
|
35
|
+
sessionId: Type.String(),
|
|
36
|
+
path: Type.String()
|
|
37
|
+
}))
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "listImages",
|
|
41
|
+
scope: "session",
|
|
42
|
+
basePath: "images",
|
|
43
|
+
path: "/artifacts",
|
|
44
|
+
method: "GET",
|
|
45
|
+
authentication: "owner",
|
|
46
|
+
description: "List preserved images in the current session.",
|
|
47
|
+
responses: jsonApiResponses(Type.Object({
|
|
48
|
+
sessionId: Type.String(),
|
|
49
|
+
items: Type.Array(Type.Object(Metadata)),
|
|
50
|
+
nextCursor: Type.Union([Type.String(), Type.Null()])
|
|
51
|
+
}))
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "readImage",
|
|
55
|
+
scope: "session",
|
|
56
|
+
basePath: "images",
|
|
57
|
+
path: "/artifact",
|
|
58
|
+
method: "GET",
|
|
59
|
+
authentication: "owner",
|
|
60
|
+
description: "Read a verified preserved session image by artifact or tool call identity.",
|
|
61
|
+
responses: jsonApiResponses(Artifact)
|
|
62
|
+
}
|
|
63
|
+
],
|
|
42
64
|
sockets: [],
|
|
43
65
|
dynamic: []
|
|
44
66
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst Metadata = { id: Type.String(), createdAt: Type.String(), byteLength: Type.Integer() };\nconst Artifact = Type.Object({\n ...Metadata,\n sessionId: Type.String(),\n originalPath: Type.String(),\n sourceSha256: Type.String(),\n data: Type.String(),\n mimeType: Type.Literal('image/png'),\n});\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'listImages',\n scope: 'session',\n basePath: 'images',\n path: '/artifacts',\n method: 'GET',\n authentication: 'owner',\n description: 'List preserved images in the current session.',\n responses: jsonApiResponses(\n Type.Object({\n sessionId: Type.String(),\n items: Type.Array(Type.Object(Metadata)),\n nextCursor: Type.Union([Type.String(), Type.Null()]),\n }),\n ),\n },\n {\n id: 'readImage',\n scope: 'session',\n basePath: 'images',\n path: '/artifact',\n method: 'GET',\n authentication: 'owner',\n description: 'Read a verified preserved session image by artifact or tool call identity.',\n responses: jsonApiResponses(Artifact),\n },\n ],\n sockets: [],\n dynamic: [],\n});\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAM,WAAW;CAAE,IAAI,KAAK,OAAO;CAAG,WAAW,KAAK,OAAO;CAAG,YAAY,KAAK,QAAQ;AAAE;AAC3F,MAAM,WAAW,KAAK,OAAO;CAC3B,GAAG;CACH,WAAW,KAAK,OAAO;CACvB,cAAc,KAAK,OAAO;CAC1B,cAAc,KAAK,OAAO;CAC1B,MAAM,KAAK,OAAO;CAClB,UAAU,KAAK,QAAQ,WAAW;
|
|
1
|
+
{"version":3,"file":"apiContracts.mjs","names":[],"sources":["../src/schemas/apiContracts.ts"],"sourcesContent":["import { defineApiContract, jsonApiResponses } from '@agimon-ai/po-core/apiContracts';\nimport { Type } from 'typebox';\n\nconst Metadata = { id: Type.String(), createdAt: Type.String(), byteLength: Type.Integer() };\nconst Artifact = Type.Object({\n ...Metadata,\n sessionId: Type.String(),\n originalPath: Type.String(),\n sourceSha256: Type.String(),\n data: Type.String(),\n mimeType: Type.Literal('image/png'),\n offset: Type.Optional(Type.Integer({ minimum: 0 })),\n});\n\nexport const apiContracts = defineApiContract({\n version: 1,\n http: [\n {\n id: 'promoteImage',\n scope: 'session',\n basePath: 'images',\n path: '/promote',\n method: 'POST',\n authentication: 'owner',\n description: 'Copy one preserved session image into session artifacts for Author.',\n body: {\n contentType: 'application/json',\n required: true,\n schema: Type.Object(\n { id: Type.String({ pattern: '^[A-Za-z0-9_-]{1,128}$' }) },\n { additionalProperties: false },\n ),\n },\n responses: jsonApiResponses(Type.Object({ sessionId: Type.String(), path: Type.String() })),\n },\n {\n id: 'listImages',\n scope: 'session',\n basePath: 'images',\n path: '/artifacts',\n method: 'GET',\n authentication: 'owner',\n description: 'List preserved images in the current session.',\n responses: jsonApiResponses(\n Type.Object({\n sessionId: Type.String(),\n items: Type.Array(Type.Object(Metadata)),\n nextCursor: Type.Union([Type.String(), Type.Null()]),\n }),\n ),\n },\n {\n id: 'readImage',\n scope: 'session',\n basePath: 'images',\n path: '/artifact',\n method: 'GET',\n authentication: 'owner',\n description: 'Read a verified preserved session image by artifact or tool call identity.',\n responses: jsonApiResponses(Artifact),\n },\n ],\n sockets: [],\n dynamic: [],\n});\nexport default apiContracts;\n"],"mappings":";;;AAGA,MAAM,WAAW;CAAE,IAAI,KAAK,OAAO;CAAG,WAAW,KAAK,OAAO;CAAG,YAAY,KAAK,QAAQ;AAAE;AAC3F,MAAM,WAAW,KAAK,OAAO;CAC3B,GAAG;CACH,WAAW,KAAK,OAAO;CACvB,cAAc,KAAK,OAAO;CAC1B,cAAc,KAAK,OAAO;CAC1B,MAAM,KAAK,OAAO;CAClB,UAAU,KAAK,QAAQ,WAAW;CAClC,QAAQ,KAAK,SAAS,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAa,eAAe,kBAAkB;CAC5C,SAAS;CACT,MAAM;EACJ;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,MAAM;IACJ,aAAa;IACb,UAAU;IACV,QAAQ,KAAK,OACX,EAAE,IAAI,KAAK,OAAO,EAAE,SAAS,yBAAyB,CAAC,EAAE,GACzD,EAAE,sBAAsB,MAAM,CAChC;GACF;GACA,WAAW,iBAAiB,KAAK,OAAO;IAAE,WAAW,KAAK,OAAO;IAAG,MAAM,KAAK,OAAO;GAAE,CAAC,CAAC;EAC5F;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,WAAW,iBACT,KAAK,OAAO;IACV,WAAW,KAAK,OAAO;IACvB,OAAO,KAAK,MAAM,KAAK,OAAO,QAAQ,CAAC;IACvC,YAAY,KAAK,MAAM,CAAC,KAAK,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC;GACrD,CAAC,CACH;EACF;EACA;GACE,IAAI;GACJ,OAAO;GACP,UAAU;GACV,MAAM;GACN,QAAQ;GACR,gBAAgB;GAChB,aAAa;GACb,WAAW,iBAAiB,QAAQ;EACtC;CACF;CACA,SAAS,CAAC;CACV,SAAS,CAAC;AACZ,CAAC"}
|