@5ss/ai-tools 3.0.3 → 3.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/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to `@5ss/ai-tools` are documented here.
4
4
 
5
5
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Releases are cut by [semantic-release](https://semantic-release.gitbook.io/) from [conventional commits](https://www.conventionalcommits.org/).
6
6
 
7
+ ## [3.1.0](https://github.com/five-star-solutions-co/ai-tools/compare/v3.0.3...v3.1.0) (2026-08-24)
8
+
7
9
  ## [3.0.3](https://github.com/five-star-solutions-co/ai-tools/compare/v3.0.2...v3.0.3) (2026-08-21)
8
10
 
9
11
  ## [3.0.2](https://github.com/five-star-solutions-co/ai-tools/compare/v3.0.1...v3.0.2) (2026-08-12)
@@ -70,8 +70,6 @@ declare const artifactsReadLinesInputSchema: z.ZodObject<{
70
70
  filename: z.ZodOptional<z.ZodString>;
71
71
  byte_length: z.ZodOptional<z.ZodInt>;
72
72
  }, z.core.$strip>;
73
- start_line: z.ZodInt;
74
- end_line: z.ZodInt;
75
73
  }, z.core.$strip>;
76
74
  declare const artifactsReadLinesOutputSchema: z.ZodObject<{
77
75
  source: z.ZodObject<{
@@ -276,8 +274,6 @@ declare const artifactsReadLinesTool: ToolDefinition<{
276
274
  filename?: string | undefined;
277
275
  byte_length?: number | undefined;
278
276
  };
279
- start_line: number;
280
- end_line: number;
281
277
  }, {
282
278
  source: {
283
279
  store: "host" | "object";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/modules/artifacts/contracts.ts","../../../src/modules/artifacts/client.ts","../../../src/modules/artifacts/module.ts","../../../src/modules/artifacts/providers/host.ts","../../../src/modules/artifacts/providers/object.ts"],"mappings":";;;;;cAWa;cACA;cACA;cAEA,4BAA0B,EAAA;;;;;;;;;GAMrC,EAAA,KAAA;cAEW,6BAA2B,EAAA;;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AO,0BAA0B,QAAQ;EAKnD,UAAU,OAAO,0BAA0B,QAAQ;EAKnD,QAAQ,OAAO,uBAAuB,QAAQ;;;;KC/BzC,iCAAiC,KAAK;cAyBrC,mCAAmC;;EAG/C,YAAY,MAAM,qBAAqB,UAAS;EAI1C,OAAO,OAAO,uBAAuB,QAAQ;EAe7C,UAAU,OAAO,0BAA0B,QAAQ;EAgBnD,UAAU,OAAO,0BAA0B,QAAQ;EAoBnD,QAAQ,OAAO,uBAAuB,QAAQ"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/modules/artifacts/contracts.ts","../../../src/modules/artifacts/client.ts","../../../src/modules/artifacts/module.ts","../../../src/modules/artifacts/providers/host.ts","../../../src/modules/artifacts/providers/object.ts"],"mappings":";;;;;cAWa;cACA;cACA;cAEA,4BAA0B,EAAA;;;;;;;;;GAMrC,EAAA,KAAA;cAEW,6BAA2B,EAAA;;;;;;;;;;;GAEtC,EAAA,KAAA;cAEW,+BAA6B,EAAA;;;;;;;;;;;;;GAsBvC,EAAA,KAAA;cAEU,gCAA8B,EAAA;;;;;;;;;;;;;;;;GAOzC,EAAA,KAAA;cAEW,+BAA6B,EAAA;;;;;;;;;;;GAExC,EAAA,KAAA;cAEW,gCAA8B,EAAA;;;;;;;;;;;;;;;GAMzC,EAAA,KAAA;cAEW,4BAA0B,EAAA;;;;;;;;;;;;GAGrC,EAAA,KAAA;cAEW,wBAAsB,EAAA;;;;;;;;;;;;GAGjC,EAAA,KAAA;KAEU,uBAAuB,EAAE,aAAa;KACtC,wBAAwB,EAAE,aAAa;KACvC,0BAA0B,EAAE,aAAa;KACzC,2BAA2B,EAAE,aAAa;KAC1C,0BAA0B,EAAE,aAAa;KACzC,2BAA2B,EAAE,aAAa;KAC1C,uBAAuB,EAAE,aAAa;KACtC,mBAAmB,EAAE,aAAa;KAElC;EACX,OAAO,OAAO,uBAAuB,QAAQ;EAC7C,UAAU,OAAO,0BAA0B,QAAQ;EACnD,UAAU,OAAO,0B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AAE,aAAa;KAC/B,sBAAsB,EAAE,aAAa;KACrC,oBAAoB,EAAE,aAAa;;;cC/FlC,2BAA2B;;EAGvC,YAAY,KAAK;SAIV,YAAY,KAAK,cAAc;SAK/B,SAAS,MAAM,eAAe,MAAK,cAAmB;EAI7D,OAAO,OAAO,uBAAoB;;;;;;;;;EAIlC,UAAU,OAAO,0BAAuB;;;;;;;;;;;;;;EAIxC,UAAU,OAAO,0BAAuB;;;;;;;;;;;;;EAIlC,QAAQ,OAAO,uBAAuB,QAAQ;;;;cChDxC,qBAAA;;;;;;;;;;;;;;;cAYA,wBAAA;;;;;;;;;;;;;;;;;;;;;;;;cAYA,wBAAA;;;;;;;;;;;;;;;;;;;;;cAWA;;;;;;;;;;;;;;oBAAA;;;;;;;;cCnBA,iCAAiC;;EAG7C,YAAY,MAAM;EAIZ,OAAO,OAAO,uBAAuB,QAAQ;EAM7C,UAAU,OAAO,0BAA0B,QAAQ;EAKnD,UAAU,OAAO,0BAA0B,QAAQ;EAKnD,QAAQ,OAAO,uBAAuB,QAAQ;;;;KC/BzC,iCAAiC,KAAK;cAyBrC,mCAAmC;;EAG/C,YAAY,MAAM,qBAAqB,UAAS;EAI1C,OAAO,OAAO,uBAAuB,QAAQ;EAe7C,UAAU,OAAO,0BAA0B,QAAQ;EAgBnD,UAAU,OAAO,0BAA0B,QAAQ;EAanD,QAAQ,OAAO,uBAAuB,QAAQ"}
@@ -9,7 +9,7 @@ import { isFunction } from "es-toolkit";
9
9
  import { z } from "zod";
10
10
  //#region src/modules/artifacts/contracts.ts
11
11
  /**
12
- * ArtifactRef creation and bounded read contracts.
12
+ * ArtifactRef creation and read contracts.
13
13
  * Host-mapped and object-store backends share the same model-facing verbs.
14
14
  */
15
15
  const MAX_ARTIFACT_READ_BYTES = MAX_OBJECT_BYTES;
@@ -48,17 +48,10 @@ const artifactsReadRangeOutputSchema = z.object({
48
48
  total_bytes: z.int().min(0).optional(),
49
49
  media_type: z.string().optional()
50
50
  });
51
- const artifactsReadLinesInputSchema = z.object({
52
- source: artifactRefSchema.describe("UTF-8 text artifact to read"),
53
- start_line: z.int().min(1).describe("Inclusive one-based start line"),
54
- end_line: z.int().min(1).describe("Inclusive one-based end line")
55
- }).refine((input) => input.end_line >= input.start_line, {
56
- path: ["end_line"],
57
- message: "end_line must be greater than or equal to start_line"
58
- });
51
+ const artifactsReadLinesInputSchema = z.object({ source: artifactRefSchema.describe("UTF-8 text artifact to read") });
59
52
  const artifactsReadLinesOutputSchema = z.object({
60
53
  source: artifactRefSchema,
61
- text: z.string().describe("Selected UTF-8 lines"),
54
+ text: z.string().describe("Complete UTF-8 text content"),
62
55
  start_line: z.int().min(1),
63
56
  end_line: z.int().min(1),
64
57
  total_lines: z.int().min(0)
@@ -193,19 +186,11 @@ var ObjectArtifactsProvider = class {
193
186
  async readLines(input) {
194
187
  requireObjectSource(input.source.store);
195
188
  const lines = textLines(bytesToUtf8(await this.#storage.getBytes(input.source.key, { maxBytes: MAX_ARTIFACT_READ_BYTES })));
196
- if (input.start_line > lines.length) throw new ToolError("start_line is beyond the end of the artifact", {
197
- code: "bad_input",
198
- details: {
199
- start_line: input.start_line,
200
- total_lines: lines.length
201
- }
202
- });
203
- const selected = lines.slice(input.start_line - 1, input.end_line);
204
189
  return {
205
190
  source: input.source,
206
- text: selected.join("\n"),
207
- start_line: input.start_line,
208
- end_line: input.start_line + selected.length - 1,
191
+ text: lines.join("\n"),
192
+ start_line: 1,
193
+ end_line: lines.length,
209
194
  total_lines: lines.length
210
195
  };
211
196
  }
@@ -317,7 +302,7 @@ const artifactsReadRangeTool = defineTool({
317
302
  const artifactsReadLinesTool = defineTool({
318
303
  id: "artifacts-read-lines",
319
304
  name: "readArtifactLines",
320
- description: "Read an explicit inclusive line range from a UTF-8 text artifact. Use for bounded inspection instead of loading the whole file into context.",
305
+ description: "Read the complete contents of a UTF-8 text artifact, bounded by the artifact read-size limit.",
321
306
  inputSchema: artifactsReadLinesInputSchema,
322
307
  outputSchema: artifactsReadLinesOutputSchema,
323
308
  sideEffect: "read",
@@ -327,7 +312,7 @@ const artifactsReadLinesTool = defineTool({
327
312
  const artifactsModule = defineModule({
328
313
  id: "artifacts",
329
314
  title: "Artifacts",
330
- description: "Persist small serialized content and inspect bounded byte or text ranges. ArtifactRef is the handoff between tools; structured document creation belongs to purpose-built builders.",
315
+ description: "Persist small serialized content, inspect bounded byte ranges, and read UTF-8 text artifacts. ArtifactRef is the handoff between tools; structured document creation belongs to purpose-built builders.",
331
316
  runtime: "both",
332
317
  auth: {
333
318
  type: "custom",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["#backend","#storage","#ops"],"sources":["../../../src/modules/artifacts/contracts.ts","../../../src/modules/artifacts/providers/host.ts","../../../src/modules/artifacts/providers/object.ts","../../../src/modules/artifacts/client.ts","../../../src/modules/artifacts/module.ts"],"sourcesContent":["/**\n * ArtifactRef creation and bounded read contracts.\n * Host-mapped and object-store backends share the same model-facing verbs.\n */\n\nimport { isFunction } from 'es-toolkit'\nimport { z } from 'zod'\n\nimport { artifactRefSchema } from '../../shared/artifact'\nimport { MAX_OBJECT_BYTES, s3AuthSchema } from '../../vendors/s3'\n\nexport const MAX_ARTIFACT_READ_BYTES = MAX_OBJECT_BYTES\nexport const MAX_ARTIFACT_CREATE_BYTES = MAX_OBJECT_BYTES\nexport const MAX_ARTIFACT_INLINE_CHARS = Math.ceil((MAX_ARTIFACT_CREATE_BYTES * 4) / 3) + 4\n\nexport const artifactsCreateInputSchema = z.object({\n\tkey: z.string().min(1).max(1_024).describe('Destination key for the new artifact'),\n\tbody: z.string().max(MAX_ARTIFACT_INLINE_CHARS).describe('Artifact body encoded as specified by encoding'),\n\tencoding: z.enum(['utf8', 'base64']).describe('How body is encoded'),\n\tmedia_type: z.string().min(1).max(200).optional().describe('MIME type when known'),\n\tfilename: z.string().min(1).max(512).optional().describe('Display filename when different from the key')\n})\n\nexport const artifactsCreateOutputSchema = z.object({\n\tartifact: artifactRefSchema.describe('Reference to the created artifact')\n})\n\nexport const artifactsReadRangeInputSchema = z\n\t.object({\n\t\tsource: artifactRefSchema.describe('Artifact to read'),\n\t\tstart_byte: z.int().min(0).describe('Inclusive zero-based start byte'),\n\t\tend_byte: z.int().min(0).describe('Inclusive zero-based end byte')\n\t})\n\t.superRefine((input, ctx) => {\n\t\tconst byteLength = input.end_byte - input.start_byte + 1\n\t\tif (byteLength < 1) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: 'custom',\n\t\t\t\tpath: ['end_byte'],\n\t\t\t\tmessage: 'end_byte must be greater than or equal to start_byte'\n\t\t\t})\n\t\t}\n\t\tif (byteLength > MAX_ARTIFACT_READ_BYTES) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: 'custom',\n\t\t\t\tpath: ['end_byte'],\n\t\t\t\tmessage: `Byte range cannot exceed ${MAX_ARTIFACT_READ_BYTES} bytes`\n\t\t\t})\n\t\t}\n\t})\n\nexport const artifactsReadRangeOutputSchema = z.object({\n\tsource: artifactRefSchema,\n\tbody_base64: z.string().describe('Requested bytes encoded as base64'),\n\tstart_byte: z.int().min(0),\n\tend_byte: z.int().min(0),\n\ttotal_bytes: z.int().min(0).optional(),\n\tmedia_type: z.string().optional()\n})\n\nexport const artifactsReadLinesInputSchema = z\n\t.object({\n\t\tsource: artifactRefSchema.describe('UTF-8 text artifact to read'),\n\t\tstart_line: z.int().min(1).describe('Inclusive one-based start line'),\n\t\tend_line: z.int().min(1).describe('Inclusive one-based end line')\n\t})\n\t.refine((input) => input.end_line >= input.start_line, {\n\t\tpath: ['end_line'],\n\t\tmessage: 'end_line must be greater than or equal to start_line'\n\t})\n\nexport const artifactsReadLinesOutputSchema = z.object({\n\tsource: artifactRefSchema,\n\ttext: z.string().describe('Selected UTF-8 lines'),\n\tstart_line: z.int().min(1),\n\tend_line: z.int().min(1),\n\ttotal_lines: z.int().min(0)\n})\n\nexport const artifactResolveInputSchema = z.object({\n\tsource: artifactRefSchema,\n\tmax_bytes: z.int().min(0)\n})\n\nexport const resolvedArtifactSchema = z.object({\n\tartifact: artifactRefSchema,\n\tbytes: z.custom<Uint8Array>((value) => value instanceof Uint8Array, 'bytes must be a Uint8Array')\n})\n\nexport type ArtifactsCreateInput = z.infer<typeof artifactsCreateInputSchema>\nexport type ArtifactsCreateOutput = z.infer<typeof artifactsCreateOutputSchema>\nexport type ArtifactsReadRangeInput = z.infer<typeof artifactsReadRangeInputSchema>\nexport type ArtifactsReadRangeOutput = z.infer<typeof artifactsReadRangeOutputSchema>\nexport type ArtifactsReadLinesInput = z.infer<typeof artifactsReadLinesInputSchema>\nexport type ArtifactsReadLinesOutput = z.infer<typeof artifactsReadLinesOutputSchema>\nexport type ArtifactResolveInput = z.infer<typeof artifactResolveInputSchema>\nexport type ResolvedArtifact = z.infer<typeof resolvedArtifactSchema>\n\nexport type ArtifactsOps = {\n\tcreate(input: ArtifactsCreateInput): Promise<ArtifactsCreateOutput>\n\treadRange(input: ArtifactsReadRangeInput): Promise<ArtifactsReadRangeOutput>\n\treadLines(input: ArtifactsReadLinesInput): Promise<ArtifactsReadLinesOutput>\n}\n\nexport type ArtifactResolverOps = {\n\tresolve(input: ArtifactResolveInput): Promise<ResolvedArtifact>\n}\n\nexport type ArtifactsClientOps = ArtifactsOps & ArtifactResolverOps\n\nexport const artifactsBackendSchema = z.object({\n\tcreate: z.custom<ArtifactsOps['create']>(isFunction, 'create must be a function'),\n\treadRange: z.custom<ArtifactsOps['readRange']>(isFunction, 'readRange must be a function'),\n\treadLines: z.custom<ArtifactsOps['readLines']>(isFunction, 'readLines must be a function'),\n\tresolve: z.custom<ArtifactResolverOps['resolve']>(isFunction, 'resolve must be a function').optional()\n})\n\nexport const objectArtifactsAuthSchema = z.object({\n\tprovider: z.literal('object'),\n\tstorage: s3AuthSchema.describe('S3-compatible object storage for ArtifactRef bytes')\n})\n\nexport const hostArtifactsAuthSchema = z.object({\n\tprovider: z.literal('host'),\n\tbackend: artifactsBackendSchema.describe('Host artifact operations for host-mapped ArtifactRefs')\n})\n\nexport const artifactsAuthSchema = z.discriminatedUnion('provider', [\n\tobjectArtifactsAuthSchema,\n\thostArtifactsAuthSchema\n])\n\nexport type ArtifactsAuth = z.infer<typeof artifactsAuthSchema>\nexport type ObjectArtifactsAuth = z.infer<typeof objectArtifactsAuthSchema>\nexport type HostArtifactsAuth = z.infer<typeof hostArtifactsAuthSchema>\n","import { ToolError } from '../../../core/errors'\nimport type {\n\tArtifactResolveInput,\n\tArtifactsClientOps,\n\tArtifactsCreateInput,\n\tArtifactsCreateOutput,\n\tArtifactsReadLinesInput,\n\tArtifactsReadLinesOutput,\n\tArtifactsReadRangeInput,\n\tArtifactsReadRangeOutput,\n\tHostArtifactsAuth,\n\tResolvedArtifact\n} from '../contracts'\nimport {\n\tartifactsCreateOutputSchema,\n\tartifactsReadLinesOutputSchema,\n\tartifactsReadRangeOutputSchema,\n\tresolvedArtifactSchema\n} from '../contracts'\n\nfunction requireHostStore(store: 'object' | 'host'): void {\n\tif (store !== 'host') {\n\t\tthrow new ToolError('The host artifact provider only resolves host-mapped references', {\n\t\t\tcode: 'unsupported'\n\t\t})\n\t}\n}\n\nexport class HostArtifactsProvider implements ArtifactsClientOps {\n\treadonly #backend: HostArtifactsAuth['backend']\n\n\tconstructor(auth: HostArtifactsAuth) {\n\t\tthis.#backend = auth.backend\n\t}\n\n\tasync create(input: ArtifactsCreateInput): Promise<ArtifactsCreateOutput> {\n\t\tconst output = artifactsCreateOutputSchema.parse(await this.#backend.create(input))\n\t\trequireHostStore(output.artifact.store)\n\t\treturn output\n\t}\n\n\tasync readRange(input: ArtifactsReadRangeInput): Promise<ArtifactsReadRangeOutput> {\n\t\trequireHostStore(input.source.store)\n\t\treturn artifactsReadRangeOutputSchema.parse(await this.#backend.readRange(input))\n\t}\n\n\tasync readLines(input: ArtifactsReadLinesInput): Promise<ArtifactsReadLinesOutput> {\n\t\trequireHostStore(input.source.store)\n\t\treturn artifactsReadLinesOutputSchema.parse(await this.#backend.readLines(input))\n\t}\n\n\tasync resolve(input: ArtifactResolveInput): Promise<ResolvedArtifact> {\n\t\trequireHostStore(input.source.store)\n\t\tif (input.source.byte_length !== undefined && input.source.byte_length > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: input.source.byte_length }\n\t\t\t})\n\t\t}\n\t\tif (!this.#backend.resolve) {\n\t\t\tthrow new ToolError('The host artifact backend does not support byte resolution', {\n\t\t\t\tcode: 'unsupported'\n\t\t\t})\n\t\t}\n\n\t\tconst output = resolvedArtifactSchema.parse(await this.#backend.resolve(input))\n\t\trequireHostStore(output.artifact.store)\n\t\tif (output.artifact.key !== input.source.key) {\n\t\t\tthrow new ToolError('The host artifact backend resolved a different artifact', {\n\t\t\t\tcode: 'internal'\n\t\t\t})\n\t\t}\n\t\tif (output.bytes.byteLength > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: output.bytes.byteLength }\n\t\t\t})\n\t\t}\n\t\treturn {\n\t\t\tartifact: {\n\t\t\t\t...input.source,\n\t\t\t\t...output.artifact,\n\t\t\t\tbyte_length: output.bytes.byteLength\n\t\t\t},\n\t\t\tbytes: output.bytes\n\t\t}\n\t}\n}\n","import { ToolError } from '../../../core/errors'\nimport { artifactRefSchema } from '../../../shared/artifact'\nimport { base64ToBytes, bytesToBase64, bytesToUtf8, utf8ToBytes } from '../../../shared/bytes'\nimport { mediaTypeFromPath } from '../../../shared/content-type'\nimport type { HttpServiceOptions } from '../../../transport/http-service'\nimport { S3Client } from '../../../vendors/s3'\nimport type {\n\tArtifactResolveInput,\n\tArtifactsClientOps,\n\tArtifactsCreateInput,\n\tArtifactsCreateOutput,\n\tArtifactsReadLinesInput,\n\tArtifactsReadLinesOutput,\n\tArtifactsReadRangeInput,\n\tArtifactsReadRangeOutput,\n\tObjectArtifactsAuth,\n\tResolvedArtifact\n} from '../contracts'\nimport { MAX_ARTIFACT_CREATE_BYTES, MAX_ARTIFACT_READ_BYTES } from '../contracts'\n\nexport type ObjectArtifactsProviderOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nfunction requireObjectSource(store: 'object' | 'host'): void {\n\tif (store !== 'object') {\n\t\tthrow new ToolError('The object artifact provider only resolves object-store references', {\n\t\t\tcode: 'unsupported'\n\t\t})\n\t}\n}\n\nfunction artifactBytes(input: ArtifactsCreateInput): Uint8Array {\n\tconst bytes = input.encoding === 'base64' ? base64ToBytes(input.body) : utf8ToBytes(input.body)\n\tif (bytes.byteLength > MAX_ARTIFACT_CREATE_BYTES) {\n\t\tthrow new ToolError('Artifact body exceeds create limit', {\n\t\t\tcode: 'too_large',\n\t\t\tdetails: { max_bytes: MAX_ARTIFACT_CREATE_BYTES, content_length: bytes.byteLength }\n\t\t})\n\t}\n\treturn bytes\n}\n\nfunction textLines(text: string): string[] {\n\treturn text.split('\\n').map((line) => (line.endsWith('\\r') ? line.slice(0, -1) : line))\n}\n\nexport class ObjectArtifactsProvider implements ArtifactsClientOps {\n\treadonly #storage: S3Client\n\n\tconstructor(auth: ObjectArtifactsAuth, options: ObjectArtifactsProviderOptions = {}) {\n\t\tthis.#storage = new S3Client(auth.storage, options)\n\t}\n\n\tasync create(input: ArtifactsCreateInput): Promise<ArtifactsCreateOutput> {\n\t\tconst bytes = artifactBytes(input)\n\t\tconst mediaType = input.media_type ?? mediaTypeFromPath(input.filename ?? input.key)\n\t\tawait this.#storage.putBytes(input.key, bytes, mediaType)\n\t\treturn {\n\t\t\tartifact: artifactRefSchema.parse({\n\t\t\t\tstore: 'object',\n\t\t\t\tkey: input.key,\n\t\t\t\tbyte_length: bytes.byteLength,\n\t\t\t\t...(mediaType && { media_type: mediaType }),\n\t\t\t\t...(input.filename && { filename: input.filename })\n\t\t\t})\n\t\t}\n\t}\n\n\tasync readRange(input: ArtifactsReadRangeInput): Promise<ArtifactsReadRangeOutput> {\n\t\trequireObjectSource(input.source.store)\n\t\tconst result = await this.#storage.getBytesRange(input.source.key, {\n\t\t\tstart_byte: input.start_byte,\n\t\t\tend_byte: input.end_byte\n\t\t})\n\t\treturn {\n\t\t\tsource: input.source,\n\t\t\tbody_base64: bytesToBase64(result.bytes),\n\t\t\tstart_byte: result.start_byte,\n\t\t\tend_byte: result.end_byte,\n\t\t\t...(result.total_bytes !== undefined && { total_bytes: result.total_bytes }),\n\t\t\t...(result.content_type && { media_type: result.content_type })\n\t\t}\n\t}\n\n\tasync readLines(input: ArtifactsReadLinesInput): Promise<ArtifactsReadLinesOutput> {\n\t\trequireObjectSource(input.source.store)\n\t\tconst bytes = await this.#storage.getBytes(input.source.key, { maxBytes: MAX_ARTIFACT_READ_BYTES })\n\t\tconst lines = textLines(bytesToUtf8(bytes))\n\t\tif (input.start_line > lines.length) {\n\t\t\tthrow new ToolError('start_line is beyond the end of the artifact', {\n\t\t\t\tcode: 'bad_input',\n\t\t\t\tdetails: { start_line: input.start_line, total_lines: lines.length }\n\t\t\t})\n\t\t}\n\t\tconst selected = lines.slice(input.start_line - 1, input.end_line)\n\t\treturn {\n\t\t\tsource: input.source,\n\t\t\ttext: selected.join('\\n'),\n\t\t\tstart_line: input.start_line,\n\t\t\tend_line: input.start_line + selected.length - 1,\n\t\t\ttotal_lines: lines.length\n\t\t}\n\t}\n\n\tasync resolve(input: ArtifactResolveInput): Promise<ResolvedArtifact> {\n\t\trequireObjectSource(input.source.store)\n\t\tif (input.source.byte_length !== undefined && input.source.byte_length > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: input.source.byte_length }\n\t\t\t})\n\t\t}\n\n\t\tconst head = await this.#storage.head({ key: input.source.key })\n\t\tif (!head.exists) {\n\t\t\tthrow new ToolError('Artifact not found', { code: 'not_found' })\n\t\t}\n\t\tif (head.content_length !== undefined && head.content_length > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: head.content_length }\n\t\t\t})\n\t\t}\n\n\t\tconst bytes = await this.#storage.getBytes(input.source.key, { maxBytes: input.max_bytes })\n\t\treturn {\n\t\t\tartifact: artifactRefSchema.parse({\n\t\t\t\t...input.source,\n\t\t\t\t...(!input.source.media_type && head.content_type && { media_type: head.content_type }),\n\t\t\t\tbyte_length: bytes.byteLength\n\t\t\t}),\n\t\t\tbytes\n\t\t}\n\t}\n}\n","import { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport type {\n\tArtifactResolveInput,\n\tArtifactsAuth,\n\tArtifactsClientOps,\n\tArtifactsCreateInput,\n\tArtifactsReadLinesInput,\n\tArtifactsReadRangeInput,\n\tResolvedArtifact\n} from './contracts'\nimport { artifactResolveInputSchema, artifactsAuthSchema, resolvedArtifactSchema } from './contracts'\nimport { HostArtifactsProvider } from './providers/host'\nimport { ObjectArtifactsProvider } from './providers/object'\n\nfunction transportOptions(ctx: ToolContext) {\n\treturn {\n\t\t...(ctx.fetch && { fetch: ctx.fetch }),\n\t\t...(ctx.signal && { signal: ctx.signal })\n\t}\n}\n\nfunction providerFor(auth: ArtifactsAuth, ctx: ToolContext): ArtifactsClientOps {\n\tswitch (auth.provider) {\n\t\tcase 'object':\n\t\t\treturn new ObjectArtifactsProvider(auth, transportOptions(ctx))\n\t\tcase 'host':\n\t\t\treturn new HostArtifactsProvider(auth)\n\t}\n}\n\nexport class ArtifactsClient implements ArtifactsClientOps {\n\treadonly #ops: ArtifactsClientOps\n\n\tconstructor(ops: ArtifactsClientOps) {\n\t\tthis.#ops = ops\n\t}\n\n\tstatic fromContext(ctx: ToolContext): ArtifactsClient {\n\t\tconst auth = requireAuth(ctx, artifactsAuthSchema)\n\t\treturn new ArtifactsClient(providerFor(auth, ctx))\n\t}\n\n\tstatic fromAuth(auth: ArtifactsAuth, ctx: ToolContext = {}): ArtifactsClient {\n\t\treturn new ArtifactsClient(providerFor(auth, ctx))\n\t}\n\n\tcreate(input: ArtifactsCreateInput) {\n\t\treturn this.#ops.create(input)\n\t}\n\n\treadRange(input: ArtifactsReadRangeInput) {\n\t\treturn this.#ops.readRange(input)\n\t}\n\n\treadLines(input: ArtifactsReadLinesInput) {\n\t\treturn this.#ops.readLines(input)\n\t}\n\n\tasync resolve(input: ArtifactResolveInput): Promise<ResolvedArtifact> {\n\t\tconst parsedInput = artifactResolveInputSchema.parse(input)\n\t\tconst output = resolvedArtifactSchema.parse(await this.#ops.resolve(parsedInput))\n\t\tif (output.bytes.byteLength > parsedInput.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: parsedInput.max_bytes, content_length: output.bytes.byteLength }\n\t\t\t})\n\t\t}\n\t\treturn {\n\t\t\tartifact: {\n\t\t\t\t...output.artifact,\n\t\t\t\tbyte_length: output.bytes.byteLength\n\t\t\t},\n\t\t\tbytes: output.bytes\n\t\t}\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { ArtifactsClient } from './client'\nimport {\n\tartifactsAuthSchema,\n\tartifactsCreateInputSchema,\n\tartifactsCreateOutputSchema,\n\tartifactsReadLinesInputSchema,\n\tartifactsReadLinesOutputSchema,\n\tartifactsReadRangeInputSchema,\n\tartifactsReadRangeOutputSchema\n} from './contracts'\n\nexport const artifactsCreateTool = defineTool({\n\tid: 'artifacts-create',\n\tname: 'createArtifact',\n\tdescription:\n\t\t'Persist small, already-serialized UTF-8 or base64 content and return its ArtifactRef. Use for raw bytes or text when no structured builder is required. Do not use this to invent DOCX, XLSX, PPTX, PDF, or image formats.',\n\tinputSchema: artifactsCreateInputSchema,\n\toutputSchema: artifactsCreateOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => ArtifactsClient.fromContext(ctx).create(input)\n})\n\nexport const artifactsReadRangeTool = defineTool({\n\tid: 'artifacts-read-range',\n\tname: 'readArtifactRange',\n\tdescription:\n\t\t'Read an explicit inclusive byte range from an existing ArtifactRef as base64. Use for bounded binary inspection or chunked transfer, not for understanding a supported document when a format-aware reader is available.',\n\tinputSchema: artifactsReadRangeInputSchema,\n\toutputSchema: artifactsReadRangeOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => ArtifactsClient.fromContext(ctx).readRange(input)\n})\n\nexport const artifactsReadLinesTool = defineTool({\n\tid: 'artifacts-read-lines',\n\tname: 'readArtifactLines',\n\tdescription:\n\t\t'Read an explicit inclusive line range from a UTF-8 text artifact. Use for bounded inspection instead of loading the whole file into context.',\n\tinputSchema: artifactsReadLinesInputSchema,\n\toutputSchema: artifactsReadLinesOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => ArtifactsClient.fromContext(ctx).readLines(input)\n})\n\nexport const artifactsModule = defineModule({\n\tid: 'artifacts',\n\ttitle: 'Artifacts',\n\tdescription:\n\t\t'Persist small serialized content and inspect bounded byte or text ranges. ArtifactRef is the handoff between tools; structured document creation belongs to purpose-built builders.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: artifactsAuthSchema },\n\tcategories: ['storage', 'artifacts'],\n\tclassification: 'pii',\n\ttags: ['artifact-ref', 'object-store'],\n\ttools: [artifactsCreateTool, artifactsReadRangeTool, artifactsReadLinesTool]\n})\n"],"mappings":";;;;;;;;;;;;;;AAWA,MAAa,0BAA0B;AACvC,MAAa,4BAA4B;AACzC,MAAa,4BAA4B,KAAK,KAAM,4BAA4B,IAAK,CAAC,IAAI;AAE1F,MAAa,6BAA6B,EAAE,OAAO;CAClD,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAK,CAAC,CAAC,SAAS,sCAAsC;CACjF,MAAM,EAAE,OAA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,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAoB;CACpD,YAAY,CAAC,WAAW,WAAW;CACnC,gBAAgB;CAChB,MAAM,CAAC,gBAAgB,cAAc;CACrC,OAAO;EAAC;EAAqB;EAAwB;CAAsB;AAC5E,CAAC"}
1
+ {"version":3,"file":"index.js","names":["#backend","#storage","#ops"],"sources":["../../../src/modules/artifacts/contracts.ts","../../../src/modules/artifacts/providers/host.ts","../../../src/modules/artifacts/providers/object.ts","../../../src/modules/artifacts/client.ts","../../../src/modules/artifacts/module.ts"],"sourcesContent":["/**\n * ArtifactRef creation and read contracts.\n * Host-mapped and object-store backends share the same model-facing verbs.\n */\n\nimport { isFunction } from 'es-toolkit'\nimport { z } from 'zod'\n\nimport { artifactRefSchema } from '../../shared/artifact'\nimport { MAX_OBJECT_BYTES, s3AuthSchema } from '../../vendors/s3'\n\nexport const MAX_ARTIFACT_READ_BYTES = MAX_OBJECT_BYTES\nexport const MAX_ARTIFACT_CREATE_BYTES = MAX_OBJECT_BYTES\nexport const MAX_ARTIFACT_INLINE_CHARS = Math.ceil((MAX_ARTIFACT_CREATE_BYTES * 4) / 3) + 4\n\nexport const artifactsCreateInputSchema = z.object({\n\tkey: z.string().min(1).max(1_024).describe('Destination key for the new artifact'),\n\tbody: z.string().max(MAX_ARTIFACT_INLINE_CHARS).describe('Artifact body encoded as specified by encoding'),\n\tencoding: z.enum(['utf8', 'base64']).describe('How body is encoded'),\n\tmedia_type: z.string().min(1).max(200).optional().describe('MIME type when known'),\n\tfilename: z.string().min(1).max(512).optional().describe('Display filename when different from the key')\n})\n\nexport const artifactsCreateOutputSchema = z.object({\n\tartifact: artifactRefSchema.describe('Reference to the created artifact')\n})\n\nexport const artifactsReadRangeInputSchema = z\n\t.object({\n\t\tsource: artifactRefSchema.describe('Artifact to read'),\n\t\tstart_byte: z.int().min(0).describe('Inclusive zero-based start byte'),\n\t\tend_byte: z.int().min(0).describe('Inclusive zero-based end byte')\n\t})\n\t.superRefine((input, ctx) => {\n\t\tconst byteLength = input.end_byte - input.start_byte + 1\n\t\tif (byteLength < 1) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: 'custom',\n\t\t\t\tpath: ['end_byte'],\n\t\t\t\tmessage: 'end_byte must be greater than or equal to start_byte'\n\t\t\t})\n\t\t}\n\t\tif (byteLength > MAX_ARTIFACT_READ_BYTES) {\n\t\t\tctx.addIssue({\n\t\t\t\tcode: 'custom',\n\t\t\t\tpath: ['end_byte'],\n\t\t\t\tmessage: `Byte range cannot exceed ${MAX_ARTIFACT_READ_BYTES} bytes`\n\t\t\t})\n\t\t}\n\t})\n\nexport const artifactsReadRangeOutputSchema = z.object({\n\tsource: artifactRefSchema,\n\tbody_base64: z.string().describe('Requested bytes encoded as base64'),\n\tstart_byte: z.int().min(0),\n\tend_byte: z.int().min(0),\n\ttotal_bytes: z.int().min(0).optional(),\n\tmedia_type: z.string().optional()\n})\n\nexport const artifactsReadLinesInputSchema = z.object({\n\tsource: artifactRefSchema.describe('UTF-8 text artifact to read')\n})\n\nexport const artifactsReadLinesOutputSchema = z.object({\n\tsource: artifactRefSchema,\n\ttext: z.string().describe('Complete UTF-8 text content'),\n\tstart_line: z.int().min(1),\n\tend_line: z.int().min(1),\n\ttotal_lines: z.int().min(0)\n})\n\nexport const artifactResolveInputSchema = z.object({\n\tsource: artifactRefSchema,\n\tmax_bytes: z.int().min(0)\n})\n\nexport const resolvedArtifactSchema = z.object({\n\tartifact: artifactRefSchema,\n\tbytes: z.custom<Uint8Array>((value) => value instanceof Uint8Array, 'bytes must be a Uint8Array')\n})\n\nexport type ArtifactsCreateInput = z.infer<typeof artifactsCreateInputSchema>\nexport type ArtifactsCreateOutput = z.infer<typeof artifactsCreateOutputSchema>\nexport type ArtifactsReadRangeInput = z.infer<typeof artifactsReadRangeInputSchema>\nexport type ArtifactsReadRangeOutput = z.infer<typeof artifactsReadRangeOutputSchema>\nexport type ArtifactsReadLinesInput = z.infer<typeof artifactsReadLinesInputSchema>\nexport type ArtifactsReadLinesOutput = z.infer<typeof artifactsReadLinesOutputSchema>\nexport type ArtifactResolveInput = z.infer<typeof artifactResolveInputSchema>\nexport type ResolvedArtifact = z.infer<typeof resolvedArtifactSchema>\n\nexport type ArtifactsOps = {\n\tcreate(input: ArtifactsCreateInput): Promise<ArtifactsCreateOutput>\n\treadRange(input: ArtifactsReadRangeInput): Promise<ArtifactsReadRangeOutput>\n\treadLines(input: ArtifactsReadLinesInput): Promise<ArtifactsReadLinesOutput>\n}\n\nexport type ArtifactResolverOps = {\n\tresolve(input: ArtifactResolveInput): Promise<ResolvedArtifact>\n}\n\nexport type ArtifactsClientOps = ArtifactsOps & ArtifactResolverOps\n\nexport const artifactsBackendSchema = z.object({\n\tcreate: z.custom<ArtifactsOps['create']>(isFunction, 'create must be a function'),\n\treadRange: z.custom<ArtifactsOps['readRange']>(isFunction, 'readRange must be a function'),\n\treadLines: z.custom<ArtifactsOps['readLines']>(isFunction, 'readLines must be a function'),\n\tresolve: z.custom<ArtifactResolverOps['resolve']>(isFunction, 'resolve must be a function').optional()\n})\n\nexport const objectArtifactsAuthSchema = z.object({\n\tprovider: z.literal('object'),\n\tstorage: s3AuthSchema.describe('S3-compatible object storage for ArtifactRef bytes')\n})\n\nexport const hostArtifactsAuthSchema = z.object({\n\tprovider: z.literal('host'),\n\tbackend: artifactsBackendSchema.describe('Host artifact operations for host-mapped ArtifactRefs')\n})\n\nexport const artifactsAuthSchema = z.discriminatedUnion('provider', [\n\tobjectArtifactsAuthSchema,\n\thostArtifactsAuthSchema\n])\n\nexport type ArtifactsAuth = z.infer<typeof artifactsAuthSchema>\nexport type ObjectArtifactsAuth = z.infer<typeof objectArtifactsAuthSchema>\nexport type HostArtifactsAuth = z.infer<typeof hostArtifactsAuthSchema>\n","import { ToolError } from '../../../core/errors'\nimport type {\n\tArtifactResolveInput,\n\tArtifactsClientOps,\n\tArtifactsCreateInput,\n\tArtifactsCreateOutput,\n\tArtifactsReadLinesInput,\n\tArtifactsReadLinesOutput,\n\tArtifactsReadRangeInput,\n\tArtifactsReadRangeOutput,\n\tHostArtifactsAuth,\n\tResolvedArtifact\n} from '../contracts'\nimport {\n\tartifactsCreateOutputSchema,\n\tartifactsReadLinesOutputSchema,\n\tartifactsReadRangeOutputSchema,\n\tresolvedArtifactSchema\n} from '../contracts'\n\nfunction requireHostStore(store: 'object' | 'host'): void {\n\tif (store !== 'host') {\n\t\tthrow new ToolError('The host artifact provider only resolves host-mapped references', {\n\t\t\tcode: 'unsupported'\n\t\t})\n\t}\n}\n\nexport class HostArtifactsProvider implements ArtifactsClientOps {\n\treadonly #backend: HostArtifactsAuth['backend']\n\n\tconstructor(auth: HostArtifactsAuth) {\n\t\tthis.#backend = auth.backend\n\t}\n\n\tasync create(input: ArtifactsCreateInput): Promise<ArtifactsCreateOutput> {\n\t\tconst output = artifactsCreateOutputSchema.parse(await this.#backend.create(input))\n\t\trequireHostStore(output.artifact.store)\n\t\treturn output\n\t}\n\n\tasync readRange(input: ArtifactsReadRangeInput): Promise<ArtifactsReadRangeOutput> {\n\t\trequireHostStore(input.source.store)\n\t\treturn artifactsReadRangeOutputSchema.parse(await this.#backend.readRange(input))\n\t}\n\n\tasync readLines(input: ArtifactsReadLinesInput): Promise<ArtifactsReadLinesOutput> {\n\t\trequireHostStore(input.source.store)\n\t\treturn artifactsReadLinesOutputSchema.parse(await this.#backend.readLines(input))\n\t}\n\n\tasync resolve(input: ArtifactResolveInput): Promise<ResolvedArtifact> {\n\t\trequireHostStore(input.source.store)\n\t\tif (input.source.byte_length !== undefined && input.source.byte_length > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: input.source.byte_length }\n\t\t\t})\n\t\t}\n\t\tif (!this.#backend.resolve) {\n\t\t\tthrow new ToolError('The host artifact backend does not support byte resolution', {\n\t\t\t\tcode: 'unsupported'\n\t\t\t})\n\t\t}\n\n\t\tconst output = resolvedArtifactSchema.parse(await this.#backend.resolve(input))\n\t\trequireHostStore(output.artifact.store)\n\t\tif (output.artifact.key !== input.source.key) {\n\t\t\tthrow new ToolError('The host artifact backend resolved a different artifact', {\n\t\t\t\tcode: 'internal'\n\t\t\t})\n\t\t}\n\t\tif (output.bytes.byteLength > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: output.bytes.byteLength }\n\t\t\t})\n\t\t}\n\t\treturn {\n\t\t\tartifact: {\n\t\t\t\t...input.source,\n\t\t\t\t...output.artifact,\n\t\t\t\tbyte_length: output.bytes.byteLength\n\t\t\t},\n\t\t\tbytes: output.bytes\n\t\t}\n\t}\n}\n","import { ToolError } from '../../../core/errors'\nimport { artifactRefSchema } from '../../../shared/artifact'\nimport { base64ToBytes, bytesToBase64, bytesToUtf8, utf8ToBytes } from '../../../shared/bytes'\nimport { mediaTypeFromPath } from '../../../shared/content-type'\nimport type { HttpServiceOptions } from '../../../transport/http-service'\nimport { S3Client } from '../../../vendors/s3'\nimport type {\n\tArtifactResolveInput,\n\tArtifactsClientOps,\n\tArtifactsCreateInput,\n\tArtifactsCreateOutput,\n\tArtifactsReadLinesInput,\n\tArtifactsReadLinesOutput,\n\tArtifactsReadRangeInput,\n\tArtifactsReadRangeOutput,\n\tObjectArtifactsAuth,\n\tResolvedArtifact\n} from '../contracts'\nimport { MAX_ARTIFACT_CREATE_BYTES, MAX_ARTIFACT_READ_BYTES } from '../contracts'\n\nexport type ObjectArtifactsProviderOptions = Pick<HttpServiceOptions, 'fetch' | 'signal'>\n\nfunction requireObjectSource(store: 'object' | 'host'): void {\n\tif (store !== 'object') {\n\t\tthrow new ToolError('The object artifact provider only resolves object-store references', {\n\t\t\tcode: 'unsupported'\n\t\t})\n\t}\n}\n\nfunction artifactBytes(input: ArtifactsCreateInput): Uint8Array {\n\tconst bytes = input.encoding === 'base64' ? base64ToBytes(input.body) : utf8ToBytes(input.body)\n\tif (bytes.byteLength > MAX_ARTIFACT_CREATE_BYTES) {\n\t\tthrow new ToolError('Artifact body exceeds create limit', {\n\t\t\tcode: 'too_large',\n\t\t\tdetails: { max_bytes: MAX_ARTIFACT_CREATE_BYTES, content_length: bytes.byteLength }\n\t\t})\n\t}\n\treturn bytes\n}\n\nfunction textLines(text: string): string[] {\n\treturn text.split('\\n').map((line) => (line.endsWith('\\r') ? line.slice(0, -1) : line))\n}\n\nexport class ObjectArtifactsProvider implements ArtifactsClientOps {\n\treadonly #storage: S3Client\n\n\tconstructor(auth: ObjectArtifactsAuth, options: ObjectArtifactsProviderOptions = {}) {\n\t\tthis.#storage = new S3Client(auth.storage, options)\n\t}\n\n\tasync create(input: ArtifactsCreateInput): Promise<ArtifactsCreateOutput> {\n\t\tconst bytes = artifactBytes(input)\n\t\tconst mediaType = input.media_type ?? mediaTypeFromPath(input.filename ?? input.key)\n\t\tawait this.#storage.putBytes(input.key, bytes, mediaType)\n\t\treturn {\n\t\t\tartifact: artifactRefSchema.parse({\n\t\t\t\tstore: 'object',\n\t\t\t\tkey: input.key,\n\t\t\t\tbyte_length: bytes.byteLength,\n\t\t\t\t...(mediaType && { media_type: mediaType }),\n\t\t\t\t...(input.filename && { filename: input.filename })\n\t\t\t})\n\t\t}\n\t}\n\n\tasync readRange(input: ArtifactsReadRangeInput): Promise<ArtifactsReadRangeOutput> {\n\t\trequireObjectSource(input.source.store)\n\t\tconst result = await this.#storage.getBytesRange(input.source.key, {\n\t\t\tstart_byte: input.start_byte,\n\t\t\tend_byte: input.end_byte\n\t\t})\n\t\treturn {\n\t\t\tsource: input.source,\n\t\t\tbody_base64: bytesToBase64(result.bytes),\n\t\t\tstart_byte: result.start_byte,\n\t\t\tend_byte: result.end_byte,\n\t\t\t...(result.total_bytes !== undefined && { total_bytes: result.total_bytes }),\n\t\t\t...(result.content_type && { media_type: result.content_type })\n\t\t}\n\t}\n\n\tasync readLines(input: ArtifactsReadLinesInput): Promise<ArtifactsReadLinesOutput> {\n\t\trequireObjectSource(input.source.store)\n\t\tconst bytes = await this.#storage.getBytes(input.source.key, { maxBytes: MAX_ARTIFACT_READ_BYTES })\n\t\tconst lines = textLines(bytesToUtf8(bytes))\n\t\treturn {\n\t\t\tsource: input.source,\n\t\t\ttext: lines.join('\\n'),\n\t\t\tstart_line: 1,\n\t\t\tend_line: lines.length,\n\t\t\ttotal_lines: lines.length\n\t\t}\n\t}\n\n\tasync resolve(input: ArtifactResolveInput): Promise<ResolvedArtifact> {\n\t\trequireObjectSource(input.source.store)\n\t\tif (input.source.byte_length !== undefined && input.source.byte_length > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: input.source.byte_length }\n\t\t\t})\n\t\t}\n\n\t\tconst head = await this.#storage.head({ key: input.source.key })\n\t\tif (!head.exists) {\n\t\t\tthrow new ToolError('Artifact not found', { code: 'not_found' })\n\t\t}\n\t\tif (head.content_length !== undefined && head.content_length > input.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: input.max_bytes, content_length: head.content_length }\n\t\t\t})\n\t\t}\n\n\t\tconst bytes = await this.#storage.getBytes(input.source.key, { maxBytes: input.max_bytes })\n\t\treturn {\n\t\t\tartifact: artifactRefSchema.parse({\n\t\t\t\t...input.source,\n\t\t\t\t...(!input.source.media_type && head.content_type && { media_type: head.content_type }),\n\t\t\t\tbyte_length: bytes.byteLength\n\t\t\t}),\n\t\t\tbytes\n\t\t}\n\t}\n}\n","import { ToolError } from '../../core/errors'\nimport { requireAuth } from '../../core/provider'\nimport type { ToolContext } from '../../core/types'\nimport type {\n\tArtifactResolveInput,\n\tArtifactsAuth,\n\tArtifactsClientOps,\n\tArtifactsCreateInput,\n\tArtifactsReadLinesInput,\n\tArtifactsReadRangeInput,\n\tResolvedArtifact\n} from './contracts'\nimport { artifactResolveInputSchema, artifactsAuthSchema, resolvedArtifactSchema } from './contracts'\nimport { HostArtifactsProvider } from './providers/host'\nimport { ObjectArtifactsProvider } from './providers/object'\n\nfunction transportOptions(ctx: ToolContext) {\n\treturn {\n\t\t...(ctx.fetch && { fetch: ctx.fetch }),\n\t\t...(ctx.signal && { signal: ctx.signal })\n\t}\n}\n\nfunction providerFor(auth: ArtifactsAuth, ctx: ToolContext): ArtifactsClientOps {\n\tswitch (auth.provider) {\n\t\tcase 'object':\n\t\t\treturn new ObjectArtifactsProvider(auth, transportOptions(ctx))\n\t\tcase 'host':\n\t\t\treturn new HostArtifactsProvider(auth)\n\t}\n}\n\nexport class ArtifactsClient implements ArtifactsClientOps {\n\treadonly #ops: ArtifactsClientOps\n\n\tconstructor(ops: ArtifactsClientOps) {\n\t\tthis.#ops = ops\n\t}\n\n\tstatic fromContext(ctx: ToolContext): ArtifactsClient {\n\t\tconst auth = requireAuth(ctx, artifactsAuthSchema)\n\t\treturn new ArtifactsClient(providerFor(auth, ctx))\n\t}\n\n\tstatic fromAuth(auth: ArtifactsAuth, ctx: ToolContext = {}): ArtifactsClient {\n\t\treturn new ArtifactsClient(providerFor(auth, ctx))\n\t}\n\n\tcreate(input: ArtifactsCreateInput) {\n\t\treturn this.#ops.create(input)\n\t}\n\n\treadRange(input: ArtifactsReadRangeInput) {\n\t\treturn this.#ops.readRange(input)\n\t}\n\n\treadLines(input: ArtifactsReadLinesInput) {\n\t\treturn this.#ops.readLines(input)\n\t}\n\n\tasync resolve(input: ArtifactResolveInput): Promise<ResolvedArtifact> {\n\t\tconst parsedInput = artifactResolveInputSchema.parse(input)\n\t\tconst output = resolvedArtifactSchema.parse(await this.#ops.resolve(parsedInput))\n\t\tif (output.bytes.byteLength > parsedInput.max_bytes) {\n\t\t\tthrow new ToolError('Artifact exceeds resolution limit', {\n\t\t\t\tcode: 'too_large',\n\t\t\t\tdetails: { max_bytes: parsedInput.max_bytes, content_length: output.bytes.byteLength }\n\t\t\t})\n\t\t}\n\t\treturn {\n\t\t\tartifact: {\n\t\t\t\t...output.artifact,\n\t\t\t\tbyte_length: output.bytes.byteLength\n\t\t\t},\n\t\t\tbytes: output.bytes\n\t\t}\n\t}\n}\n","import { defineModule, defineTool } from '../../core/define'\nimport { ArtifactsClient } from './client'\nimport {\n\tartifactsAuthSchema,\n\tartifactsCreateInputSchema,\n\tartifactsCreateOutputSchema,\n\tartifactsReadLinesInputSchema,\n\tartifactsReadLinesOutputSchema,\n\tartifactsReadRangeInputSchema,\n\tartifactsReadRangeOutputSchema\n} from './contracts'\n\nexport const artifactsCreateTool = defineTool({\n\tid: 'artifacts-create',\n\tname: 'createArtifact',\n\tdescription:\n\t\t'Persist small, already-serialized UTF-8 or base64 content and return its ArtifactRef. Use for raw bytes or text when no structured builder is required. Do not use this to invent DOCX, XLSX, PPTX, PDF, or image formats.',\n\tinputSchema: artifactsCreateInputSchema,\n\toutputSchema: artifactsCreateOutputSchema,\n\tsideEffect: 'write',\n\truntime: 'both',\n\texecute: async (input, ctx) => ArtifactsClient.fromContext(ctx).create(input)\n})\n\nexport const artifactsReadRangeTool = defineTool({\n\tid: 'artifacts-read-range',\n\tname: 'readArtifactRange',\n\tdescription:\n\t\t'Read an explicit inclusive byte range from an existing ArtifactRef as base64. Use for bounded binary inspection or chunked transfer, not for understanding a supported document when a format-aware reader is available.',\n\tinputSchema: artifactsReadRangeInputSchema,\n\toutputSchema: artifactsReadRangeOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => ArtifactsClient.fromContext(ctx).readRange(input)\n})\n\nexport const artifactsReadLinesTool = defineTool({\n\tid: 'artifacts-read-lines',\n\tname: 'readArtifactLines',\n\tdescription: 'Read the complete contents of a UTF-8 text artifact, bounded by the artifact read-size limit.',\n\tinputSchema: artifactsReadLinesInputSchema,\n\toutputSchema: artifactsReadLinesOutputSchema,\n\tsideEffect: 'read',\n\truntime: 'both',\n\texecute: async (input, ctx) => ArtifactsClient.fromContext(ctx).readLines(input)\n})\n\nexport const artifactsModule = defineModule({\n\tid: 'artifacts',\n\ttitle: 'Artifacts',\n\tdescription:\n\t\t'Persist small serialized content, inspect bounded byte ranges, and read UTF-8 text artifacts. ArtifactRef is the handoff between tools; structured document creation belongs to purpose-built builders.',\n\truntime: 'both',\n\tauth: { type: 'custom', schema: artifactsAuthSchema },\n\tcategories: ['storage', 'artifacts'],\n\tclassification: 'pii',\n\ttags: ['artifact-ref', 'object-store'],\n\ttools: [artifactsCreateTool, artifactsReadRangeTool, artifactsReadLinesTool]\n})\n"],"mappings":";;;;;;;;;;;;;;AAWA,MAAa,0BAA0B;AACvC,MAAa,4BAA4B;AACzC,MAAa,4BAA4B,KAAK,KAAM,4BAA4B,IAAK,CAAC,IAAI;AAE1F,MAAa,6BAA6B,EAAE,OAAO;CAClD,KAAK,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAK,CAAC,CAAC,SAAS,sCAAsC;CACjF,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,yBAAyB,CAAC,CAAC,SAAS,gDAAgD;CACzG,UAAU,EAAE,KAAK,CAAC,QAAQ,QAAQ,CAAC,CAAC,CAAC,SAAS,qBAAqB;CACnE,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,sBAAsB;CACjF,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,8CAA8C;AACxG,CAAC;AAED,MAAa,8BAA8B,EAAE,OAAO,EACnD,UAAU,kBAAkB,SAAS,mCAAmC,EACzE,CAAC;AAED,MAAa,gCAAgC,EAC3C,OAAO;CACP,QAAQ,kBAAkB,SAAS,kBAAkB;CACrD,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CA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c;CACd,YAAY;CACZ,SAAS;CACT,SAAS,OAAO,OAAO,QAAQ,gBAAgB,YAAY,GAAG,CAAC,CAAC,UAAU,KAAK;AAChF,CAAC;AAED,MAAa,kBAAkB,aAAa;CAC3C,IAAI;CACJ,OAAO;CACP,aACC;CACD,SAAS;CACT,MAAM;EAAE,MAAM;EAAU,QAAQ;CAAoB;CACpD,YAAY,CAAC,WAAW,WAAW;CACnC,gBAAgB;CAChB,MAAM,CAAC,gBAAgB,cAAc;CACrC,OAAO;EAAC;EAAqB;EAAwB;CAAsB;AAC5E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5ss/ai-tools",
3
- "version": "3.0.3",
3
+ "version": "3.1.0",
4
4
  "description": "Reusable AI tools with strict schemas and model-facing contracts. Define once; project to Node, edge, Mastra, AI SDK, TanStack AI, Cloudflare Workers AI, or MCP.",
5
5
  "license": "MIT",
6
6
  "author": "harryy",