@artis-lab/cli 0.15.0 → 0.17.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/README.md +10 -7
- package/package.json +2 -3
- package/src/bin.js +6 -5
- package/src/lib/app.js +6 -5
- package/src/lib/chunk-4O5BCFCD.js +60 -0
- package/src/lib/{chunk-43EXTJSU.js → chunk-FSJVBXCW.js} +3 -31
- package/src/lib/chunk-I5P3FLKO.js +929 -0
- package/src/lib/{chunk-VBJGJXYL.js → chunk-P4O6TXMP.js} +16 -20
- package/src/lib/{chunk-VLYS5R67.js → chunk-T24DNA2K.js} +1 -1
- package/src/lib/{chunk-JPCT7RRK.js → chunk-XTAKEL34.js} +58 -17
- package/src/lib/cli.js +3 -3
- package/src/lib/commands.js +5 -4
- package/src/lib/files.js +2 -1
- package/src/lib/verify.js +2 -3
- package/src/lib/chunk-QZFIUZXT.js +0 -10954
package/README.md
CHANGED
|
@@ -89,13 +89,16 @@ violations. It exits 8 when it finds any. It needs the optional
|
|
|
89
89
|
10 MB and no browser binaries) and a
|
|
90
90
|
Chromium-based browser; set `ARTIS_CHROME_PATH` to use a specific one.
|
|
91
91
|
|
|
92
|
-
A slide deck is a directory of files,
|
|
93
|
-
`artis verify --root deck --type slides` (a published
|
|
94
|
-
names its type).
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
92
|
+
A slide deck, or the source of any installed Type, is a directory of files,
|
|
93
|
+
checked as its type: `artis verify --root deck --type slides` (a published
|
|
94
|
+
revision already names its type). The CLI bundles no Type: it reads the
|
|
95
|
+
Type's package (entry page, runtime and format check) from the server
|
|
96
|
+
`artis login` signed in to. It first runs the format check, in the browser
|
|
97
|
+
with the network off, and lists each issue with its level, rule, file and
|
|
98
|
+
line: errors exit 8, hints are reported only. It then serves the files at the
|
|
99
|
+
paths Artis serves them at, with the entry page, runtime and the Google Fonts
|
|
100
|
+
CSP the Type gets, in light and dark themes, adds the issues the runtime
|
|
101
|
+
prints, and for a deck reports every slide whose content runs past its
|
|
99
102
|
1920×1080 (4:3: 1440×1080) canvas. The server never runs these checks, so
|
|
100
103
|
run `verify` before every publish and revise.
|
|
101
104
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artis-lab/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Agent-first CLI for creating, sharing and maintaining artifacts on Artis, an open-source, self-hostable place for what AI agents build.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@artis/api-contract": "0.0.1",
|
|
50
50
|
"@artis/sdk": "0.0.1",
|
|
51
|
-
"@artis/slides-format": "0.0.1"
|
|
52
|
-
"@artis/types-slides": "0.0.1"
|
|
51
|
+
"@artis/slides-format": "0.0.1"
|
|
53
52
|
}
|
|
54
53
|
}
|
package/src/bin.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
runAgentCli
|
|
4
|
-
} from "./lib/chunk-
|
|
5
|
-
import "./lib/chunk-
|
|
6
|
-
import "./lib/chunk-
|
|
4
|
+
} from "./lib/chunk-T24DNA2K.js";
|
|
5
|
+
import "./lib/chunk-P4O6TXMP.js";
|
|
6
|
+
import "./lib/chunk-I5P3FLKO.js";
|
|
7
|
+
import "./lib/chunk-XTAKEL34.js";
|
|
7
8
|
import "./lib/chunk-43WVFZLO.js";
|
|
8
9
|
import "./lib/chunk-JYMG2Y6C.js";
|
|
9
10
|
import "./lib/chunk-2LRPXCLL.js";
|
|
10
|
-
import "./lib/chunk-QZFIUZXT.js";
|
|
11
11
|
import "./lib/chunk-IZYFOV2K.js";
|
|
12
12
|
import "./lib/chunk-46DMRA3V.js";
|
|
13
|
-
import "./lib/chunk-
|
|
13
|
+
import "./lib/chunk-FSJVBXCW.js";
|
|
14
|
+
import "./lib/chunk-4O5BCFCD.js";
|
|
14
15
|
import "./lib/chunk-IKQ5U3DH.js";
|
|
15
16
|
import {
|
|
16
17
|
exitCodeFor
|
package/src/lib/app.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentCli
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-T24DNA2K.js";
|
|
4
|
+
import "./chunk-P4O6TXMP.js";
|
|
5
|
+
import "./chunk-I5P3FLKO.js";
|
|
6
|
+
import "./chunk-XTAKEL34.js";
|
|
6
7
|
import "./chunk-43WVFZLO.js";
|
|
7
8
|
import "./chunk-JYMG2Y6C.js";
|
|
8
9
|
import "./chunk-2LRPXCLL.js";
|
|
9
|
-
import "./chunk-QZFIUZXT.js";
|
|
10
10
|
import "./chunk-IZYFOV2K.js";
|
|
11
11
|
import "./chunk-46DMRA3V.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FSJVBXCW.js";
|
|
13
|
+
import "./chunk-4O5BCFCD.js";
|
|
13
14
|
import "./chunk-IKQ5U3DH.js";
|
|
14
15
|
import "./chunk-HUWOFEEU.js";
|
|
15
16
|
export {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// packages/sdk/src/lib/artifact-types.ts
|
|
2
|
+
var TYPE_PACKAGE_NAME_PATTERN = /^(?!html$)[a-z][a-z0-9-]{0,39}$/;
|
|
3
|
+
function isTypePackageName(value) {
|
|
4
|
+
return typeof value === "string" && TYPE_PACKAGE_NAME_PATTERN.test(value);
|
|
5
|
+
}
|
|
6
|
+
function typeSourceIssuePrefix(type) {
|
|
7
|
+
return `[artis:${type}] `;
|
|
8
|
+
}
|
|
9
|
+
function parseTypeSourceIssueLine(type, text) {
|
|
10
|
+
const prefix = typeSourceIssuePrefix(type);
|
|
11
|
+
if (!text.startsWith(prefix)) return void 0;
|
|
12
|
+
try {
|
|
13
|
+
return toTypeSourceIssue(JSON.parse(text.slice(prefix.length)));
|
|
14
|
+
} catch {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function toTypeSourceIssue(value) {
|
|
19
|
+
if (!isPlainObject(value)) return void 0;
|
|
20
|
+
const { severity, code, message } = value;
|
|
21
|
+
if (severity !== "error" && severity !== "hint" || typeof code !== "string" || typeof message !== "string") {
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
const issue = { severity, code, message };
|
|
25
|
+
if (typeof value["path"] === "string") issue.path = value["path"];
|
|
26
|
+
if (Number.isInteger(value["line"])) issue.line = value["line"];
|
|
27
|
+
if (Number.isInteger(value["column"])) {
|
|
28
|
+
issue.column = value["column"];
|
|
29
|
+
}
|
|
30
|
+
if (typeof value["example"] === "string") issue.example = value["example"];
|
|
31
|
+
return issue;
|
|
32
|
+
}
|
|
33
|
+
var PACKAGE_PATH_PATTERN = /^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/;
|
|
34
|
+
function isPackagePath(value) {
|
|
35
|
+
return typeof value === "string" && value.length <= 256 && PACKAGE_PATH_PATTERN.test(value);
|
|
36
|
+
}
|
|
37
|
+
function isPlainObject(value) {
|
|
38
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39
|
+
}
|
|
40
|
+
var artifactFileLimits = {
|
|
41
|
+
/** Files in one revision. */
|
|
42
|
+
files: 1e3,
|
|
43
|
+
/** UTF-8 bytes in one file. */
|
|
44
|
+
fileBytes: 2 * 1024 * 1024,
|
|
45
|
+
/** UTF-8 bytes in all the files one request sends. */
|
|
46
|
+
requestBytes: 16 * 1024 * 1024,
|
|
47
|
+
/** Characters in one path. */
|
|
48
|
+
pathLength: 256
|
|
49
|
+
};
|
|
50
|
+
function isArtifactFilePath(value) {
|
|
51
|
+
return typeof value === "string" && value.length <= artifactFileLimits.pathLength && isPackagePath(value) && !value.split("/").some((segment) => segment.startsWith("."));
|
|
52
|
+
}
|
|
53
|
+
var utf8 = new TextEncoder();
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
isTypePackageName,
|
|
57
|
+
parseTypeSourceIssueLine,
|
|
58
|
+
toTypeSourceIssue,
|
|
59
|
+
isArtifactFilePath
|
|
60
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isArtifactFilePath
|
|
3
|
+
} from "./chunk-4O5BCFCD.js";
|
|
1
4
|
import {
|
|
2
5
|
usageError
|
|
3
6
|
} from "./chunk-HUWOFEEU.js";
|
|
@@ -6,37 +9,6 @@ import {
|
|
|
6
9
|
import { createHash } from "node:crypto";
|
|
7
10
|
import { mkdir, readdir, readFile, writeFile } from "node:fs/promises";
|
|
8
11
|
import path from "node:path";
|
|
9
|
-
|
|
10
|
-
// packages/sdk/src/lib/artifact-types.ts
|
|
11
|
-
var artifactTypeRegistry = {
|
|
12
|
-
slides: {}
|
|
13
|
-
};
|
|
14
|
-
var HTML_TYPE = "html";
|
|
15
|
-
var typePackageNames = Object.keys(artifactTypeRegistry);
|
|
16
|
-
var artifactTypeNames = [
|
|
17
|
-
HTML_TYPE,
|
|
18
|
-
...typePackageNames
|
|
19
|
-
];
|
|
20
|
-
var PACKAGE_PATH_PATTERN = /^(?!.*(?:^|\/)\.{1,2}(?:\/|$))[A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*$/;
|
|
21
|
-
function isPackagePath(value) {
|
|
22
|
-
return typeof value === "string" && value.length <= 256 && PACKAGE_PATH_PATTERN.test(value);
|
|
23
|
-
}
|
|
24
|
-
var artifactFileLimits = {
|
|
25
|
-
/** Files in one revision. */
|
|
26
|
-
files: 1e3,
|
|
27
|
-
/** UTF-8 bytes in one file. */
|
|
28
|
-
fileBytes: 2 * 1024 * 1024,
|
|
29
|
-
/** UTF-8 bytes in all the files one request sends. */
|
|
30
|
-
requestBytes: 16 * 1024 * 1024,
|
|
31
|
-
/** Characters in one path. */
|
|
32
|
-
pathLength: 256
|
|
33
|
-
};
|
|
34
|
-
function isArtifactFilePath(value) {
|
|
35
|
-
return typeof value === "string" && value.length <= artifactFileLimits.pathLength && isPackagePath(value) && !value.split("/").some((segment) => segment.startsWith("."));
|
|
36
|
-
}
|
|
37
|
-
var utf8 = new TextEncoder();
|
|
38
|
-
|
|
39
|
-
// packages/cli/src/lib/files.ts
|
|
40
12
|
function isSkipped(name) {
|
|
41
13
|
return name.startsWith(".") || name === "node_modules";
|
|
42
14
|
}
|