@agentims/runtime 0.9.3 → 0.9.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.
@@ -0,0 +1,4 @@
1
+ /** Identify the native program explicitly on public metadata and artifact requests. */
2
+ export declare const clientRequestHeaders: {
3
+ readonly "User-Agent": "AgentIM-Client/1.0 (+https://agentims.shipkitx.com/agentim/SKILL.md)";
4
+ };
@@ -0,0 +1,4 @@
1
+ /** Identify the native program explicitly on public metadata and artifact requests. */
2
+ export const clientRequestHeaders = {
3
+ "User-Agent": "AgentIM-Client/1.0 (+https://agentims.shipkitx.com/agentim/SKILL.md)",
4
+ };
@@ -1,4 +1,5 @@
1
1
  import { assertRuntimeNode } from "./node-version.js";
2
+ import { clientRequestHeaders } from "./http.js";
2
3
  export function origin(value) {
3
4
  const url = new URL(value);
4
5
  if (url.username || url.password || url.search || url.hash || url.pathname !== "/" ||
@@ -15,7 +16,7 @@ export async function serviceOrigin(homeserver, siteUrl) {
15
16
  if (!siteUrl)
16
17
  throw new Error("Set a homeserver or site URL");
17
18
  const site = origin(siteUrl);
18
- const response = await fetch(`${site}/agentim/manifest.json`, { redirect: "error", credentials: "omit", cache: "no-store", signal: AbortSignal.timeout(10000) });
19
+ const response = await fetch(`${site}/agentim/manifest.json`, { headers: clientRequestHeaders, redirect: "error", credentials: "omit", cache: "no-store", signal: AbortSignal.timeout(10000) });
19
20
  if (!response.ok || Number(response.headers.get("content-length") ?? 0) > 8192)
20
21
  throw new Error("AgentIM site discovery failed");
21
22
  const reader = response.body?.getReader();
@@ -3,6 +3,7 @@ import { join } from "node:path";
3
3
  import { readFile } from "node:fs/promises";
4
4
  import { parseAgentIMJSON, sdkInfo } from "@agentims/sdk";
5
5
  import { privateText } from "../configuration/private-state.js";
6
+ import { clientRequestHeaders } from "../configuration/http.js";
6
7
  import { updateLease } from "./locking.js";
7
8
  import { packageVersion, platformPackages, safeURL, verifyRelease } from "./manifest.js";
8
9
  import { readUpdatePolicy, updateDocument } from "./policy.js";
@@ -16,7 +17,7 @@ export async function runtimePackageInfo() {
16
17
  }
17
18
  export async function boundedJSON(url, maxBytes = 196608) {
18
19
  safeURL(url);
19
- const response = await fetch(url, { redirect: "error", credentials: "omit", cache: "no-store", signal: AbortSignal.timeout(15000) });
20
+ const response = await fetch(url, { headers: clientRequestHeaders, redirect: "error", credentials: "omit", cache: "no-store", signal: AbortSignal.timeout(15000) });
20
21
  if (!response.ok || !response.body)
21
22
  throw new UpdateError("UPDATE_SOURCE_UNAVAILABLE", "Client update source is unavailable");
22
23
  const reader = response.body.getReader();
@@ -2,6 +2,7 @@ import { createHash, randomBytes } from "node:crypto";
2
2
  import { open, rename, unlink } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import { directory, assertPrivateDirectory } from "../configuration/private-state.js";
5
+ import { clientRequestHeaders } from "../configuration/http.js";
5
6
  import { safeURL } from "./manifest.js";
6
7
  import { fileDigest } from "./archive.js";
7
8
  import { UpdateError } from "./types.js";
@@ -28,7 +29,7 @@ export async function downloadArtifact(item, policy) {
28
29
  const handle = await open(temporary, "wx", 0o600);
29
30
  let complete = false;
30
31
  try {
31
- const response = await fetch(item.url, { redirect: "error", credentials: "omit", signal: AbortSignal.timeout(300000) });
32
+ const response = await fetch(item.url, { headers: clientRequestHeaders, redirect: "error", credentials: "omit", signal: AbortSignal.timeout(300000) });
32
33
  if (!response.ok || !response.body)
33
34
  throw new UpdateError("UPDATE_DOWNLOAD_FAILED", "Client artifact download failed");
34
35
  const reader = response.body.getReader(), hash = createHash("sha256");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentims/runtime",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=24.22.2 <25"
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@agentims/sdk": "0.8.2",
24
24
  "@agentims/adapter": "0.1.5",
25
- "@agentims/runtime-assets": "0.9.3"
25
+ "@agentims/runtime-assets": "0.9.4"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public",