@fungi.computer/oyster 0.13.1 → 0.14.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 +30 -15
- package/dist/agents.js +2 -1
- package/dist/approval-home.js +4 -2
- package/dist/boot-host-script.js +1 -1
- package/dist/browser/cdp-client.d.ts +1 -1
- package/dist/browser/cdp-client.js +73 -37
- package/dist/browser/errors.d.ts +2 -0
- package/dist/browser/lease-registry.d.ts +5 -1
- package/dist/browser/lease-registry.js +2 -6
- package/dist/build/candidate-cli.mjs +10 -104
- package/dist/embed-metafiles.js +2 -2
- package/dist/embed-scripts.js +1 -1
- package/dist/git-journal.js +12 -9
- package/dist/hello-app-script.js +1 -1
- package/dist/host.js +16 -1
- package/dist/installation-operations.js +1 -1
- package/dist/machine-link/host.js +18 -13
- package/dist/page-script.js +2 -2
- package/dist/standalone/agent-mail.d.ts +38 -11
- package/dist/standalone/agent-mail.js +8 -22
- package/dist/standalone/agents.d.ts +1 -0
- package/dist/standalone/agents.js +30 -5
- package/dist/standalone/try-cli.js +101 -14
- package/docs/api/browser.md +24 -7
- package/docs/api/workers-git.md +2 -2
- package/docs/api/workers.md +2 -2
- package/docs/site/agent-quickstart.mdx +109 -354
- package/examples/standalone/wrangler.jsonc +1 -1
- package/package.json +23 -23
package/dist/git-journal.js
CHANGED
|
@@ -65,33 +65,32 @@ export async function createGitPushJournal(ports) {
|
|
|
65
65
|
}),
|
|
66
66
|
};
|
|
67
67
|
const scheduleNext = async () => {
|
|
68
|
-
const
|
|
68
|
+
const time = now();
|
|
69
|
+
const state = await watchdog.wakeState(time);
|
|
70
|
+
const at = state.pending ? time : state.nextWakeAt;
|
|
69
71
|
if (at !== null)
|
|
70
72
|
await ports.scheduleWake(at);
|
|
71
73
|
};
|
|
72
74
|
const watchdog = await Watchdog.make({
|
|
73
75
|
owner,
|
|
74
76
|
isAlive: () => Promise.resolve(false),
|
|
75
|
-
|
|
77
|
+
retryPolicy: (job) => post.retryPolicy(job),
|
|
78
|
+
execute: (job, signal, attempt) => post.execute(job, attempt, signal),
|
|
76
79
|
wake: { recompute: scheduleNext },
|
|
77
80
|
});
|
|
78
81
|
const post = createPost({
|
|
79
82
|
owner,
|
|
80
83
|
routes,
|
|
81
84
|
transactional: watchdog.transactional,
|
|
82
|
-
readJob: watchdog.read,
|
|
83
85
|
now,
|
|
84
86
|
scheduleWake: ports.scheduleWake,
|
|
85
87
|
});
|
|
86
88
|
let settling;
|
|
87
89
|
const drain = async () => {
|
|
88
|
-
let cursor;
|
|
89
|
-
do {
|
|
90
|
-
cursor = await post.enqueueDue(64, cursor);
|
|
91
|
-
} while (cursor !== undefined);
|
|
92
90
|
try {
|
|
93
91
|
for (let count = 0; count < 64; count += 1) {
|
|
94
|
-
|
|
92
|
+
const result = await watchdog.tick();
|
|
93
|
+
if ((result.status !== "settled" && result.status !== "requeued") ||
|
|
95
94
|
deliveringSync.size > 0)
|
|
96
95
|
break;
|
|
97
96
|
}
|
|
@@ -183,6 +182,10 @@ export async function createGitPushJournal(ports) {
|
|
|
183
182
|
}));
|
|
184
183
|
},
|
|
185
184
|
/** The next retained delivery deadline, or null when no wake is needed. */
|
|
186
|
-
nextWake: () =>
|
|
185
|
+
nextWake: () => {
|
|
186
|
+
const time = now();
|
|
187
|
+
const state = watchdog.transactional.wakeState(time);
|
|
188
|
+
return state.pending ? time : state.nextWakeAt;
|
|
189
|
+
},
|
|
187
190
|
};
|
|
188
191
|
}
|