orizu 0.5.41 → 0.5.43
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/dist/account-directory.d.ts.map +1 -1
- package/dist/account-directory.js +6 -32
- package/dist/app-publish-workspace.js +1 -1
- package/dist/archive-artifact-workflow.d.ts +23 -0
- package/dist/archive-artifact-workflow.d.ts.map +1 -0
- package/dist/archive-artifact-workflow.js +100 -0
- package/dist/archive-artifacts-cli.d.ts.map +1 -1
- package/dist/archive-artifacts-cli.js +7 -11
- package/dist/artifact-archive.d.ts.map +1 -1
- package/dist/artifact-archive.js +2 -0
- package/dist/credentials.d.ts.map +1 -1
- package/dist/credentials.js +2 -0
- package/dist/dataset-commands.d.ts.map +1 -1
- package/dist/dataset-commands.js +19 -29
- package/dist/dataset-split-create-workflow.d.ts +16 -0
- package/dist/dataset-split-create-workflow.d.ts.map +1 -0
- package/dist/dataset-split-create-workflow.js +115 -0
- package/dist/git-credential.js +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +10 -2
- package/dist/hosted-boot.d.ts +7 -0
- package/dist/hosted-boot.d.ts.map +1 -1
- package/dist/hosted-boot.js +290 -60
- package/dist/hosted-harness.d.ts +1 -0
- package/dist/hosted-harness.d.ts.map +1 -1
- package/dist/hosted-harness.js +2 -0
- package/dist/hosted-harvest.d.ts +2 -1
- package/dist/hosted-harvest.d.ts.map +1 -1
- package/dist/hosted-harvest.js +29 -17
- package/dist/hosted-live-channel.d.ts +31 -0
- package/dist/hosted-live-channel.d.ts.map +1 -0
- package/dist/hosted-live-channel.js +147 -0
- package/dist/hosted-loop.d.ts +8 -1
- package/dist/hosted-loop.d.ts.map +1 -1
- package/dist/hosted-loop.js +45 -0
- package/dist/hosted-run-event-sink.d.ts +19 -0
- package/dist/hosted-run-event-sink.d.ts.map +1 -1
- package/dist/hosted-run-event-sink.js +106 -3
- package/dist/hosted-runtime-assets.js +1 -1
- package/dist/hosted-session-cli.d.ts.map +1 -1
- package/dist/hosted-session-cli.js +4 -0
- package/dist/hosted-session-seed.d.ts +46 -6
- package/dist/hosted-session-seed.d.ts.map +1 -1
- package/dist/hosted-session-seed.js +95 -9
- package/dist/hosted-skill-staging.d.ts +36 -12
- package/dist/hosted-skill-staging.d.ts.map +1 -1
- package/dist/hosted-skill-staging.js +96 -34
- package/dist/http.d.ts +2 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/orizu-skill-links.d.ts +48 -0
- package/dist/orizu-skill-links.d.ts.map +1 -0
- package/dist/orizu-skill-links.js +99 -0
- package/dist/preview-runtime.d.ts +1 -0
- package/dist/preview-runtime.d.ts.map +1 -1
- package/dist/preview-runtime.js +15 -0
- package/dist/repository-backup-core.d.ts.map +1 -1
- package/dist/repository-backup-core.js +2 -0
- package/dist/request-outcome.d.ts +5 -0
- package/dist/request-outcome.d.ts.map +1 -0
- package/dist/request-outcome.js +27 -0
- package/dist/score-save-workflow.d.ts +26 -0
- package/dist/score-save-workflow.d.ts.map +1 -0
- package/dist/score-save-workflow.js +120 -0
- package/dist/setup-and-skills-commands.d.ts.map +1 -1
- package/dist/setup-and-skills-commands.js +52 -7
- package/dist/setup-onboarding.d.ts.map +1 -1
- package/dist/setup-onboarding.js +6 -2
- package/dist/skill-installer.d.ts +16 -0
- package/dist/skill-installer.d.ts.map +1 -1
- package/dist/skill-installer.js +35 -5
- package/dist/team-create-workflow.d.ts +16 -0
- package/dist/team-create-workflow.d.ts.map +1 -0
- package/dist/team-create-workflow.js +107 -0
- package/dist/team-member-change-workflow.d.ts +25 -0
- package/dist/team-member-change-workflow.d.ts.map +1 -0
- package/dist/team-member-change-workflow.js +132 -0
- package/dist/workbench-cli.d.ts.map +1 -1
- package/dist/workbench-cli.js +24 -4
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +2 -0
- package/package.json +1 -1
- package/src/account-directory.ts +6 -41
- package/src/app-publish-workspace.ts +1 -1
- package/src/archive-artifact-workflow.ts +101 -0
- package/src/archive-artifacts-cli.ts +7 -28
- package/src/artifact-archive.ts +2 -0
- package/src/credentials.ts +2 -0
- package/src/dataset-commands.ts +19 -31
- package/src/dataset-split-create-workflow.ts +128 -0
- package/src/git-credential.ts +1 -1
- package/src/help.ts +10 -2
- package/src/hosted-boot.ts +292 -59
- package/src/hosted-harness.ts +2 -0
- package/src/hosted-harvest.ts +30 -17
- package/src/hosted-live-channel.ts +167 -0
- package/src/hosted-loop.ts +50 -0
- package/src/hosted-run-event-sink.ts +118 -3
- package/src/hosted-runtime-assets.ts +1 -1
- package/src/hosted-session-cli.ts +4 -0
- package/src/hosted-session-seed.ts +111 -10
- package/src/hosted-skill-staging.ts +110 -36
- package/src/http.ts +12 -7
- package/src/index.ts +17 -21
- package/src/orizu-skill-links.ts +114 -0
- package/src/preview-runtime.ts +16 -0
- package/src/repository-backup-core.ts +2 -0
- package/src/request-outcome.ts +28 -0
- package/src/score-save-workflow.ts +132 -0
- package/src/setup-and-skills-commands.ts +60 -6
- package/src/setup-onboarding.ts +6 -2
- package/src/skill-installer.ts +46 -5
- package/src/team-create-workflow.ts +109 -0
- package/src/team-member-change-workflow.ts +146 -0
- package/src/workbench-cli.ts +24 -4
- package/src/workspace.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-boot.d.ts","sourceRoot":"","sources":["../src/hosted-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;
|
|
1
|
+
{"version":3,"file":"hosted-boot.d.ts","sourceRoot":"","sources":["../src/hosted-boot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAmBH,OAAO,EAML,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAEtB,MAAM,kBAAkB,CAAA;AAKzB,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,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AAE,MAAM,KAAK,IAAI,CAAA;IAC7B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0ChF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,GAAG,EAAE,aAAa,CAAA;IAClB,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3B,MAAM,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAA;IACjC,uEAAuE;IACvE,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEhB"}
|
package/dist/hosted-boot.js
CHANGED
|
@@ -29,16 +29,18 @@
|
|
|
29
29
|
* absent: ORIZU_RUN_ID, ORIZU_WORKSPACE_ID (read back from the session), and the
|
|
30
30
|
* non-secret ANTHROPIC_API_KEY dummy placeholder (firewall brokers the real key).
|
|
31
31
|
*/
|
|
32
|
-
import { spawnSync } from 'child_process';
|
|
33
|
-
import {
|
|
32
|
+
import { spawn, spawnSync } from 'child_process';
|
|
33
|
+
import { randomUUID } from 'crypto';
|
|
34
|
+
import { closeSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeSync } from 'fs';
|
|
34
35
|
import { isValidCloudflareArtifactsGitRemote } from './cloudflare-artifacts-git-remote.js';
|
|
35
|
-
import { seedSessionCopy } from './hosted-session-seed.js';
|
|
36
|
+
import { cloneTeamIntoWorkTree, seedSessionCopy } from './hosted-session-seed.js';
|
|
36
37
|
import { AGENT_GIT_IDENTITY, BEARER_BASENAME, BOOT_CONTEXT_BASENAME, DEFAULT_CACHE_REFRESH_BUFFER_MS, HELPER_SCRIPT_BASENAME, REPO_CRED_CACHE_BASENAME, renderCredentialHelperScript, serializeBootContext, } from './hosted-runtime-assets.js';
|
|
37
38
|
import { INJECTED_ENV_VARS_ENV, closeHostedLoopSession, runHostedLoop, runHostedLoopTurn, startHostedLoopSession, } from './hosted-loop.js';
|
|
38
39
|
import { DEFAULT_EGRESS_CANARY_HOST, DEFAULT_HOSTED_MODEL } from './hosted-loop-lifecycle.js';
|
|
39
40
|
import { composeHostedAnswerPrompt } from './hosted-question.js';
|
|
40
41
|
import { resumeRunEventSink } from './hosted-run-event-sink.js';
|
|
41
42
|
import { stageOrizuSkill } from './hosted-skill-staging.js';
|
|
43
|
+
import { openHostedLiveChannel } from './hosted-live-channel.js';
|
|
42
44
|
/** Non-secret placeholder model key (firewall brokers the real org key on
|
|
43
45
|
* egress). Byte-for-byte the operator path's constant
|
|
44
46
|
* (packages/cli/src/hosted-session-cli.ts `ANTHROPIC_DUMMY_KEY` and the
|
|
@@ -314,7 +316,7 @@ function asPositiveNumber(value) {
|
|
|
314
316
|
/** GET the session (agent-capable, RLS-scoped) to learn its workspace, branch,
|
|
315
317
|
* task, and any existing run — the DO start body carries none of these. */
|
|
316
318
|
export async function resolveSession(opts) {
|
|
317
|
-
const body = await bearerJson(opts.fetchImpl, `${opts.baseUrl}/api/cli/sessions/${encodeURIComponent(opts.sessionId)}`, opts.bearer, opts.signal ? { signal: opts.signal } : {});
|
|
319
|
+
const body = await bearerJson(opts.fetchImpl, `${opts.baseUrl}/api/cli/sessions/${encodeURIComponent(opts.sessionId)}`, opts.bearer, { headers: { 'X-Orizu-Session-Seed-Protocol': '1' }, ...(opts.signal ? { signal: opts.signal } : {}) });
|
|
318
320
|
const session = (body.session ?? {});
|
|
319
321
|
const workspaceId = asString(session.workspaceId);
|
|
320
322
|
if (!workspaceId)
|
|
@@ -322,6 +324,8 @@ export async function resolveSession(opts) {
|
|
|
322
324
|
const repoBranch = asString(session.repoBranch);
|
|
323
325
|
if (!repoBranch)
|
|
324
326
|
throw new Error('session response carried no repoBranch (branch not provisioned)');
|
|
327
|
+
if (session.seedOrigin !== undefined && session.seedOrigin !== 'team' && session.seedOrigin !== 'session')
|
|
328
|
+
throw new Error('session response carried invalid seedOrigin');
|
|
325
329
|
const clientInfo = (session.clientInfo ?? {});
|
|
326
330
|
const initialTask = asString(clientInfo.task);
|
|
327
331
|
if (!initialTask)
|
|
@@ -374,6 +378,8 @@ export async function resolveSession(opts) {
|
|
|
374
378
|
pendingTurn: unfinishedRun ? pendingTurn : null,
|
|
375
379
|
interruptRequestedRunId: asString(session.interruptRequestedRunId),
|
|
376
380
|
agentSessionId: asString(session.agentSessionId),
|
|
381
|
+
// A server with copying switched off omits seedOrigin; no source is bound.
|
|
382
|
+
seedOrigin: session.seedOrigin === 'session' ? 'session' : 'team',
|
|
377
383
|
projectId: asString(session.projectId),
|
|
378
384
|
};
|
|
379
385
|
}
|
|
@@ -383,6 +389,44 @@ export const HOSTED_SESSION_DEFAULT_POLL_MS = 5_000;
|
|
|
383
389
|
export async function waitForNextHostedSessionRead(sleep, pollMs = HOSTED_SESSION_DEFAULT_POLL_MS) {
|
|
384
390
|
await sleep(pollMs);
|
|
385
391
|
}
|
|
392
|
+
function sleepUntil(signal) {
|
|
393
|
+
return (ms) => new Promise(resolve => {
|
|
394
|
+
if (signal.aborted) {
|
|
395
|
+
resolve();
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const timer = setTimeout(finish, ms);
|
|
399
|
+
const handleAbort = () => finish();
|
|
400
|
+
function finish() {
|
|
401
|
+
clearTimeout(timer);
|
|
402
|
+
signal.removeEventListener('abort', handleAbort);
|
|
403
|
+
resolve();
|
|
404
|
+
}
|
|
405
|
+
signal.addEventListener('abort', handleAbort, { once: true });
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
/** ORI-2200: wait for the next session read, or less when the coordinator says
|
|
409
|
+
* "check now". The read still decides what happens; a check alone does nothing. */
|
|
410
|
+
async function waitForReadOrCheck(opts) {
|
|
411
|
+
if (!opts.live) {
|
|
412
|
+
await waitForNextHostedSessionRead(opts.sleep ?? sleepUntil(opts.signal), opts.pollMs);
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
const woken = new AbortController();
|
|
416
|
+
const wait = AbortSignal.any([opts.signal, woken.signal]);
|
|
417
|
+
await Promise.race([
|
|
418
|
+
waitForNextHostedSessionRead(opts.sleep ?? sleepUntil(wait), opts.pollMs),
|
|
419
|
+
opts.live.nextCheck(wait),
|
|
420
|
+
]);
|
|
421
|
+
woken.abort();
|
|
422
|
+
}
|
|
423
|
+
/** The sandbox's live-socket pass route sits beside its agent-token route. */
|
|
424
|
+
export function deriveLiveSandboxPassUrl(agentTokenUrl) {
|
|
425
|
+
if (/\/agent-token\/?$/.test(agentTokenUrl)) {
|
|
426
|
+
return agentTokenUrl.replace(/\/agent-token\/?$/, '/live/sandbox-pass');
|
|
427
|
+
}
|
|
428
|
+
return `${agentTokenUrl.replace(/\/+$/, '')}/live/sandbox-pass`;
|
|
429
|
+
}
|
|
386
430
|
/** Ride the ALI-1757 session/pending-turn poll while one prompt is active.
|
|
387
431
|
* This uses the same additive session GET contract, but deliberately shares
|
|
388
432
|
* none of the between-turn credential cleanup or mint-on-401 behavior: the
|
|
@@ -396,20 +440,6 @@ export async function pollHostedSessionDuringTurn(opts) {
|
|
|
396
440
|
};
|
|
397
441
|
const readFile = opts.readFile ?? ((path) => readFileSync(path, 'utf8'));
|
|
398
442
|
const pollMs = opts.pollMs ?? HOSTED_SESSION_DEFAULT_POLL_MS;
|
|
399
|
-
const sleep = opts.sleep ?? ((ms) => new Promise(resolve => {
|
|
400
|
-
if (opts.signal.aborted) {
|
|
401
|
-
resolve();
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
const timer = setTimeout(finish, ms);
|
|
405
|
-
const handleAbort = () => finish();
|
|
406
|
-
function finish() {
|
|
407
|
-
clearTimeout(timer);
|
|
408
|
-
opts.signal.removeEventListener('abort', handleAbort);
|
|
409
|
-
resolve();
|
|
410
|
-
}
|
|
411
|
-
opts.signal.addEventListener('abort', handleAbort, { once: true });
|
|
412
|
-
}));
|
|
413
443
|
while (!opts.signal.aborted) {
|
|
414
444
|
try {
|
|
415
445
|
const latest = await resolveSession({
|
|
@@ -444,8 +474,9 @@ export async function pollHostedSessionDuringTurn(opts) {
|
|
|
444
474
|
// enter logs. A transient read failure cannot fail the running turn.
|
|
445
475
|
diagnose('hosted interrupt poll failed; retrying');
|
|
446
476
|
}
|
|
447
|
-
if (!opts.signal.aborted)
|
|
448
|
-
await
|
|
477
|
+
if (!opts.signal.aborted) {
|
|
478
|
+
await waitForReadOrCheck({ signal: opts.signal, pollMs, sleep: opts.sleep, live: opts.live });
|
|
479
|
+
}
|
|
449
480
|
}
|
|
450
481
|
}
|
|
451
482
|
/** Reuse an existing run or start one with the AGENT bearer (actor_type='agent'),
|
|
@@ -498,7 +529,7 @@ export async function resolveTeamRemote(opts) {
|
|
|
498
529
|
const url = `${opts.baseUrl}/api/cli/workspaces/${encodeURIComponent(opts.workspaceId)}/repo-token`;
|
|
499
530
|
const minted = await bearerJson(opts.fetchImpl, url, opts.bearer, {
|
|
500
531
|
method: 'POST',
|
|
501
|
-
headers: { 'Content-Type': 'application/json' },
|
|
532
|
+
headers: { 'Content-Type': 'application/json', 'X-Orizu-Session-Seed-Protocol': '1' },
|
|
502
533
|
body: JSON.stringify({ purpose: 'team_read', sessionId: opts.sessionId }),
|
|
503
534
|
});
|
|
504
535
|
const remote = asString(minted.remote);
|
|
@@ -548,10 +579,43 @@ export async function resolveRepo(opts) {
|
|
|
548
579
|
/** The credential-helper context for the team copy, used only to fill an
|
|
549
580
|
* empty session copy (ORI-2118). */
|
|
550
581
|
const TEAM_BOOT_CONTEXT_BASENAME = 'boot-team.json';
|
|
582
|
+
const defaultExecAsync = (cmd, args, opts) => new Promise(resolve => {
|
|
583
|
+
const child = spawn(cmd, args, { cwd: opts?.cwd, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
584
|
+
let stdout = '';
|
|
585
|
+
let stderr = '';
|
|
586
|
+
child.stdout.setEncoding('utf8').on('data', chunk => { stdout += chunk; });
|
|
587
|
+
child.stderr.setEncoding('utf8').on('data', chunk => { stderr += chunk; });
|
|
588
|
+
child.on('error', error => resolve({ status: 1, stdout, stderr: stderr || error.message }));
|
|
589
|
+
child.on('close', code => resolve({ status: code ?? 1, stdout, stderr }));
|
|
590
|
+
});
|
|
551
591
|
const defaultExec = (cmd, args, opts) => {
|
|
552
592
|
const res = spawnSync(cmd, args, { cwd: opts?.cwd, encoding: 'utf8' });
|
|
553
593
|
return { status: res.status ?? 1, stdout: res.stdout ?? '', stderr: res.stderr ?? '' };
|
|
554
594
|
};
|
|
595
|
+
/** ORI-2520: the repo on a woken disk must be this session's: a repository
|
|
596
|
+
* at the folder's top with the session's remote and a commit checked out
|
|
597
|
+
* (detached is fine). Which branch is checked out is not checked: each
|
|
598
|
+
* turn's save pushes the current commit to the session branch whatever is
|
|
599
|
+
* checked out, so an agent may have left another branch (or none) checked
|
|
600
|
+
* out. Returns that branch for the log. */
|
|
601
|
+
function assertWokenRepo(exec, workspaceDir, remote) {
|
|
602
|
+
const read = (...args) => {
|
|
603
|
+
const result = exec('git', ['-C', workspaceDir, ...args]);
|
|
604
|
+
return result.status === 0 ? result.stdout.trim() : null;
|
|
605
|
+
};
|
|
606
|
+
if (read('rev-parse', '--git-dir') !== '.git') {
|
|
607
|
+
throw new Error('woken disk: the repo folder holds no repository of its own');
|
|
608
|
+
}
|
|
609
|
+
// The configured value, not `remote get-url`, which applies url rewrites.
|
|
610
|
+
if (read('config', '--get', 'remote.origin.url') !== remote) {
|
|
611
|
+
throw new Error("woken disk: the repo's remote is not this session's");
|
|
612
|
+
}
|
|
613
|
+
// A clone cut off before any commit was checked out has no saved work.
|
|
614
|
+
if (read('rev-parse', '--verify', '--quiet', 'HEAD^{commit}') === null) {
|
|
615
|
+
throw new Error('woken disk: the repo has no commit checked out');
|
|
616
|
+
}
|
|
617
|
+
return read('rev-parse', '--abbrev-ref', 'HEAD') ?? 'no branch';
|
|
618
|
+
}
|
|
555
619
|
/** Values interpolated into git's credential.helper string / clone args must be
|
|
556
620
|
* benign. We pass everything via execFile-style arg arrays (no shell), but
|
|
557
621
|
* still reject anything with newlines/control chars as defense in depth. */
|
|
@@ -588,11 +652,28 @@ class HostedTurnFailure extends Error {
|
|
|
588
652
|
* provider fed by the same pull-mode source. Returns the loop's terminal status.
|
|
589
653
|
*/
|
|
590
654
|
export async function runHostedBoot(opts) {
|
|
655
|
+
// ORI-2200: the sandbox's live socket, opened once the boot first waits for
|
|
656
|
+
// work and closed however the boot ends.
|
|
657
|
+
const liveChannels = [];
|
|
658
|
+
const idleWait = new AbortController();
|
|
659
|
+
try {
|
|
660
|
+
return await runHostedBootWithLive(opts, liveChannels, idleWait.signal);
|
|
661
|
+
}
|
|
662
|
+
finally {
|
|
663
|
+
idleWait.abort();
|
|
664
|
+
for (const channel of liveChannels)
|
|
665
|
+
channel.close();
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
async function runHostedBootWithLive(opts, liveChannels, idleWaitSignal) {
|
|
591
669
|
const env = opts.env;
|
|
592
670
|
const processEnv = opts.processEnv ?? process.env;
|
|
593
671
|
const root = opts.root ?? process.cwd();
|
|
594
672
|
const fetchImpl = opts.fetchImpl ?? globalThis.fetch;
|
|
595
673
|
const exec = opts.exec ?? defaultExec;
|
|
674
|
+
// Non-blocking exec for git work that overlaps the boot (ORI-2512); an
|
|
675
|
+
// injected test `exec` serves both.
|
|
676
|
+
const execAsync = opts.exec ? async (cmd, args, o) => opts.exec(cmd, args, o) : defaultExecAsync;
|
|
596
677
|
const mkdirp = opts.mkdirp ?? ((path) => void mkdirSync(path, { recursive: true }));
|
|
597
678
|
const writeFile = opts.writeFile ??
|
|
598
679
|
((path, contents) => {
|
|
@@ -668,6 +749,22 @@ export async function runHostedBoot(opts) {
|
|
|
668
749
|
attemptTimeoutMs: turnStatusAttemptTimeoutMs,
|
|
669
750
|
});
|
|
670
751
|
}
|
|
752
|
+
// The coordinator says "check now" over this socket when someone presses
|
|
753
|
+
// Stop or sends a message, so the waits below need not run their full
|
|
754
|
+
// interval. Best effort: without it the regular reads still run.
|
|
755
|
+
let liveChannel = null;
|
|
756
|
+
const openLive = () => {
|
|
757
|
+
if (!liveChannel) {
|
|
758
|
+
liveChannel = openHostedLiveChannel({
|
|
759
|
+
sandboxPassUrl: deriveLiveSandboxPassUrl(env.agentTokenUrl),
|
|
760
|
+
bootSecret: env.bootSecret,
|
|
761
|
+
fetchImpl,
|
|
762
|
+
log,
|
|
763
|
+
});
|
|
764
|
+
liveChannels.push(liveChannel);
|
|
765
|
+
}
|
|
766
|
+
return liveChannel;
|
|
767
|
+
};
|
|
671
768
|
let consecutiveIdleSessionReadFailures = 0;
|
|
672
769
|
const recordIdleSessionReadFailure = (detail) => {
|
|
673
770
|
consecutiveIdleSessionReadFailures += 1;
|
|
@@ -677,7 +774,12 @@ export async function runHostedBoot(opts) {
|
|
|
677
774
|
log(`idle session resolution failed; retrying (${detail})`);
|
|
678
775
|
};
|
|
679
776
|
while (!opts.runLoop && !currentNonTerminalRunId) {
|
|
680
|
-
await
|
|
777
|
+
await waitForReadOrCheck({
|
|
778
|
+
signal: idleWaitSignal,
|
|
779
|
+
pollMs: Math.min(idlePollMs * 2 ** consecutiveIdleSessionReadFailures, idleReadBackoffCapMs),
|
|
780
|
+
sleep: opts.sleep,
|
|
781
|
+
live: openLive(),
|
|
782
|
+
});
|
|
681
783
|
try {
|
|
682
784
|
if (bearer.expiresAtMs !== null && bearer.expiresAtMs <= now() + 60_000) {
|
|
683
785
|
bearer = await pullAgentBearer({
|
|
@@ -786,54 +888,170 @@ export async function runHostedBoot(opts) {
|
|
|
786
888
|
writeFile(bootContextAbs, serializeBootContext(bootContext));
|
|
787
889
|
const helperValue = `!node ${helperScriptAbs} ${bootContextAbs}`;
|
|
788
890
|
// 4b — ORI-2118: a hosted session's Artifacts copy is created empty (forks
|
|
789
|
-
// of a busy team copy cannot be cloned)
|
|
790
|
-
// before
|
|
891
|
+
// of a busy team copy cannot be cloned). Fill it from the server-selected
|
|
892
|
+
// origin before cloning. Selected saved history is checked on retries too.
|
|
893
|
+
if (session.seedOrigin === 'session' && !isValidCloudflareArtifactsGitRemote(repo.cloneUrl)) {
|
|
894
|
+
throw new Error('selected session source requires an admitted Artifacts destination');
|
|
895
|
+
}
|
|
896
|
+
// ORI-2520: a woken sandbox boots on the disk it slept with (see step 5).
|
|
897
|
+
const wokenDisk = existsSync(workspaceDir) && readdirSync(workspaceDir).length > 0;
|
|
898
|
+
// Set when the working folder came from the team copy (ORI-2512); settles
|
|
899
|
+
// when the background fill of the session copy ends, and never rejects.
|
|
900
|
+
let sessionCopyFilled = null;
|
|
791
901
|
if (isValidCloudflareArtifactsGitRemote(repo.cloneUrl)) {
|
|
792
902
|
const credentialConfig = (helper) => [`credential.helper=${helper}`, 'credential.useHttpPath=true'];
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
903
|
+
const sourceRequestId = session.seedOrigin === 'session' ? randomUUID() : null;
|
|
904
|
+
const sourceCredentialFile = `${sessionDirAbs}/seed-source-credential`;
|
|
905
|
+
const sourceHelperFile = `${sessionDirAbs}/seed-source-helper.js`;
|
|
906
|
+
let seedFailed = false;
|
|
907
|
+
let seedError = null;
|
|
908
|
+
try {
|
|
909
|
+
const seedInput = {
|
|
910
|
+
seedOrigin: session.seedOrigin,
|
|
911
|
+
exec,
|
|
912
|
+
sessionRemote: repo.cloneUrl,
|
|
913
|
+
sessionGitConfig: credentialConfig(helperValue),
|
|
914
|
+
scratchDir: `${sessionDirAbs}/seed.git`,
|
|
915
|
+
resolveTeam: async () => {
|
|
916
|
+
if (sourceRequestId) {
|
|
917
|
+
const url = `${env.baseUrl}/api/cli/workspaces/${encodeURIComponent(workspaceId)}/repo-token`;
|
|
918
|
+
const credential = await bearerJson(fetchImpl, url, bearer.token, {
|
|
919
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
920
|
+
body: JSON.stringify({ purpose: 'source_read', sessionId: env.sessionId, requestId: sourceRequestId }),
|
|
921
|
+
});
|
|
922
|
+
const remote = asString(credential.remote);
|
|
923
|
+
const token = asString(credential.token);
|
|
924
|
+
const username = asString(credential.username);
|
|
925
|
+
if (credential.provider !== 'cloudflare_artifacts' || !remote || !isValidCloudflareArtifactsGitRemote(remote) || !token || !username || credential.requestId !== sourceRequestId) {
|
|
926
|
+
throw new Error('source_read response carried no valid admitted source credential');
|
|
927
|
+
}
|
|
928
|
+
assertSafeGitValue('sourceRemote', remote);
|
|
929
|
+
writeSecretFile(sourceCredentialFile, JSON.stringify({ remote, username, token }), writeFile);
|
|
930
|
+
writeFile(sourceHelperFile, String.raw `const fs = require('fs');
|
|
931
|
+
const c = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
|
|
932
|
+
let input = '';
|
|
933
|
+
process.stdin.on('data', d => input += d);
|
|
934
|
+
process.stdin.on('end', () => {
|
|
935
|
+
const fields = Object.fromEntries(input.trim().split('\n').map(line => {
|
|
936
|
+
const i = line.indexOf('='); return [line.slice(0, i), line.slice(i + 1)];
|
|
937
|
+
}));
|
|
938
|
+
const u = new URL(c.remote);
|
|
939
|
+
if (process.argv[3] === 'get' && fields.protocol === 'https' && fields.host === u.host && fields.path === u.pathname.slice(1)) {
|
|
940
|
+
process.stdout.write('username=' + c.username + '\npassword=' + c.token + '\n\n');
|
|
941
|
+
}
|
|
942
|
+
});`);
|
|
943
|
+
return { remote, gitConfig: ['credential.helper=', `credential.helper=!node ${sourceHelperFile} ${sourceCredentialFile}`, 'credential.useHttpPath=true'] };
|
|
944
|
+
}
|
|
945
|
+
const teamRemote = await resolveTeamRemote({ baseUrl: env.baseUrl, workspaceId, sessionId: env.sessionId, bearer: bearer.token, fetchImpl });
|
|
946
|
+
assertSafeGitValue('teamRemote', teamRemote);
|
|
947
|
+
const teamContextAbs = `${sessionDirAbs}/${TEAM_BOOT_CONTEXT_BASENAME}`;
|
|
948
|
+
writeFile(teamContextAbs, serializeBootContext({
|
|
949
|
+
...bootContext,
|
|
950
|
+
repoFullName: teamRemote,
|
|
951
|
+
host: new URL(teamRemote).host.toLowerCase(),
|
|
952
|
+
tokenPurposes: { primary: 'team_read', fallback: 'team_read' },
|
|
953
|
+
}));
|
|
954
|
+
return { remote: teamRemote, gitConfig: credentialConfig(`!node ${helperScriptAbs} ${teamContextAbs}`) };
|
|
955
|
+
},
|
|
956
|
+
};
|
|
957
|
+
// ORI-2512: a fresh team boot clones the team copy once as its working
|
|
958
|
+
// folder and fills the session copy from it in the background. Saved
|
|
959
|
+
// sources and woken disks keep the checked fill below.
|
|
960
|
+
if (session.seedOrigin !== 'session' && !wokenDisk) {
|
|
961
|
+
const cloned = await cloneTeamIntoWorkTree({ ...seedInput, execAsync, scratchDir: `${sessionDirAbs}/seed-work`, workTree: workspaceDir });
|
|
962
|
+
if (cloned.cloned) {
|
|
963
|
+
sessionCopyFilled = cloned.filled.then(filled => {
|
|
964
|
+
log(filled ? 'session copy filled from the team copy' : 'session copy fill did not land; the first save pushes the same history');
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
await seedSessionCopy(seedInput);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
catch (error) {
|
|
973
|
+
seedFailed = true;
|
|
974
|
+
seedError = error;
|
|
975
|
+
}
|
|
976
|
+
// Always request cleanup, including lost mint replies. The server tracks
|
|
977
|
+
// the request before issuance and refuses uncertain cleanup.
|
|
978
|
+
let cleanupFailed = false;
|
|
979
|
+
let cleanupError = null;
|
|
980
|
+
try {
|
|
981
|
+
try {
|
|
982
|
+
if (sourceRequestId) {
|
|
983
|
+
const cleanup = await bearerJson(fetchImpl, `${env.baseUrl}/api/cli/workspaces/${encodeURIComponent(workspaceId)}/repo-token`, bearer.token, {
|
|
984
|
+
method: 'DELETE', headers: { 'Content-Type': 'application/json' },
|
|
985
|
+
body: JSON.stringify({ purpose: 'source_read', sessionId: env.sessionId, requestId: sourceRequestId }),
|
|
986
|
+
});
|
|
987
|
+
if (cleanup.settled !== true || cleanup.outcome !== 'revoked') {
|
|
988
|
+
throw new Error('temporary source credential revocation could not be proved');
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
finally {
|
|
993
|
+
if (sourceRequestId) {
|
|
994
|
+
const removed = exec('rm', ['-f', '--', sourceCredentialFile, sourceHelperFile]);
|
|
995
|
+
if (removed.status !== 0)
|
|
996
|
+
throw new Error('temporary source credential cleanup failed');
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
catch (error) {
|
|
1001
|
+
cleanupFailed = true;
|
|
1002
|
+
cleanupError = error;
|
|
1003
|
+
}
|
|
1004
|
+
// A failed copy keeps its own reason; a cleanup failure is added, never
|
|
1005
|
+
// substituted, so the person sees why the copy stopped.
|
|
1006
|
+
if (seedFailed && cleanupFailed) {
|
|
1007
|
+
const reason = (error) => error instanceof Error ? error.message : String(error);
|
|
1008
|
+
throw new Error(`${reason(seedError)}; temporary source credential cleanup also failed: ${reason(cleanupError)}`);
|
|
1009
|
+
}
|
|
1010
|
+
if (seedFailed)
|
|
1011
|
+
throw seedError;
|
|
1012
|
+
if (cleanupFailed)
|
|
1013
|
+
throw cleanupError;
|
|
811
1014
|
}
|
|
812
1015
|
// 5 — Clone the session branch VIA the pull-mode credential helper (same
|
|
813
1016
|
// invocation the operator path makes; no token in the URL/config).
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
'
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
repo
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
1017
|
+
// ORI-2520: a woken sandbox boots on the disk it slept with, so this
|
|
1018
|
+
// session's repo is already here with any work since the last push. It is
|
|
1019
|
+
// reused; anything else in that folder is refused, never overwritten. An
|
|
1020
|
+
// empty folder is a fresh disk (the runtime image ships one) and is cloned
|
|
1021
|
+
// into.
|
|
1022
|
+
if (sessionCopyFilled) {
|
|
1023
|
+
log('working folder cloned from the team copy; filling the session copy in the background');
|
|
1024
|
+
}
|
|
1025
|
+
else if (wokenDisk) {
|
|
1026
|
+
const checkedOut = assertWokenRepo(exec, workspaceDir, repo.cloneUrl);
|
|
1027
|
+
log(`woken disk: reusing the repo (checked out: ${checkedOut})`);
|
|
1028
|
+
}
|
|
1029
|
+
else {
|
|
1030
|
+
const clone = exec('git', [
|
|
1031
|
+
'clone',
|
|
1032
|
+
'--depth',
|
|
1033
|
+
'1',
|
|
1034
|
+
'--branch',
|
|
1035
|
+
session.repoBranch,
|
|
1036
|
+
'-c',
|
|
1037
|
+
`credential.helper=${helperValue}`,
|
|
1038
|
+
'-c',
|
|
1039
|
+
'credential.useHttpPath=true',
|
|
1040
|
+
repo.cloneUrl,
|
|
1041
|
+
workspaceDir,
|
|
1042
|
+
]);
|
|
1043
|
+
if (clone.status !== 0) {
|
|
1044
|
+
const detail = (clone.stderr || clone.stdout || `exit ${clone.status}`).trim();
|
|
1045
|
+
throw new Error(`git clone failed: ${detail}`);
|
|
1046
|
+
}
|
|
830
1047
|
}
|
|
831
1048
|
// Persist the helper + agent identity repo-LOCAL for subsequent fetch/push.
|
|
832
1049
|
exec('git', ['-C', workspaceDir, 'config', 'credential.helper', helperValue]);
|
|
833
1050
|
exec('git', ['-C', workspaceDir, 'config', 'credential.useHttpPath', 'true']);
|
|
834
1051
|
exec('git', ['-C', workspaceDir, 'config', 'user.name', AGENT_GIT_IDENTITY.name]);
|
|
835
1052
|
exec('git', ['-C', workspaceDir, 'config', 'user.email', AGENT_GIT_IDENTITY.email]);
|
|
836
|
-
|
|
1053
|
+
if (!wokenDisk && !sessionCopyFilled)
|
|
1054
|
+
log(`cloned ${session.repoBranch}`);
|
|
837
1055
|
// 5b — Stage the orizu skill into the cloned repo so the agent discovers the
|
|
838
1056
|
// Orizu workflows (ALI-1059). SHARED with the operator path via `stageOrizuSkill`
|
|
839
1057
|
// (one resolution chain + the harvest-safe .git/info/exclude append). Non-fatal:
|
|
@@ -953,6 +1171,7 @@ export async function runHostedBoot(opts) {
|
|
|
953
1171
|
let currentBearer = bearer;
|
|
954
1172
|
let lastResult = { status: 'succeeded', agentSessionId: session.agentSessionId, installOk: true, error: null };
|
|
955
1173
|
let hostedTurnFailure = null;
|
|
1174
|
+
const live = openLive();
|
|
956
1175
|
try {
|
|
957
1176
|
for (;;) {
|
|
958
1177
|
assertSafeRunId(current.runId);
|
|
@@ -996,6 +1215,7 @@ export async function runHostedBoot(opts) {
|
|
|
996
1215
|
onDiagnostic: log,
|
|
997
1216
|
readFile,
|
|
998
1217
|
pollMs: idlePollMs,
|
|
1218
|
+
live,
|
|
999
1219
|
});
|
|
1000
1220
|
try {
|
|
1001
1221
|
lastResult = await runHostedLoopTurn(hostedLoopSession, {
|
|
@@ -1009,7 +1229,11 @@ export async function runHostedBoot(opts) {
|
|
|
1009
1229
|
redactSecretsList: [env.bootSecret],
|
|
1010
1230
|
bearerProvider: () => readFile(bearerFileAbs).trim(),
|
|
1011
1231
|
interruptSignal: promptInterruptController.signal,
|
|
1232
|
+
// ORI-2594: the reply text also goes over the coordinator socket.
|
|
1233
|
+
onLiveText: snapshot => live.sendText(snapshot),
|
|
1012
1234
|
onDiagnostic: log,
|
|
1235
|
+
// Never two pushes at once: the save waits for the fill.
|
|
1236
|
+
...(sessionCopyFilled ? { beforeSave: () => sessionCopyFilled } : {}),
|
|
1013
1237
|
onProgress: async () => {
|
|
1014
1238
|
if (now() < nextProgressAt)
|
|
1015
1239
|
return;
|
|
@@ -1054,8 +1278,14 @@ export async function runHostedBoot(opts) {
|
|
|
1054
1278
|
// budget. Refresh proactively near expiry and once on a 401. Exhausting
|
|
1055
1279
|
// the bounded agent-token pull is fatal and reported for the current run;
|
|
1056
1280
|
// other transient status-read failures retain the session and back off.
|
|
1281
|
+
// ORI-2517: the first read after a turn runs at once. A message the
|
|
1282
|
+
// person sent during the turn or its save, or a check that came in
|
|
1283
|
+
// meanwhile, is already waiting.
|
|
1284
|
+
let isFirstIdleRead = true;
|
|
1057
1285
|
for (;;) {
|
|
1058
|
-
|
|
1286
|
+
if (!isFirstIdleRead)
|
|
1287
|
+
await waitForReadOrCheck({ signal: idleWaitSignal, pollMs: idlePollMs, sleep: opts.sleep, live });
|
|
1288
|
+
isFirstIdleRead = false;
|
|
1059
1289
|
let pendingTurn = null;
|
|
1060
1290
|
try {
|
|
1061
1291
|
if (currentBearer.expiresAtMs !== null && currentBearer.expiresAtMs <= now() + 60_000) {
|
package/dist/hosted-harness.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export declare const HARNESS_EVENT_KINDS: {
|
|
|
73
73
|
readonly session_title: "session_title";
|
|
74
74
|
readonly egress_blocked: "egress_blocked";
|
|
75
75
|
readonly egress_allowed: "egress_allowed";
|
|
76
|
+
readonly work_saving: "work_saving";
|
|
76
77
|
readonly work_persisted: "work_persisted";
|
|
77
78
|
readonly work_none: "work_none";
|
|
78
79
|
readonly work_not_inspected: "work_not_inspected";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-harness.d.ts","sourceRoot":"","sources":["../src/hosted-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;8DAC8D;AAC9D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,YAAY,EAAE,MAAM,CAAA;IACpB,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAA;IACb,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,CAAA;IACvC,wEAAwE;IACxE,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,kEAAkE;IAClE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;CACxC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"hosted-harness.d.ts","sourceRoot":"","sources":["../src/hosted-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH;8DAC8D;AAC9D,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,SAAS,MAAM,EAA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CAAC,CAAA;AAErE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,OAAO,CAAC,EAAE,WAAW,CAAA;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,8EAA8E;IAC9E,KAAK,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAAE,cAAc,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrE;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,GAAG,aAAa,CAAC,YAAY,CAAC,CAAA;IAClF,2EAA2E;IAC3E,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB,gEAAgE;IAChE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B"}
|
package/dist/hosted-harness.js
CHANGED
|
@@ -51,6 +51,8 @@ export const HARNESS_EVENT_KINDS = {
|
|
|
51
51
|
// the end-of-run auto-harvest result (persisted/none/not-inspected/failed)
|
|
52
52
|
// and the headless question auto-handling record (question_auto_answered). They
|
|
53
53
|
// are ordinary structural events (never terminal), appended like any other.
|
|
54
|
+
// work_saving (ORI-2517) marks the model done and the save starting.
|
|
55
|
+
work_saving: 'work_saving',
|
|
54
56
|
work_persisted: 'work_persisted',
|
|
55
57
|
work_none: 'work_none',
|
|
56
58
|
work_not_inspected: 'work_not_inspected',
|
package/dist/hosted-harvest.d.ts
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* 1. `git status --porcelain` (plumbing) decides if the clone is dirty. Ignored
|
|
9
9
|
* files never appear in porcelain output, so a checkpoint is skipped when the
|
|
10
10
|
* only changes are ignored files.
|
|
11
|
-
* 2. If dirty: `git add -A
|
|
11
|
+
* 2. If dirty: `git add -A`, unstage the staged Orizu skill links
|
|
12
|
+
* (orizu-skill-links.ts), and if anything is still staged, `git commit` attributed to the agent identity
|
|
12
13
|
* (AGENT_GIT_IDENTITY) with message `checkpoint: run <runId> auto-harvest`.
|
|
13
14
|
* 3. If there is anything unpushed (a fresh checkpoint OR pre-existing local
|
|
14
15
|
* commits the agent made but did not push), push the exact HEAD SHA to the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-harvest.d.ts","sourceRoot":"","sources":["../src/hosted-harvest.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hosted-harvest.d.ts","sourceRoot":"","sources":["../src/hosted-harvest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAcH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK,iBAAiB,CAAA;AAExE,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,0EAA0E;IAC1E,aAAa,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,CAAA;IACxB,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,0EAA0E;IAC1E,M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