agentcert 0.2.3 → 0.2.4

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 CHANGED
@@ -46,9 +46,11 @@ in one command. By default, both commands also upload local files referenced by
46
46
  the bundle. Reads are confined to `--artifact-root` (the current directory by
47
47
  default), path and symlink escapes are rejected, and uploads are capped at 25
48
48
  files, 10 MiB per file, and 50 MiB total. Skipped references are reported in
49
- the CLI and hosted run timeline. Pass `--no-artifacts` to upload only the JSON
50
- bundle. Project API keys can create runs, record events, and upload evidence,
51
- but cannot approve their own runtime actions.
49
+ the CLI and hosted run timeline. Companion uploads are restricted to
50
+ PNG/JPEG/WebP, JSON/JSONL, HTML, PDF, and ZIP; other extensions are skipped
51
+ before they are read. Pass `--no-artifacts` to upload only the JSON bundle.
52
+ Project API keys can create runs, record events, and upload evidence, but
53
+ cannot approve their own runtime actions.
52
54
 
53
55
  Review/export helpers:
54
56
 
@@ -19,6 +19,11 @@ export async function collectCompanionArtifacts(bundle, artifactRoot, limits = D
19
19
  skipped.push(skip(entry, "remote_url"));
20
20
  continue;
21
21
  }
22
+ const descriptor = describeArtifact(entry.sourcePath);
23
+ if (!descriptor) {
24
+ skipped.push(skip(entry, "unsupported_type", "accepted formats: PNG, JPEG, WebP, JSON, JSONL, HTML, PDF, ZIP"));
25
+ continue;
26
+ }
22
27
  if (artifacts.length >= limits.maxFiles) {
23
28
  skipped.push(skip(entry, "file_limit", `maximum ${limits.maxFiles} files`));
24
29
  continue;
@@ -90,7 +95,6 @@ export async function collectCompanionArtifacts(bundle, artifactRoot, limits = D
90
95
  skipped.push(skip(entry, reason));
91
96
  continue;
92
97
  }
93
- const descriptor = describeArtifact(entry.sourcePath);
94
98
  artifacts.push({
95
99
  sourcePath: normalizeSourcePath(entry.sourcePath),
96
100
  fileName: basename(resolvedPath),
@@ -140,31 +144,17 @@ function describeArtifact(path) {
140
144
  const imageType = extension === ".jpg" ? "jpeg" : extension.slice(1);
141
145
  return { kind: "screenshot", contentType: `image/${imageType}` };
142
146
  }
143
- if (extension === ".svg")
144
- return { kind: "report", contentType: "image/svg+xml" };
145
- if (extension === ".zip" || lower.includes("trace")) {
146
- const contentType = extension === ".zip" ? "application/zip" : extension === ".json" ? "application/json" : "application/octet-stream";
147
- return { kind: "trace", contentType };
148
- }
149
- if ([".html", ".htm"].includes(extension) || lower.includes("dom")) {
150
- const contentType = [".html", ".htm"].includes(extension)
151
- ? "text/html; charset=utf-8"
152
- : extension === ".json"
153
- ? "application/json"
154
- : "application/octet-stream";
155
- return { kind: "dom", contentType };
156
- }
147
+ if (extension === ".zip")
148
+ return { kind: "trace", contentType: "application/zip" };
149
+ if ([".html", ".htm"].includes(extension))
150
+ return { kind: "dom", contentType: "text/html; charset=utf-8" };
157
151
  if (extension === ".json")
158
- return { kind: "json", contentType: "application/json" };
152
+ return { kind: lower.includes("trace") ? "trace" : lower.includes("dom") ? "dom" : "json", contentType: "application/json" };
159
153
  if (extension === ".jsonl")
160
- return { kind: "json", contentType: "application/x-ndjson" };
154
+ return { kind: lower.includes("trace") ? "trace" : "json", contentType: "application/x-ndjson" };
161
155
  if (extension === ".pdf")
162
156
  return { kind: "report", contentType: "application/pdf" };
163
- if (extension === ".md")
164
- return { kind: "report", contentType: "text/markdown; charset=utf-8" };
165
- if (extension === ".txt")
166
- return { kind: "artifact", contentType: "text/plain; charset=utf-8" };
167
- return { kind: "artifact", contentType: "application/octet-stream" };
157
+ return undefined;
168
158
  }
169
159
  function normalizeSourcePath(path) {
170
160
  return path.replace(/\\/g, "/").slice(0, 1024);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentcert",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Assurance release gates, runtime evidence, and regression CI for AI agents.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",