@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.
Files changed (36) hide show
  1. package/README.md +11 -5
  2. package/dist/agent/RunEventBus.d.ts +1 -1
  3. package/dist/agent/RunEventBus.d.ts.map +1 -1
  4. package/dist/agent/RunEventBus.js.map +1 -1
  5. package/dist/agent/editCompletion.d.ts +14 -1
  6. package/dist/agent/editCompletion.d.ts.map +1 -1
  7. package/dist/agent/editCompletion.js +226 -40
  8. package/dist/agent/editCompletion.js.map +1 -1
  9. package/dist/agent/hostTools.d.ts +5 -0
  10. package/dist/agent/hostTools.d.ts.map +1 -1
  11. package/dist/agent/hostTools.js +13 -0
  12. package/dist/agent/hostTools.js.map +1 -1
  13. package/dist/agent/runAgentTask.d.ts.map +1 -1
  14. package/dist/agent/runAgentTask.js +2 -6
  15. package/dist/agent/runAgentTask.js.map +1 -1
  16. package/dist/agent/runValidationWithRepair.d.ts.map +1 -1
  17. package/dist/agent/runValidationWithRepair.js +2 -4
  18. package/dist/agent/runValidationWithRepair.js.map +1 -1
  19. package/dist/agent/tools/executeTool.d.ts.map +1 -1
  20. package/dist/agent/tools/executeTool.js.map +1 -1
  21. package/dist/agent/types.d.ts +28 -3
  22. package/dist/agent/types.d.ts.map +1 -1
  23. package/dist/agent/types.js.map +1 -1
  24. package/dist/index.d.ts +3 -2
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +2 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/providers/agentic/agentLoop.js +2 -2
  29. package/dist/providers/agentic/agentLoop.js.map +1 -1
  30. package/dist/runner/jobTypes.d.ts +1 -1
  31. package/dist/runner/jobTypes.d.ts.map +1 -1
  32. package/dist/runner/validateJob.d.ts.map +1 -1
  33. package/dist/runner/validateJob.js +53 -1
  34. package/dist/runner/validateJob.js.map +1 -1
  35. package/docs/host-integration-image-placement.md +43 -32
  36. package/package.json +1 -1
@@ -69,45 +69,56 @@ completion: {
69
69
  }
70
70
  ```
71
71
 
72
- Rules gate **file classes** (regex on `changedFiles`) and **workspace paths** (must exist on disk). They do not encode `siteConfig` field paths keep those in the host prompt compiler.
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
- Sandbox `job.json` supports the same `completion.rules` and `attachments` array (see [sandbox-runner.md](./sandbox-runner.md)).
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
- import {
82
- Agent,
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
- const agent = await Agent.create({
107
- model: { id: "MiniMax-M3", provider: "custom" },
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:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auvira.ai/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Cursor-SDK-compatible visual coding agent with custom model support",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",