@kybernesis/artifacts 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +46 -2
- package/dist/_chunks/src-NHIAmKm9.mjs +160 -0
- package/dist/extension/_manifest.json +10 -0
- package/dist/extension/extension.d.ts +8 -0
- package/dist/extension/extension.mjs +9 -0
- package/dist/extension/instructions.md +11 -0
- package/dist/extension/lib/shared.d.ts +38 -0
- package/dist/extension/lib/shared.mjs +36 -0
- package/dist/extension/tools/create.d.ts +37 -0
- package/dist/extension/tools/create.mjs +37 -0
- package/dist/extension/tools/list.d.ts +9 -0
- package/dist/extension/tools/list.mjs +21 -0
- package/dist/extension/tools/read.d.ts +25 -0
- package/dist/extension/tools/read.mjs +29 -0
- package/dist/extension/tools/update.d.ts +33 -0
- package/dist/extension/tools/update.mjs +37 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +172 -0
- package/dist/index.mjs +8 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.mjs +11 -0
- package/package.json +70 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,47 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kybernesis/artifacts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pages an eve agent makes for a person: a report, a dashboard, a tracker, a plan. KYBER Studio and the phone draw each one as a card in the conversation, with an inline preview or an Open button, and list them under the agent's Artifacts. Like artifacts in a chat app, except they live on the agent's own machine and belong to the person who asked.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
eve add @kybernesis/artifacts
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
That writes `agent/extensions/artifacts.ts`, which mounts the extension. The agent gets four tools: `artifacts__create`, `artifacts__update`, `artifacts__list` and `artifacts__read`, plus short instructions on when to make one. The apps read artifacts through `@kybernesis/manage` 0.25 or later, which serves `/eve/v1/kyb/artifacts`.
|
|
12
|
+
|
|
13
|
+
## How it works
|
|
14
|
+
|
|
15
|
+
- **Format.** One self-contained HTML page (inline CSS and script, data written into the page) or a markdown document. Nothing outside the page loads: the apps render it in a sandbox with no network.
|
|
16
|
+
- **Storage.** On the agent's host, under `ARTIFACTS_DIR` (default `~/.kybernesis/artifacts`): `<id>/meta.json` plus `v<n>.html` or `v<n>.md`. An update writes a new version under the same id. The last fifty versions keep their content.
|
|
17
|
+
- **Who sees it.** The signed-in person whose turn made it, and nobody else. An artifact made with no signed-in person (a routine) belongs to nobody and is shown to the people who manage the agent. "A person" is default-deny: only a principal the control plane authenticated as a user.
|
|
18
|
+
- **The card.** `create` and `update` return the card under `kyb`, in the shared card envelope:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"kyb": 1,
|
|
23
|
+
"card": "artifact",
|
|
24
|
+
"id": "<artifact id>",
|
|
25
|
+
"title": "Website, last 7 days",
|
|
26
|
+
"source": "Artifact",
|
|
27
|
+
"data": { "artifactId": "<id>", "version": 2, "display": "document", "format": "html", "updatedAt": "…" },
|
|
28
|
+
"actions": [{ "label": "Open", "artifact": "<id>" }],
|
|
29
|
+
"text": "…fallback for surfaces that draw no cards…"
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The apps read it from the tool's `action.result` event. The model sees one line (`toModelOutput`), never the card. The card's id is the artifact's, so a newer version replaces the older card in place.
|
|
34
|
+
|
|
35
|
+
## Routes (in `@kybernesis/manage`)
|
|
36
|
+
|
|
37
|
+
All behind the caller's control-plane identity, like every other manage route. Anything the caller cannot see is a 404.
|
|
38
|
+
|
|
39
|
+
| Route | Answers |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `GET /eve/v1/kyb/artifacts` | The caller's artifacts, newest first: id, title, format, display, version, createdAt, updatedAt |
|
|
42
|
+
| `GET /eve/v1/kyb/artifacts/:id` | One artifact with its version history |
|
|
43
|
+
| `GET /eve/v1/kyb/artifacts/:id/content?v=N` | The page as `text/plain` (latest without `v`), for the app to place into its own sandbox. Headers `x-artifact-version`, `x-artifact-latest`, `x-artifact-format` |
|
|
44
|
+
|
|
45
|
+
## The store
|
|
46
|
+
|
|
47
|
+
`@kybernesis/artifacts/store` exports the store on its own (`createArtifact`, `updateArtifact`, `listArtifacts`, `readArtifact`, `viewerFromContext`, `canSee`, `artifactCard`), for anything else on the host that needs to keep per-person files the same way.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { randomBytes } from "node:crypto";
|
|
8
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
9
|
+
import { homedir } from "node:os";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
const ARTIFACT_ID = /^[0-9a-f]{32}$/;
|
|
12
|
+
const MAX_BYTES = 2097152;
|
|
13
|
+
function artifactsDir(options = {}) {
|
|
14
|
+
return options.dir ?? process.env.ARTIFACTS_DIR ?? join(homedir(), ".kybernesis", "artifacts");
|
|
15
|
+
}
|
|
16
|
+
function contentFile(format, version) {
|
|
17
|
+
return `v${version}.${format === "markdown" ? "md" : "html"}`;
|
|
18
|
+
}
|
|
19
|
+
function viewerFromContext(ctx) {
|
|
20
|
+
const current = ctx.session?.auth?.current;
|
|
21
|
+
if (!current?.principalId || current.authenticator !== "kybernesis" || current.principalType !== "user") return {
|
|
22
|
+
person: null,
|
|
23
|
+
manages: false
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
person: current.principalId,
|
|
27
|
+
manages: current.attributes?.agentGrantLevel === "manage"
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function canSee(meta, viewer) {
|
|
31
|
+
if (meta.owner) return meta.owner === viewer.person;
|
|
32
|
+
return viewer.person === null || viewer.manages;
|
|
33
|
+
}
|
|
34
|
+
var ArtifactError = class extends Error {};
|
|
35
|
+
function cleanTitle(title) {
|
|
36
|
+
const t = title.replace(/\s+/g, " ").trim();
|
|
37
|
+
if (!t) throw new ArtifactError("An artifact needs a title.");
|
|
38
|
+
return t.length > 120 ? `${t.slice(0, 119)}…` : t;
|
|
39
|
+
}
|
|
40
|
+
function checkContent(content) {
|
|
41
|
+
const bytes = Buffer.byteLength(content, "utf8");
|
|
42
|
+
if (bytes === 0) throw new ArtifactError("The artifact is empty.");
|
|
43
|
+
if (bytes > 2097152) throw new ArtifactError(`The artifact is ${Math.round(bytes / 1024)} KB; the limit is ${MAX_BYTES / 1024 / 1024} MB. Trim the data or split it.`);
|
|
44
|
+
return bytes;
|
|
45
|
+
}
|
|
46
|
+
function writeAtomic(path, data) {
|
|
47
|
+
const tmp = `${path}.${randomBytes(4).toString("hex")}.tmp`;
|
|
48
|
+
writeFileSync(tmp, data);
|
|
49
|
+
renameSync(tmp, path);
|
|
50
|
+
}
|
|
51
|
+
function readMeta(id, options = {}) {
|
|
52
|
+
if (!ARTIFACT_ID.test(id)) return null;
|
|
53
|
+
try {
|
|
54
|
+
return JSON.parse(readFileSync(join(artifactsDir(options), id, "meta.json"), "utf8"));
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function createArtifact(input, options = {}) {
|
|
60
|
+
const title = cleanTitle(input.title);
|
|
61
|
+
const bytes = checkContent(input.content);
|
|
62
|
+
const format = input.format ?? "html";
|
|
63
|
+
const now = (options.now?.() ?? new Date()).toISOString();
|
|
64
|
+
const id = randomBytes(16).toString("hex");
|
|
65
|
+
const folder = join(artifactsDir(options), id);
|
|
66
|
+
mkdirSync(folder, { recursive: true });
|
|
67
|
+
writeAtomic(join(folder, contentFile(format, 1)), input.content);
|
|
68
|
+
const meta = {
|
|
69
|
+
id,
|
|
70
|
+
title,
|
|
71
|
+
format,
|
|
72
|
+
display: input.display ?? "document",
|
|
73
|
+
owner: input.owner,
|
|
74
|
+
createdAt: now,
|
|
75
|
+
updatedAt: now,
|
|
76
|
+
version: 1,
|
|
77
|
+
versions: [{
|
|
78
|
+
version: 1,
|
|
79
|
+
createdAt: now,
|
|
80
|
+
bytes
|
|
81
|
+
}]
|
|
82
|
+
};
|
|
83
|
+
writeAtomic(join(folder, "meta.json"), `${JSON.stringify(meta, null, 2)}\n`);
|
|
84
|
+
return meta;
|
|
85
|
+
}
|
|
86
|
+
function updateArtifact(input, viewer, options = {}) {
|
|
87
|
+
const meta = readMeta(input.id, options);
|
|
88
|
+
if (!meta || !canSee(meta, viewer)) throw new ArtifactError(`There is no artifact ${input.id} here for this person.`);
|
|
89
|
+
const bytes = checkContent(input.content);
|
|
90
|
+
const now = (options.now?.() ?? new Date()).toISOString();
|
|
91
|
+
const version = meta.version + 1;
|
|
92
|
+
const folder = join(artifactsDir(options), meta.id);
|
|
93
|
+
writeAtomic(join(folder, contentFile(meta.format, version)), input.content);
|
|
94
|
+
const note = input.note?.replace(/\s+/g, " ").trim().slice(0, 200);
|
|
95
|
+
const next = {
|
|
96
|
+
...meta,
|
|
97
|
+
title: input.title ? cleanTitle(input.title) : meta.title,
|
|
98
|
+
display: input.display ?? meta.display,
|
|
99
|
+
updatedAt: now,
|
|
100
|
+
version,
|
|
101
|
+
versions: [...meta.versions, {
|
|
102
|
+
version,
|
|
103
|
+
createdAt: now,
|
|
104
|
+
bytes,
|
|
105
|
+
...note ? { note } : {}
|
|
106
|
+
}]
|
|
107
|
+
};
|
|
108
|
+
writeAtomic(join(folder, "meta.json"), `${JSON.stringify(next, null, 2)}\n`);
|
|
109
|
+
for (const old of next.versions.slice(0, -50)) rmSync(join(folder, contentFile(meta.format, old.version)), { force: true });
|
|
110
|
+
return next;
|
|
111
|
+
}
|
|
112
|
+
function listArtifacts(viewer, options = {}) {
|
|
113
|
+
const dir = artifactsDir(options);
|
|
114
|
+
if (!existsSync(dir)) return [];
|
|
115
|
+
const out = [];
|
|
116
|
+
for (const id of readdirSync(dir)) {
|
|
117
|
+
const meta = readMeta(id, options);
|
|
118
|
+
if (meta && canSee(meta, viewer)) out.push(meta);
|
|
119
|
+
}
|
|
120
|
+
return out.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
121
|
+
}
|
|
122
|
+
function readArtifact(id, viewer, version, options = {}) {
|
|
123
|
+
const meta = readMeta(id, options);
|
|
124
|
+
if (!meta || !canSee(meta, viewer)) return null;
|
|
125
|
+
const v = version ?? meta.version;
|
|
126
|
+
try {
|
|
127
|
+
return {
|
|
128
|
+
meta,
|
|
129
|
+
version: v,
|
|
130
|
+
content: readFileSync(join(artifactsDir(options), meta.id, contentFile(meta.format, v)), "utf8")
|
|
131
|
+
};
|
|
132
|
+
} catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function artifactCard(meta) {
|
|
137
|
+
return {
|
|
138
|
+
kyb: 1,
|
|
139
|
+
card: "artifact",
|
|
140
|
+
id: meta.id,
|
|
141
|
+
title: meta.title,
|
|
142
|
+
source: "Artifact",
|
|
143
|
+
data: {
|
|
144
|
+
artifactId: meta.id,
|
|
145
|
+
version: meta.version,
|
|
146
|
+
display: meta.display,
|
|
147
|
+
format: meta.format,
|
|
148
|
+
updatedAt: meta.updatedAt
|
|
149
|
+
},
|
|
150
|
+
actions: [{
|
|
151
|
+
label: "Open",
|
|
152
|
+
artifact: meta.id
|
|
153
|
+
}],
|
|
154
|
+
text: `${meta.title} (artifact, version ${meta.version}). Open it in KYBER Studio or the phone app, under this agent's Artifacts.`
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function summary(meta) {
|
|
158
|
+
return `${meta.id} v${meta.version} ${meta.format} ${meta.updatedAt.slice(0, 16).replace("T", " ")} ${meta.title}`;
|
|
159
|
+
}
|
|
160
|
+
export { readArtifact as a, viewerFromContext as c, listArtifacts as i, artifactCard as n, summary as o, createArtifact as r, updateArtifact as s, MAX_BYTES as t };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifacts: pages this agent makes for a person (a report, a dashboard, a
|
|
3
|
+
* tracker) that KYBER Studio and the phone draw inline as cards. They live on
|
|
4
|
+
* the agent's own machine and belong to the person who asked; the
|
|
5
|
+
* `@kybernesis/manage` routes serve them to that person's apps.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: import("eve/extension").NoConfigExtensionHandle;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { defineExtension } from "eve/extension";
|
|
8
|
+
var extension_default = defineExtension();
|
|
9
|
+
export { extension_default as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Artifacts
|
|
2
|
+
|
|
3
|
+
When the answer is something the person will look at more than once, or is too big for a chat reply, make an artifact instead of writing it out: a report, a dashboard, a tracker, a plan, a comparison, an explainer. A short answer stays a short answer in the chat.
|
|
4
|
+
|
|
5
|
+
- One artifact per thing. When the person asks for a change, update the same artifact; do not make a second one. Use list to find it again in a later conversation.
|
|
6
|
+
- HTML is one self-contained page. Put the CSS and any script inline and write the data into the page. Nothing outside the page loads: no external scripts, fonts, images or requests.
|
|
7
|
+
- Use plain, semantic HTML (headings, tables, lists, sections) so the app's own styles fit it. Keep colours to black, white and greys unless a chart needs to tell series apart.
|
|
8
|
+
- Use markdown for a plain document with no layout.
|
|
9
|
+
- Choose inline for something small that reads in the chat, like one chart or a short table, and document for anything longer.
|
|
10
|
+
- Never put passwords, card numbers or other secrets in an artifact.
|
|
11
|
+
- After making or changing one, say in a sentence or two what it shows. Do not paste its content into the reply.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ArtifactMeta } from "../../src/index.js";
|
|
2
|
+
/** A serverless deployment has no disk that outlives the request, so an artifact written there would vanish. */
|
|
3
|
+
export declare function requireDisk(): void;
|
|
4
|
+
interface SandboxReader {
|
|
5
|
+
getSandbox(): PromiseLike<{
|
|
6
|
+
readBinaryFile(input: {
|
|
7
|
+
path: string;
|
|
8
|
+
}): PromiseLike<Uint8Array | null | undefined>;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
/** The page, from the call itself or from a file in the sandbox. Exactly one of the two. */
|
|
12
|
+
export declare function contentFrom(input: {
|
|
13
|
+
content?: string;
|
|
14
|
+
path?: string;
|
|
15
|
+
}, ctx: SandboxReader): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* What the model sees after a create or update: enough to talk about it and
|
|
18
|
+
* change it later, never the card JSON. The reply still has to stand on its
|
|
19
|
+
* own, because chat channels that draw no cards only ever see the words.
|
|
20
|
+
*/
|
|
21
|
+
export declare function forModel(output: {
|
|
22
|
+
artifactId: string;
|
|
23
|
+
version: number;
|
|
24
|
+
title: string;
|
|
25
|
+
}, verb: string): {
|
|
26
|
+
type: "text";
|
|
27
|
+
value: string;
|
|
28
|
+
};
|
|
29
|
+
/** The full output of a create or update: the facts, and the card the apps draw. */
|
|
30
|
+
export declare function result(meta: ArtifactMeta): {
|
|
31
|
+
artifactId: string;
|
|
32
|
+
version: number;
|
|
33
|
+
title: string;
|
|
34
|
+
format: import("../../src/index.js").ArtifactFormat;
|
|
35
|
+
display: import("../../src/index.js").ArtifactDisplay;
|
|
36
|
+
kyb: import("../../src/index.js").ArtifactCard;
|
|
37
|
+
};
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { n as artifactCard, t as MAX_BYTES } from "../../_chunks/src-NHIAmKm9.mjs";
|
|
8
|
+
function requireDisk() {
|
|
9
|
+
if (process.env.VERCEL && !process.env.ARTIFACTS_DIR) throw new Error("Artifacts need a host with a disk that lasts; this deployment has none.");
|
|
10
|
+
}
|
|
11
|
+
async function contentFrom(input, ctx) {
|
|
12
|
+
if (input.content && input.path) throw new Error("Give content or path, not both.");
|
|
13
|
+
if (input.content) return input.content;
|
|
14
|
+
if (!input.path) throw new Error("Give the page as content, or the sandbox path of a file holding it.");
|
|
15
|
+
const bytes = await (await ctx.getSandbox()).readBinaryFile({ path: input.path });
|
|
16
|
+
if (!bytes) throw new Error(`No file found at ${input.path}; write it in the sandbox first.`);
|
|
17
|
+
if (bytes.byteLength > 2097152) throw new Error(`${input.path} is over the ${MAX_BYTES / 1024 / 1024} MB limit for an artifact.`);
|
|
18
|
+
return new TextDecoder().decode(bytes);
|
|
19
|
+
}
|
|
20
|
+
function forModel(output, verb) {
|
|
21
|
+
return {
|
|
22
|
+
type: "text",
|
|
23
|
+
value: `${verb} artifact "${output.title}" (id ${output.artifactId}, version ${output.version}). The person sees it as a card in KYBER Studio and the phone app, so do not paste its content into your reply. Say in a sentence or two what it shows. On a channel without cards, tell them it is under this agent's Artifacts in KYBER Studio.`
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function result(meta) {
|
|
27
|
+
return {
|
|
28
|
+
artifactId: meta.id,
|
|
29
|
+
version: meta.version,
|
|
30
|
+
title: meta.title,
|
|
31
|
+
format: meta.format,
|
|
32
|
+
display: meta.display,
|
|
33
|
+
kyb: artifactCard(meta)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export { contentFrom, forModel, requireDisk, result };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an artifact: a page for the person (a report, a dashboard, a tracker)
|
|
3
|
+
* that KYBER Studio and the phone draw as a card in the conversation.
|
|
4
|
+
*
|
|
5
|
+
* The full output carries the card under `kyb` for the apps, which read it
|
|
6
|
+
* from the `action.result` event; the model sees one line.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import("eve/tools").ToolDefinition<{
|
|
9
|
+
title: string;
|
|
10
|
+
content?: string | undefined;
|
|
11
|
+
path?: string | undefined;
|
|
12
|
+
format?: "html" | "markdown" | undefined;
|
|
13
|
+
display?: "document" | "inline" | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
artifactId: string;
|
|
16
|
+
version: number;
|
|
17
|
+
title: string;
|
|
18
|
+
format: import("../../src/index.js").ArtifactFormat;
|
|
19
|
+
display: import("../../src/index.js").ArtifactDisplay;
|
|
20
|
+
kyb: import("../../src/index.js").ArtifactCard;
|
|
21
|
+
}> & {
|
|
22
|
+
execute(input: {
|
|
23
|
+
title: string;
|
|
24
|
+
content?: string | undefined;
|
|
25
|
+
path?: string | undefined;
|
|
26
|
+
format?: "html" | "markdown" | undefined;
|
|
27
|
+
display?: "document" | "inline" | undefined;
|
|
28
|
+
}, ctx: import("eve/tools").ToolContext): Promise<{
|
|
29
|
+
artifactId: string;
|
|
30
|
+
version: number;
|
|
31
|
+
title: string;
|
|
32
|
+
format: import("../../src/index.js").ArtifactFormat;
|
|
33
|
+
display: import("../../src/index.js").ArtifactDisplay;
|
|
34
|
+
kyb: import("../../src/index.js").ArtifactCard;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { c as viewerFromContext, r as createArtifact } from "../../_chunks/src-NHIAmKm9.mjs";
|
|
8
|
+
import { contentFrom, forModel, requireDisk, result } from "../lib/shared.mjs";
|
|
9
|
+
import { defineTool } from "eve/tools";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
var create_default = defineTool({
|
|
12
|
+
description: "Make an artifact: a page the person keeps and comes back to, such as a report, a dashboard, a tracker, a plan or an explainer. It shows as a card in the person's KYBER Studio chat with an Open button. Give either `content` (the whole page) or `path` (a file in your sandbox). HTML is one self-contained file: inline CSS and script, data written into the page, no external scripts, fonts, images or network calls (they are blocked). To change an artifact later, use update with its id instead of making a new one.",
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
title: z.string().describe("A short name for the page, in the person's words, e.g. \"Website, last 7 days\"."),
|
|
15
|
+
content: z.string().optional().describe("The whole page: one HTML document, or markdown when format is markdown."),
|
|
16
|
+
path: z.string().optional().describe("Absolute sandbox path of a file holding the page, instead of content."),
|
|
17
|
+
format: z.enum(["html", "markdown"]).optional().describe("html (default) for anything with layout, charts or controls; markdown for a plain document."),
|
|
18
|
+
display: z.enum(["inline", "document"]).optional().describe("inline for something small that reads in the chat, such as one chart or a short table; document (default) for a full page opened on its own.")
|
|
19
|
+
}),
|
|
20
|
+
async execute({ title, content, path, format, display }, ctx) {
|
|
21
|
+
requireDisk();
|
|
22
|
+
const body = await contentFrom({
|
|
23
|
+
content,
|
|
24
|
+
path
|
|
25
|
+
}, ctx);
|
|
26
|
+
const meta = createArtifact({
|
|
27
|
+
title,
|
|
28
|
+
content: body,
|
|
29
|
+
format,
|
|
30
|
+
display,
|
|
31
|
+
owner: viewerFromContext(ctx).person
|
|
32
|
+
});
|
|
33
|
+
return result(meta);
|
|
34
|
+
},
|
|
35
|
+
toModelOutput: (output) => forModel(output, "Made")
|
|
36
|
+
});
|
|
37
|
+
export { create_default as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The artifacts this person can see, newest first. */
|
|
2
|
+
declare const _default: import("eve/tools").ToolDefinition<{
|
|
3
|
+
limit?: number | undefined;
|
|
4
|
+
}, string> & {
|
|
5
|
+
execute(input: {
|
|
6
|
+
limit?: number | undefined;
|
|
7
|
+
}, ctx: import("eve/tools").ToolContext): Promise<string>;
|
|
8
|
+
};
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { c as viewerFromContext, i as listArtifacts, o as summary } from "../../_chunks/src-NHIAmKm9.mjs";
|
|
8
|
+
import { defineTool } from "eve/tools";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var list_default = defineTool({
|
|
11
|
+
description: "List the artifacts you have made for this person, newest first: id, version, format, last change and title. Use it to find an artifact to change or reopen before making a new one.",
|
|
12
|
+
inputSchema: z.object({ limit: z.number().int().positive().max(200).optional().describe("How many at most. Defaults to 30.") }),
|
|
13
|
+
async execute({ limit }, ctx) {
|
|
14
|
+
const all = listArtifacts(viewerFromContext(ctx));
|
|
15
|
+
const shown = all.slice(0, limit ?? 30);
|
|
16
|
+
if (shown.length === 0) return "No artifacts yet for this person.";
|
|
17
|
+
const more = all.length > shown.length ? `\n(${all.length - shown.length} older not shown)` : "";
|
|
18
|
+
return `${shown.map(summary).join("\n")}${more}`;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
export { list_default as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The page behind an artifact, so the agent can edit it rather than rewrite it from memory. */
|
|
2
|
+
declare const _default: import("eve/tools").ToolDefinition<{
|
|
3
|
+
id: string;
|
|
4
|
+
version?: number | undefined;
|
|
5
|
+
}, string | {
|
|
6
|
+
artifactId: string;
|
|
7
|
+
title: string;
|
|
8
|
+
format: import("../../src/index.js").ArtifactFormat;
|
|
9
|
+
version: number;
|
|
10
|
+
latest: number;
|
|
11
|
+
content: string;
|
|
12
|
+
}> & {
|
|
13
|
+
execute(input: {
|
|
14
|
+
id: string;
|
|
15
|
+
version?: number | undefined;
|
|
16
|
+
}, ctx: import("eve/tools").ToolContext): Promise<string | {
|
|
17
|
+
artifactId: string;
|
|
18
|
+
title: string;
|
|
19
|
+
format: import("../../src/index.js").ArtifactFormat;
|
|
20
|
+
version: number;
|
|
21
|
+
latest: number;
|
|
22
|
+
content: string;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { a as readArtifact, c as viewerFromContext } from "../../_chunks/src-NHIAmKm9.mjs";
|
|
8
|
+
import { defineTool } from "eve/tools";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
var read_default = defineTool({
|
|
11
|
+
description: "Read an artifact's page (the latest version unless you name one), to change it with update or to answer questions about it.",
|
|
12
|
+
inputSchema: z.object({
|
|
13
|
+
id: z.string().describe("The artifact's id."),
|
|
14
|
+
version: z.number().int().positive().optional().describe("An earlier version number. Omit for the latest.")
|
|
15
|
+
}),
|
|
16
|
+
async execute({ id, version }, ctx) {
|
|
17
|
+
const found = readArtifact(id, viewerFromContext(ctx), version);
|
|
18
|
+
if (!found) return `There is no artifact ${id}${version ? ` version ${version}` : ""} here for this person.`;
|
|
19
|
+
return {
|
|
20
|
+
artifactId: found.meta.id,
|
|
21
|
+
title: found.meta.title,
|
|
22
|
+
format: found.meta.format,
|
|
23
|
+
version: found.version,
|
|
24
|
+
latest: found.meta.version,
|
|
25
|
+
content: found.content
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
export { read_default as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** A new version of an artifact, under the same id, so every card for it opens the latest. */
|
|
2
|
+
declare const _default: import("eve/tools").ToolDefinition<{
|
|
3
|
+
id: string;
|
|
4
|
+
content?: string | undefined;
|
|
5
|
+
path?: string | undefined;
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
display?: "document" | "inline" | undefined;
|
|
8
|
+
note?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
artifactId: string;
|
|
11
|
+
version: number;
|
|
12
|
+
title: string;
|
|
13
|
+
format: import("../../src/index.js").ArtifactFormat;
|
|
14
|
+
display: import("../../src/index.js").ArtifactDisplay;
|
|
15
|
+
kyb: import("../../src/index.js").ArtifactCard;
|
|
16
|
+
}> & {
|
|
17
|
+
execute(input: {
|
|
18
|
+
id: string;
|
|
19
|
+
content?: string | undefined;
|
|
20
|
+
path?: string | undefined;
|
|
21
|
+
title?: string | undefined;
|
|
22
|
+
display?: "document" | "inline" | undefined;
|
|
23
|
+
note?: string | undefined;
|
|
24
|
+
}, ctx: import("eve/tools").ToolContext): Promise<{
|
|
25
|
+
artifactId: string;
|
|
26
|
+
version: number;
|
|
27
|
+
title: string;
|
|
28
|
+
format: import("../../src/index.js").ArtifactFormat;
|
|
29
|
+
display: import("../../src/index.js").ArtifactDisplay;
|
|
30
|
+
kyb: import("../../src/index.js").ArtifactCard;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import { c as viewerFromContext, s as updateArtifact } from "../../_chunks/src-NHIAmKm9.mjs";
|
|
8
|
+
import { contentFrom, forModel, requireDisk, result } from "../lib/shared.mjs";
|
|
9
|
+
import { defineTool } from "eve/tools";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
var update_default = defineTool({
|
|
12
|
+
description: "Change an artifact you made: saves a new version under the same id, and every card for it in the chat opens the new version. Give the WHOLE new page as `content` or `path`, not a diff. Use read first when you need the current page to edit it.",
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
id: z.string().describe("The artifact's id, from create or list."),
|
|
15
|
+
content: z.string().optional().describe("The whole new page."),
|
|
16
|
+
path: z.string().optional().describe("Absolute sandbox path of a file holding the whole new page, instead of content."),
|
|
17
|
+
title: z.string().optional().describe("A new title, only when the old one no longer fits."),
|
|
18
|
+
display: z.enum(["inline", "document"]).optional().describe("Change how it shows in the chat."),
|
|
19
|
+
note: z.string().optional().describe("What changed, in a few words, e.g. \"added October\".")
|
|
20
|
+
}),
|
|
21
|
+
async execute({ id, content, path, title, display, note }, ctx) {
|
|
22
|
+
requireDisk();
|
|
23
|
+
const body = await contentFrom({
|
|
24
|
+
content,
|
|
25
|
+
path
|
|
26
|
+
}, ctx);
|
|
27
|
+
return result(updateArtifact({
|
|
28
|
+
id,
|
|
29
|
+
content: body,
|
|
30
|
+
title,
|
|
31
|
+
display,
|
|
32
|
+
note
|
|
33
|
+
}, viewerFromContext(ctx)));
|
|
34
|
+
},
|
|
35
|
+
toModelOutput: (output) => forModel(output, "Updated")
|
|
36
|
+
});
|
|
37
|
+
export { update_default as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifacts: pages the agent makes for a person (a report, a dashboard, a
|
|
3
|
+
* tracker) that KYBER Studio and the phone draw inline, and that live on the
|
|
4
|
+
* agent's own machine.
|
|
5
|
+
*
|
|
6
|
+
* The store is a directory, one folder per artifact:
|
|
7
|
+
*
|
|
8
|
+
* <dir>/<id>/meta.json what it is, who it belongs to, its versions
|
|
9
|
+
* <dir>/<id>/v<n>.html (or .md) the content of version n
|
|
10
|
+
*
|
|
11
|
+
* An update writes a new version under the same id, so a card posted three
|
|
12
|
+
* turns ago still opens the latest. `@kybernesis/manage` serves this directory
|
|
13
|
+
* read-only under /eve/v1/kyb/artifacts, scoped to the person who asked; the
|
|
14
|
+
* format is a contract between the two packages, so change both or neither.
|
|
15
|
+
*/
|
|
16
|
+
export type ArtifactFormat = "html" | "markdown";
|
|
17
|
+
export type ArtifactDisplay = "inline" | "document";
|
|
18
|
+
export interface ArtifactVersion {
|
|
19
|
+
version: number;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
bytes: number;
|
|
22
|
+
/** What changed, in the agent's words. Optional. */
|
|
23
|
+
note?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ArtifactMeta {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
format: ArtifactFormat;
|
|
29
|
+
display: ArtifactDisplay;
|
|
30
|
+
/** The person it belongs to (control-plane user id), or null when no signed-in person asked for it. */
|
|
31
|
+
owner: string | null;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
/** The latest version number. */
|
|
35
|
+
version: number;
|
|
36
|
+
versions: ArtifactVersion[];
|
|
37
|
+
}
|
|
38
|
+
export interface StoreOptions {
|
|
39
|
+
/** Where artifacts live. Defaults to ARTIFACTS_DIR, then ~/.kybernesis/artifacts. */
|
|
40
|
+
dir?: string;
|
|
41
|
+
/** Clock, for tests. */
|
|
42
|
+
now?: () => Date;
|
|
43
|
+
}
|
|
44
|
+
/** 16 random bytes as lowercase hex, the same shape as a delivered file's id. */
|
|
45
|
+
export declare const ARTIFACT_ID: RegExp;
|
|
46
|
+
/** Largest content one version may hold. */
|
|
47
|
+
export declare const MAX_BYTES: number;
|
|
48
|
+
/** Versions kept per artifact; older content files are removed, their history lines stay. */
|
|
49
|
+
export declare const KEEP_VERSIONS = 50;
|
|
50
|
+
export declare const MAX_TITLE = 120;
|
|
51
|
+
export declare function artifactsDir(options?: StoreOptions): string;
|
|
52
|
+
export declare function contentFile(format: ArtifactFormat, version: number): string;
|
|
53
|
+
/** The shape of eve's tool context this package reads. Structural, so the package has no opinion about the rest. */
|
|
54
|
+
export interface PrincipalContext {
|
|
55
|
+
readonly session?: {
|
|
56
|
+
readonly auth?: {
|
|
57
|
+
readonly current?: {
|
|
58
|
+
readonly principalId?: string;
|
|
59
|
+
readonly authenticator?: string;
|
|
60
|
+
readonly principalType?: string;
|
|
61
|
+
readonly attributes?: Readonly<Record<string, unknown>>;
|
|
62
|
+
} | null;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export interface Viewer {
|
|
67
|
+
/** The person, or null when the turn has no signed-in person (a routine, local dev). */
|
|
68
|
+
person: string | null;
|
|
69
|
+
/** Whether they may change this agent; such a person also sees artifacts nobody owns. */
|
|
70
|
+
manages: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Who this turn is for. Default-deny: only a principal the control plane
|
|
74
|
+
* itself authenticated as a user counts as a person. eve's local-dev, app and
|
|
75
|
+
* channel-default principals are nobody, so what they make belongs to nobody.
|
|
76
|
+
*/
|
|
77
|
+
export declare function viewerFromContext(ctx: PrincipalContext): Viewer;
|
|
78
|
+
/**
|
|
79
|
+
* Whether a viewer may see an artifact. An owned artifact is its owner's
|
|
80
|
+
* alone. One nobody owns (made by a routine, say) is visible to the people who
|
|
81
|
+
* manage the agent, and to a turn with no person, which is the agent itself.
|
|
82
|
+
*/
|
|
83
|
+
export declare function canSee(meta: Pick<ArtifactMeta, "owner">, viewer: Viewer): boolean;
|
|
84
|
+
export declare class ArtifactError extends Error {
|
|
85
|
+
}
|
|
86
|
+
export declare function readMeta(id: string, options?: StoreOptions): ArtifactMeta | null;
|
|
87
|
+
export interface CreateInput {
|
|
88
|
+
title: string;
|
|
89
|
+
content: string;
|
|
90
|
+
format?: ArtifactFormat;
|
|
91
|
+
display?: ArtifactDisplay;
|
|
92
|
+
owner: string | null;
|
|
93
|
+
}
|
|
94
|
+
export declare function createArtifact(input: CreateInput, options?: StoreOptions): ArtifactMeta;
|
|
95
|
+
export interface UpdateInput {
|
|
96
|
+
id: string;
|
|
97
|
+
content: string;
|
|
98
|
+
title?: string;
|
|
99
|
+
display?: ArtifactDisplay;
|
|
100
|
+
note?: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A new version of an artifact the viewer can see. The format stays what it
|
|
104
|
+
* was: a card already drawn as HTML should not turn into markdown under it.
|
|
105
|
+
*/
|
|
106
|
+
export declare function updateArtifact(input: UpdateInput, viewer: Viewer, options?: StoreOptions): ArtifactMeta;
|
|
107
|
+
/** The artifacts a viewer can see, newest first. */
|
|
108
|
+
export declare function listArtifacts(viewer: Viewer, options?: StoreOptions): ArtifactMeta[];
|
|
109
|
+
/** The content of one version (the latest by default), or null when it is not there or not the viewer's. */
|
|
110
|
+
export declare function readArtifact(id: string, viewer: Viewer, version?: number, options?: StoreOptions): {
|
|
111
|
+
meta: ArtifactMeta;
|
|
112
|
+
version: number;
|
|
113
|
+
content: string;
|
|
114
|
+
} | null;
|
|
115
|
+
/**
|
|
116
|
+
* The card KYBER Studio and the phone draw for an artifact, in the shared card
|
|
117
|
+
* envelope (the same shape `@kybernesis/cards` defines). The id is the
|
|
118
|
+
* artifact's, so a card for version 3 replaces the card for version 2 in place.
|
|
119
|
+
* `text` is what a surface that draws no cards shows instead.
|
|
120
|
+
*/
|
|
121
|
+
export interface ArtifactCard {
|
|
122
|
+
kyb: 1;
|
|
123
|
+
card: "artifact";
|
|
124
|
+
id: string;
|
|
125
|
+
title: string;
|
|
126
|
+
source: "Artifact";
|
|
127
|
+
data: {
|
|
128
|
+
artifactId: string;
|
|
129
|
+
version: number;
|
|
130
|
+
display: ArtifactDisplay;
|
|
131
|
+
format: ArtifactFormat;
|
|
132
|
+
updatedAt: string;
|
|
133
|
+
};
|
|
134
|
+
actions: Array<{
|
|
135
|
+
label: string;
|
|
136
|
+
artifact: string;
|
|
137
|
+
}>;
|
|
138
|
+
text: string;
|
|
139
|
+
}
|
|
140
|
+
export declare function artifactCard(meta: ArtifactMeta): ArtifactCard;
|
|
141
|
+
/** One line per artifact, for the model. */
|
|
142
|
+
export declare function summary(meta: ArtifactMeta): string;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
/** 16 random bytes as lowercase hex, the same shape as a delivered file's id. */
|
|
6
|
+
export const ARTIFACT_ID = /^[0-9a-f]{32}$/;
|
|
7
|
+
/** Largest content one version may hold. */
|
|
8
|
+
export const MAX_BYTES = 2 * 1024 * 1024;
|
|
9
|
+
/** Versions kept per artifact; older content files are removed, their history lines stay. */
|
|
10
|
+
export const KEEP_VERSIONS = 50;
|
|
11
|
+
export const MAX_TITLE = 120;
|
|
12
|
+
export function artifactsDir(options = {}) {
|
|
13
|
+
return options.dir ?? process.env.ARTIFACTS_DIR ?? join(homedir(), ".kybernesis", "artifacts");
|
|
14
|
+
}
|
|
15
|
+
export function contentFile(format, version) {
|
|
16
|
+
return `v${version}.${format === "markdown" ? "md" : "html"}`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Who this turn is for. Default-deny: only a principal the control plane
|
|
20
|
+
* itself authenticated as a user counts as a person. eve's local-dev, app and
|
|
21
|
+
* channel-default principals are nobody, so what they make belongs to nobody.
|
|
22
|
+
*/
|
|
23
|
+
export function viewerFromContext(ctx) {
|
|
24
|
+
const current = ctx.session?.auth?.current;
|
|
25
|
+
if (!current?.principalId || current.authenticator !== "kybernesis" || current.principalType !== "user") {
|
|
26
|
+
return { person: null, manages: false };
|
|
27
|
+
}
|
|
28
|
+
return { person: current.principalId, manages: current.attributes?.agentGrantLevel === "manage" };
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Whether a viewer may see an artifact. An owned artifact is its owner's
|
|
32
|
+
* alone. One nobody owns (made by a routine, say) is visible to the people who
|
|
33
|
+
* manage the agent, and to a turn with no person, which is the agent itself.
|
|
34
|
+
*/
|
|
35
|
+
export function canSee(meta, viewer) {
|
|
36
|
+
if (meta.owner)
|
|
37
|
+
return meta.owner === viewer.person;
|
|
38
|
+
return viewer.person === null || viewer.manages;
|
|
39
|
+
}
|
|
40
|
+
export class ArtifactError extends Error {
|
|
41
|
+
}
|
|
42
|
+
function cleanTitle(title) {
|
|
43
|
+
const t = title.replace(/\s+/g, " ").trim();
|
|
44
|
+
if (!t)
|
|
45
|
+
throw new ArtifactError("An artifact needs a title.");
|
|
46
|
+
return t.length > MAX_TITLE ? `${t.slice(0, MAX_TITLE - 1)}…` : t;
|
|
47
|
+
}
|
|
48
|
+
function checkContent(content) {
|
|
49
|
+
const bytes = Buffer.byteLength(content, "utf8");
|
|
50
|
+
if (bytes === 0)
|
|
51
|
+
throw new ArtifactError("The artifact is empty.");
|
|
52
|
+
if (bytes > MAX_BYTES) {
|
|
53
|
+
throw new ArtifactError(`The artifact is ${Math.round(bytes / 1024)} KB; the limit is ${MAX_BYTES / 1024 / 1024} MB. Trim the data or split it.`);
|
|
54
|
+
}
|
|
55
|
+
return bytes;
|
|
56
|
+
}
|
|
57
|
+
/** Write via a temporary file and a rename, so a reader never sees half a file. */
|
|
58
|
+
function writeAtomic(path, data) {
|
|
59
|
+
const tmp = `${path}.${randomBytes(4).toString("hex")}.tmp`;
|
|
60
|
+
writeFileSync(tmp, data);
|
|
61
|
+
renameSync(tmp, path);
|
|
62
|
+
}
|
|
63
|
+
export function readMeta(id, options = {}) {
|
|
64
|
+
if (!ARTIFACT_ID.test(id))
|
|
65
|
+
return null;
|
|
66
|
+
try {
|
|
67
|
+
return JSON.parse(readFileSync(join(artifactsDir(options), id, "meta.json"), "utf8"));
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export function createArtifact(input, options = {}) {
|
|
74
|
+
const title = cleanTitle(input.title);
|
|
75
|
+
const bytes = checkContent(input.content);
|
|
76
|
+
const format = input.format ?? "html";
|
|
77
|
+
const now = (options.now?.() ?? new Date()).toISOString();
|
|
78
|
+
const id = randomBytes(16).toString("hex");
|
|
79
|
+
const folder = join(artifactsDir(options), id);
|
|
80
|
+
mkdirSync(folder, { recursive: true });
|
|
81
|
+
writeAtomic(join(folder, contentFile(format, 1)), input.content);
|
|
82
|
+
const meta = {
|
|
83
|
+
id,
|
|
84
|
+
title,
|
|
85
|
+
format,
|
|
86
|
+
display: input.display ?? "document",
|
|
87
|
+
owner: input.owner,
|
|
88
|
+
createdAt: now,
|
|
89
|
+
updatedAt: now,
|
|
90
|
+
version: 1,
|
|
91
|
+
versions: [{ version: 1, createdAt: now, bytes }],
|
|
92
|
+
};
|
|
93
|
+
writeAtomic(join(folder, "meta.json"), `${JSON.stringify(meta, null, 2)}\n`);
|
|
94
|
+
return meta;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A new version of an artifact the viewer can see. The format stays what it
|
|
98
|
+
* was: a card already drawn as HTML should not turn into markdown under it.
|
|
99
|
+
*/
|
|
100
|
+
export function updateArtifact(input, viewer, options = {}) {
|
|
101
|
+
const meta = readMeta(input.id, options);
|
|
102
|
+
if (!meta || !canSee(meta, viewer))
|
|
103
|
+
throw new ArtifactError(`There is no artifact ${input.id} here for this person.`);
|
|
104
|
+
const bytes = checkContent(input.content);
|
|
105
|
+
const now = (options.now?.() ?? new Date()).toISOString();
|
|
106
|
+
const version = meta.version + 1;
|
|
107
|
+
const folder = join(artifactsDir(options), meta.id);
|
|
108
|
+
writeAtomic(join(folder, contentFile(meta.format, version)), input.content);
|
|
109
|
+
const note = input.note?.replace(/\s+/g, " ").trim().slice(0, 200);
|
|
110
|
+
const next = {
|
|
111
|
+
...meta,
|
|
112
|
+
title: input.title ? cleanTitle(input.title) : meta.title,
|
|
113
|
+
display: input.display ?? meta.display,
|
|
114
|
+
updatedAt: now,
|
|
115
|
+
version,
|
|
116
|
+
versions: [...meta.versions, { version, createdAt: now, bytes, ...(note ? { note } : {}) }],
|
|
117
|
+
};
|
|
118
|
+
writeAtomic(join(folder, "meta.json"), `${JSON.stringify(next, null, 2)}\n`);
|
|
119
|
+
for (const old of next.versions.slice(0, -KEEP_VERSIONS)) {
|
|
120
|
+
rmSync(join(folder, contentFile(meta.format, old.version)), { force: true });
|
|
121
|
+
}
|
|
122
|
+
return next;
|
|
123
|
+
}
|
|
124
|
+
/** The artifacts a viewer can see, newest first. */
|
|
125
|
+
export function listArtifacts(viewer, options = {}) {
|
|
126
|
+
const dir = artifactsDir(options);
|
|
127
|
+
if (!existsSync(dir))
|
|
128
|
+
return [];
|
|
129
|
+
const out = [];
|
|
130
|
+
for (const id of readdirSync(dir)) {
|
|
131
|
+
const meta = readMeta(id, options);
|
|
132
|
+
if (meta && canSee(meta, viewer))
|
|
133
|
+
out.push(meta);
|
|
134
|
+
}
|
|
135
|
+
return out.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
136
|
+
}
|
|
137
|
+
/** The content of one version (the latest by default), or null when it is not there or not the viewer's. */
|
|
138
|
+
export function readArtifact(id, viewer, version, options = {}) {
|
|
139
|
+
const meta = readMeta(id, options);
|
|
140
|
+
if (!meta || !canSee(meta, viewer))
|
|
141
|
+
return null;
|
|
142
|
+
const v = version ?? meta.version;
|
|
143
|
+
try {
|
|
144
|
+
const content = readFileSync(join(artifactsDir(options), meta.id, contentFile(meta.format, v)), "utf8");
|
|
145
|
+
return { meta, version: v, content };
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
export function artifactCard(meta) {
|
|
152
|
+
return {
|
|
153
|
+
kyb: 1,
|
|
154
|
+
card: "artifact",
|
|
155
|
+
id: meta.id,
|
|
156
|
+
title: meta.title,
|
|
157
|
+
source: "Artifact",
|
|
158
|
+
data: {
|
|
159
|
+
artifactId: meta.id,
|
|
160
|
+
version: meta.version,
|
|
161
|
+
display: meta.display,
|
|
162
|
+
format: meta.format,
|
|
163
|
+
updatedAt: meta.updatedAt,
|
|
164
|
+
},
|
|
165
|
+
actions: [{ label: "Open", artifact: meta.id }],
|
|
166
|
+
text: `${meta.title} (artifact, version ${meta.version}). Open it in KYBER Studio or the phone app, under this agent's Artifacts.`,
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/** One line per artifact, for the model. */
|
|
170
|
+
export function summary(meta) {
|
|
171
|
+
return `${meta.id} v${meta.version} ${meta.format} ${meta.updatedAt.slice(0, 16).replace("T", " ")} ${meta.title}`;
|
|
172
|
+
}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import extension_default from "./extension/extension.mjs";
|
|
8
|
+
export { extension_default as artifacts, extension_default as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Generated by eve. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
export { default as create } from "../extension/tools/create.js";
|
|
4
|
+
export { default as list } from "../extension/tools/list.js";
|
|
5
|
+
export { default as read } from "../extension/tools/read.js";
|
|
6
|
+
export { default as update } from "../extension/tools/update.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import create_default from "../extension/tools/create.mjs";
|
|
8
|
+
import list_default from "../extension/tools/list.mjs";
|
|
9
|
+
import read_default from "../extension/tools/read.mjs";
|
|
10
|
+
import update_default from "../extension/tools/update.mjs";
|
|
11
|
+
export { create_default as create, list_default as list, read_default as read, update_default as update };
|
package/package.json
CHANGED
|
@@ -1,6 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kybernesis/artifacts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Artifacts for eve agents: pages an agent makes for a person (reports, dashboards, trackers) that KYBER Studio and the phone draw inline, stored on the agent's own machine.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"homepage": "https://kybernesis.ai",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/KybernesisAI/platform.git",
|
|
11
|
+
"directory": "packages/artifacts"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"eve",
|
|
15
|
+
"kybernesis",
|
|
16
|
+
"artifacts",
|
|
17
|
+
"agent"
|
|
18
|
+
],
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json",
|
|
25
|
+
"./store": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./extension": {
|
|
30
|
+
"types": "./dist/extension/extension.d.ts",
|
|
31
|
+
"default": "./dist/extension/extension.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./tools": {
|
|
34
|
+
"types": "./dist/tools/index.d.ts",
|
|
35
|
+
"default": "./dist/tools/index.mjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"NOTICE"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "eve extension build && tsc -p tsconfig.build.json",
|
|
44
|
+
"prepack": "eve extension build && tsc -p tsconfig.build.json",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"prepublishOnly": "node ../../scripts/prepublish.mjs",
|
|
47
|
+
"test": "node --test \"test/**/*.test.mjs\""
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"zod": "4.4.3"
|
|
51
|
+
},
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"eve": ">=0.81.1 <0.82.0"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/node": "24.x",
|
|
57
|
+
"eve": "0.81.1",
|
|
58
|
+
"typescript": "7.0.2"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=20"
|
|
65
|
+
},
|
|
66
|
+
"eve": {
|
|
67
|
+
"extension": {
|
|
68
|
+
"source": "./extension",
|
|
69
|
+
"dist": "./dist/extension"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|