@auvira.ai/sdk 0.6.0 → 0.6.1
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 +11 -5
- package/dist/agent/RunEventBus.d.ts +1 -1
- package/dist/agent/RunEventBus.d.ts.map +1 -1
- package/dist/agent/RunEventBus.js.map +1 -1
- package/dist/agent/editCompletion.d.ts +14 -1
- package/dist/agent/editCompletion.d.ts.map +1 -1
- package/dist/agent/editCompletion.js +226 -40
- package/dist/agent/editCompletion.js.map +1 -1
- package/dist/agent/hostTools.d.ts +5 -0
- package/dist/agent/hostTools.d.ts.map +1 -1
- package/dist/agent/hostTools.js +13 -0
- package/dist/agent/hostTools.js.map +1 -1
- package/dist/agent/runAgentTask.d.ts.map +1 -1
- package/dist/agent/runAgentTask.js +2 -6
- package/dist/agent/runAgentTask.js.map +1 -1
- package/dist/agent/runValidationWithRepair.d.ts.map +1 -1
- package/dist/agent/runValidationWithRepair.js +2 -4
- package/dist/agent/runValidationWithRepair.js.map +1 -1
- package/dist/agent/tools/executeTool.d.ts.map +1 -1
- package/dist/agent/tools/executeTool.js.map +1 -1
- package/dist/agent/types.d.ts +28 -3
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/providers/agentic/agentLoop.js +2 -2
- package/dist/providers/agentic/agentLoop.js.map +1 -1
- package/dist/runner/jobTypes.d.ts +1 -1
- package/dist/runner/jobTypes.d.ts.map +1 -1
- package/dist/runner/validateJob.d.ts.map +1 -1
- package/dist/runner/validateJob.js +53 -1
- package/dist/runner/validateJob.js.map +1 -1
- package/docs/host-integration-image-placement.md +43 -32
- package/package.json +1 -1
|
@@ -69,45 +69,56 @@ completion: {
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
Rules gate **file classes** (regex on `changedFiles`)
|
|
72
|
+
Rules gate **file classes** (regex on `changedFiles`), **workspace paths** (exact or glob), and **file contents** (regex on disk at end of turn).
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
### Content-level rules (v0.6.1+)
|
|
75
|
+
|
|
76
|
+
When file-path gates are not enough (e.g. `siteConfig.ts` changed but `backgroundImageUrl` missing), add `requiredContent`:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
rules: {
|
|
80
|
+
requiredChanges: [
|
|
81
|
+
{ pattern: "src/lib/siteConfig\\.ts", required: true },
|
|
82
|
+
{ pattern: "src/app/page\\.tsx", required: true },
|
|
83
|
+
],
|
|
84
|
+
requiredPaths: ["public/uploads/garden-path-*.png"], // globs supported
|
|
85
|
+
requireAssetPublish: false, // or omit when requiredPaths are all public/uploads/
|
|
86
|
+
requiredContent: [
|
|
87
|
+
{
|
|
88
|
+
pathPattern: "src/lib/siteConfig\\.ts",
|
|
89
|
+
contentPattern: 'backgroundImageUrl\\s*:\\s*["\']/uploads/',
|
|
90
|
+
nudge: "Set presentation.backgroundImageUrl to the uploaded /uploads/ URL.",
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
wiringHints: {
|
|
95
|
+
requiredFields: ["presentation.backgroundImageUrl"], // nudge-only, opaque
|
|
96
|
+
configPaths: ["src/lib/siteConfig.ts"],
|
|
97
|
+
},
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**`requireAssetPublish` semantics:**
|
|
101
|
+
|
|
102
|
+
| Value | Behavior |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `false` / `"none"` | Skip `public/assets/` gate |
|
|
105
|
+
| `"uploads"` | Skip `public/assets/` gate; use content rules for URL wiring |
|
|
106
|
+
| `true` / `"assets"` | Require `public/assets/` change unless all `requiredPaths` are existing `public/uploads/` files |
|
|
107
|
+
|
|
108
|
+
Override default `wiringPatterns` for image edits — the SDK default includes `/components/`, which is too permissive for config wiring checks.
|
|
109
|
+
|
|
110
|
+
Sandbox `job.json` supports `completion.rules`, `completion.wiringHints`, and `attachments` (see [sandbox-runner.md](./sandbox-runner.md)). **Host tools are in-process only** — not serializable to sandbox v1.
|
|
75
111
|
|
|
76
112
|
## Layer 3 — Host-injectable tools
|
|
77
113
|
|
|
78
|
-
Register domain tools at create or send time (in-process only; not serializable to sandbox v1)
|
|
114
|
+
Register domain tools at **create or send** time (in-process only; not serializable to sandbox v1). You do **not** need to pass the same tools on both — send-time tools override create-time tools with the same name.
|
|
79
115
|
|
|
80
116
|
```ts
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
createGetAttachmentUrlsHostTool,
|
|
84
|
-
type HostToolRegistration,
|
|
85
|
-
} from "@auvira.ai/sdk";
|
|
86
|
-
|
|
87
|
-
const placeImageTool: HostToolRegistration = {
|
|
88
|
-
definition: {
|
|
89
|
-
name: "place_image",
|
|
90
|
-
description: "Wire an uploaded attachment publicUrl into a resolved target field.",
|
|
91
|
-
parameters: {
|
|
92
|
-
type: "object",
|
|
93
|
-
properties: {
|
|
94
|
-
index: { type: "number" },
|
|
95
|
-
targetId: { type: "string" },
|
|
96
|
-
},
|
|
97
|
-
required: ["index", "targetId"],
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
handler: async (args, ctx) => {
|
|
101
|
-
// Host reads ctx.attachments, updates siteConfig / page TSX
|
|
102
|
-
return { ok: true, output: "Placed image" };
|
|
103
|
-
},
|
|
104
|
-
};
|
|
117
|
+
// Per-send (dynamic target per turn)
|
|
118
|
+
await agent.send(payload, { hostTools: [placeUploadedImageTool] });
|
|
105
119
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
local: { cwd: repoPath },
|
|
109
|
-
hostTools: [placeImageTool],
|
|
110
|
-
});
|
|
120
|
+
// Or create-time (stable across turns)
|
|
121
|
+
await Agent.create({ ..., hostTools: [placeUploadedImageTool] });
|
|
111
122
|
```
|
|
112
123
|
|
|
113
124
|
Constraints:
|