anbaric 1.56.5 → 1.56.7
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.
|
@@ -157,10 +157,12 @@ that fail throw `The OpenAI request failed with status <n>`.
|
|
|
157
157
|
|
|
158
158
|
### `AnthropicAgent`
|
|
159
159
|
|
|
160
|
-
An `Agent` backed by the Anthropic Messages API
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
An `Agent` backed by the Anthropic Messages API, asking for the output schema
|
|
161
|
+
through the API's `json_schema` output format (every current Claude model
|
|
162
|
+
supports it; the older forced-tool-call approach is rejected from Claude Opus
|
|
163
|
+
5.5 on). Objects in the schema are closed and every property made required, as
|
|
164
|
+
that format demands. System messages are lifted out of the conversation into
|
|
165
|
+
the API's own `system` field.
|
|
164
166
|
|
|
165
167
|
```ts
|
|
166
168
|
class AnthropicAgent extends Agent
|
|
@@ -175,9 +177,10 @@ type AnthropicConnection = {
|
|
|
175
177
|
}
|
|
176
178
|
```
|
|
177
179
|
|
|
178
|
-
Failures throw `The Anthropic request failed with status <n>`; a
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
Failures throw `The Anthropic request failed with status <n>`; a reply with no
|
|
181
|
+
text throws `The Anthropic response carried no structured content`, and prose
|
|
182
|
+
where JSON was asked for throws `The Anthropic response was not the JSON it was
|
|
183
|
+
asked for`.
|
|
181
184
|
|
|
182
185
|
### `GeminiAgent`
|
|
183
186
|
|
|
@@ -348,6 +348,13 @@ Storage comes from `JobRunSchedulePersistenceFactory` — in memory locally, the
|
|
|
348
348
|
platform database when deployed, where claiming a due run is atomic so several
|
|
349
349
|
instances can schedule the same machines safely.
|
|
350
350
|
|
|
351
|
+
Claiming coalesces: when more than one of a machine's runs has come due — the
|
|
352
|
+
scheduler was down, a deploy took a while — only the most recent is claimed
|
|
353
|
+
and started, and the earlier ones are recorded as **superseded** by it
|
|
354
|
+
(`superseded_at` and `superseded_by` on the stored run). The consumer is sent
|
|
355
|
+
one catch-up job, never one per missed tick. Runs of different machines, or
|
|
356
|
+
of the same machine in different apps, are never coalesced with each other.
|
|
357
|
+
|
|
351
358
|
---
|
|
352
359
|
|
|
353
360
|
## `Actor`
|
|
@@ -91,7 +91,7 @@ new OpenAIAgent("triager", "support", {
|
|
|
91
91
|
|
|
92
92
|
new AnthropicAgent("triager", "support", {
|
|
93
93
|
apiKey: process.env.ANTHROPIC_API_KEY!,
|
|
94
|
-
model: "claude-opus-5",
|
|
94
|
+
model: "claude-opus-5-5",
|
|
95
95
|
maxTokens: 4096, // optional; the Messages API needs a budget
|
|
96
96
|
});
|
|
97
97
|
|
|
@@ -102,9 +102,9 @@ new GeminiAgent("triager", "support", {
|
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
Each asks its provider for structured output the way that provider supports it -
|
|
105
|
-
OpenAI's JSON-schema response format,
|
|
106
|
-
JSON response schema - so your action only ever sees properties
|
|
107
|
-
schema you gave it.
|
|
105
|
+
OpenAI's JSON-schema response format, Anthropic's `json_schema` output format,
|
|
106
|
+
Gemini's JSON response schema - so your action only ever sees properties
|
|
107
|
+
matching the schema you gave it.
|
|
108
108
|
|
|
109
109
|
For a provider none of them covers, implement an `Agent.Client` (a class with a
|
|
110
110
|
`generate(request)` method) and pass it to a plain `Agent`. See the [API
|
|
@@ -53,10 +53,14 @@ runs as they come due. Two things follow from that, both deliberate:
|
|
|
53
53
|
|
|
54
54
|
- **A restart doesn't lose the timetable.** The plan is already stored, so the
|
|
55
55
|
scheduler picks up where it left off.
|
|
56
|
-
- **Downtime doesn't silently skip runs
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
- **Downtime doesn't silently skip runs — and doesn't replay them either.** A
|
|
57
|
+
scheduler that was down for two days starts **one** catch-up run as soon as
|
|
58
|
+
it comes back: the most recent run it missed. The earlier missed runs are
|
|
59
|
+
recorded as superseded by it, so the timetable shows what was skipped and
|
|
60
|
+
why, but an hourly sync that missed a day never becomes twenty-four syncs
|
|
61
|
+
fired in the same second. The job's `scheduledFor` tells you which run it
|
|
62
|
+
is; if a machine must not catch up at all, make its action check that and
|
|
63
|
+
return early.
|
|
60
64
|
|
|
61
65
|
Every scheduled job carries the run it belongs to:
|
|
62
66
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anbaric",
|
|
3
|
-
"version": "1.56.
|
|
3
|
+
"version": "1.56.7",
|
|
4
4
|
"description": "Everything needed to write an Anbaric app: state machines, jobs, document and secret stores, local in-memory implementations and the Anbaric Cloud clients",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"prepublishOnly": "npm run build"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"anbaric-impl-cloud": "^1.56.
|
|
28
|
-
"anbaric-data-store": "^1.56.
|
|
29
|
-
"anbaric-state-machine": "^1.56.
|
|
30
|
-
"anbaric-tsapi": "^1.56.
|
|
27
|
+
"anbaric-impl-cloud": "^1.56.7",
|
|
28
|
+
"anbaric-data-store": "^1.56.7",
|
|
29
|
+
"anbaric-state-machine": "^1.56.7",
|
|
30
|
+
"anbaric-tsapi": "^1.56.7"
|
|
31
31
|
}
|
|
32
32
|
}
|