@tangle-network/sdk-provider-cli-base 0.0.0-stage → 0.12.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.
@@ -0,0 +1,73 @@
1
+ import { InputPart } from "@tangle-network/agent-interface";
2
+ import { MessagePart } from "@tangle-network/sdk-session-persistence";
3
+
4
+ //#region src/prompt-input.d.ts
5
+ /** A structured, provider-agnostic view of one materialized attachment,
6
+ * handed to `buildExecArgs` alongside the rendered prompt text so an
7
+ * adapter can deliver it natively (argv flag / stdin content block)
8
+ * instead of relying on the `[Image: ...]` / `[File: ...]` text marker. */
9
+ interface PreparedAttachment {
10
+ kind: "image" | "file";
11
+ /** Absolute local path when the attachment is materialized on disk. */
12
+ path?: string;
13
+ /** http(s) URL when the part is a remote reference (no local file). */
14
+ url?: string;
15
+ /** Base64 payload of the materialized file — pre-read here so synchronous
16
+ * buildExecArgs implementations never touch the fs. Populated ONLY when
17
+ * the adapter declares "image" in nativeAttachmentKinds (the marker-only
18
+ * default never reads files). Undefined for remote urls, non-regular or
19
+ * unreadable caller-supplied paths, images over MAX_INLINE_IMAGE_BYTES,
20
+ * and once the per-request inline budget is spent — those fall back to
21
+ * path-based delivery. */
22
+ base64?: string;
23
+ mediaType?: string;
24
+ filename: string;
25
+ /** The exact `[Image: <ref>]` / `[File: <ref>]` fallback marker text. */
26
+ marker: string;
27
+ }
28
+ /** Raw-byte ceiling for inlining one image as base64 (~1.33x expansion in
29
+ * memory and on the wire); larger images keep only their `path` and the
30
+ * adapter falls back to path-based delivery. */
31
+ declare const MAX_INLINE_IMAGE_BYTES: number;
32
+ /** Aggregate raw-byte budget for inlined images across one request's parts —
33
+ * the request schema admits up to 64 parts, so a per-image cap alone would
34
+ * still let one request hold hundreds of MB of base64 until execution. */
35
+ declare const MAX_TOTAL_INLINE_IMAGE_BYTES: number;
36
+ declare function preparePromptInputParts(parts: InputPart[], workspaceRoot: string, sessionId: string, options?: {
37
+ nativeAttachmentKinds?: ReadonlyArray<"image" | "file">; /** Override of MAX_TOTAL_INLINE_IMAGE_BYTES for this request. */
38
+ inlineImageBudgetBytes?: number;
39
+ }): Promise<{
40
+ promptText: string;
41
+ persistedParts: MessagePart[];
42
+ attachments: PreparedAttachment[];
43
+ }>;
44
+ /**
45
+ * Partition a turn's image attachments into the ones the adapter will
46
+ * forward natively and the "stranded" rest, folding each stranded image's
47
+ * `[Image: ...]` marker back into the message text. Once an adapter's
48
+ * nativeAttachmentKinds() claims "image", the base prompt renderer omits
49
+ * every image marker — so any image the mechanism can't carry (no base64
50
+ * for a stdin block, no local path for an argv flag, beyond a single-path
51
+ * flag's capacity) MUST re-enter the prompt here or the model never sees
52
+ * a reference to it. Uses the same "Attached files:" block format the
53
+ * renderer itself emits for non-native kinds.
54
+ */
55
+ declare function partitionImageAttachments(options: {
56
+ message: string;
57
+ attachments?: ReadonlyArray<PreparedAttachment>; /** Does this attachment qualify for the adapter's native mechanism? */
58
+ qualifies: (attachment: PreparedAttachment) => boolean; /** Cap on natively-forwarded images (e.g. 1 for a single-path argv flag). */
59
+ maxNative?: number;
60
+ }): {
61
+ native: PreparedAttachment[];
62
+ message: string;
63
+ };
64
+ /** Separates the sections a harness receives as one user message. */
65
+ declare const PROMPT_SECTION_SEPARATOR = "\n\n---\n\n";
66
+ /**
67
+ * Puts `section` (a system prompt or replayed context) ahead of the message
68
+ * for harnesses that take no separate channel for it.
69
+ */
70
+ declare function prependPromptSection(section: string | undefined, body: string): string;
71
+ //#endregion
72
+ export { partitionImageAttachments as a, PreparedAttachment as i, MAX_TOTAL_INLINE_IMAGE_BYTES as n, preparePromptInputParts as o, PROMPT_SECTION_SEPARATOR as r, prependPromptSection as s, MAX_INLINE_IMAGE_BYTES as t };
73
+ //# sourceMappingURL=prompt-input-BHn_1z69.d.mts.map
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@tangle-network/sdk-provider-cli-base",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.12.0",
4
+ "description": "Base adapter for CLI-based AI agent providers",
5
+ "type": "module",
6
+ "main": "./dist/index.mjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.mts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.mjs",
12
+ "types": "./dist/index.d.mts"
13
+ },
14
+ "./conformance": {
15
+ "import": "./dist/conformance/index.mjs",
16
+ "types": "./dist/conformance/index.d.mts"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "!dist/**/*.map"
22
+ ],
23
+ "dependencies": {
24
+ "@modelcontextprotocol/sdk": "^1.32.1",
25
+ "@tangle-network/agent-core": "^1.0.0",
26
+ "@tangle-network/agent-interface": "^5.9.0",
27
+ "@tangle-network/agent-profile-materialize": "1.0.2",
28
+ "@tangle-network/cli-agent-registry": "0.14.0",
29
+ "@tangle-network/sdk-cli-runner": "0.3.0",
30
+ "@tangle-network/sdk-session-persistence": "0.7.0",
31
+ "zod": "4.6.6"
32
+ },
33
+ "devDependencies": {
34
+ "@biomejs/biome": "~2.5.15",
35
+ "@types/node": "^25.9.9",
36
+ "tsdown": "^0.21.10",
37
+ "typescript": "^6.0.3",
38
+ "vitest": "^4.1.12"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public",
42
+ "registry": "https://registry.npmjs.org"
43
+ },
44
+ "tangleRelease": {
45
+ "sourceSha": "0f6ba1deca15d9e117553eae67ff01cae6425004",
46
+ "mergedAt": "2026-10-27T04:36:51-06:00"
47
+ },
48
+ "scripts": {
49
+ "build": "tsdown",
50
+ "test": "vitest run --passWithNoTests",
51
+ "test:watch": "vitest",
52
+ "lint": "biome check --write .",
53
+ "check-types": "node ../../scripts/tsc-native.mjs --noEmit"
54
+ }
6
55
  }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.