@animalabs/agent-framework 0.24.0 → 0.24.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/dist/src/agent.d.ts +5 -0
- package/dist/src/agent.d.ts.map +1 -1
- package/dist/src/agent.js +6 -0
- package/dist/src/agent.js.map +1 -1
- package/dist/src/clock-rows.d.ts +115 -0
- package/dist/src/clock-rows.d.ts.map +1 -0
- package/dist/src/clock-rows.js +222 -0
- package/dist/src/clock-rows.js.map +1 -0
- package/dist/src/framework.d.ts +95 -5
- package/dist/src/framework.d.ts.map +1 -1
- package/dist/src/framework.js +485 -74
- package/dist/src/framework.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcpl/channel-registry.d.ts +9 -0
- package/dist/src/mcpl/channel-registry.d.ts.map +1 -1
- package/dist/src/mcpl/channel-registry.js +49 -6
- package/dist/src/mcpl/channel-registry.js.map +1 -1
- package/dist/src/mcpl/protocol-family.js +1 -1
- package/dist/src/modules/workspace/index.d.ts +9 -1
- package/dist/src/modules/workspace/index.d.ts.map +1 -1
- package/dist/src/modules/workspace/index.js +44 -8
- package/dist/src/modules/workspace/index.js.map +1 -1
- package/dist/src/timezone.d.ts +4 -2
- package/dist/src/timezone.d.ts.map +1 -1
- package/dist/src/timezone.js +4 -2
- package/dist/src/timezone.js.map +1 -1
- package/dist/src/tool-image-ledger.d.ts +46 -7
- package/dist/src/tool-image-ledger.d.ts.map +1 -1
- package/dist/src/tool-image-ledger.js +60 -7
- package/dist/src/tool-image-ledger.js.map +1 -1
- package/dist/src/tool-result-guard.d.ts +10 -8
- package/dist/src/tool-result-guard.d.ts.map +1 -1
- package/dist/src/tool-result-guard.js +12 -10
- package/dist/src/tool-result-guard.js.map +1 -1
- package/dist/src/tool-result-history.d.ts +2 -1
- package/dist/src/tool-result-history.d.ts.map +1 -1
- package/dist/src/tool-result-history.js +2 -1
- package/dist/src/tool-result-history.js.map +1 -1
- package/dist/src/tune-out/coordinator.js +3 -3
- package/dist/src/tune-out/coordinator.js.map +1 -1
- package/dist/src/types/agent.d.ts +27 -0
- package/dist/src/types/agent.d.ts.map +1 -1
- package/dist/src/types/events.d.ts +5 -1
- package/dist/src/types/events.d.ts.map +1 -1
- package/dist/src/types/framework.d.ts +7 -4
- package/dist/src/types/framework.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/agent.ts +6 -0
- package/src/clock-rows.ts +302 -0
- package/src/framework.ts +508 -79
- package/src/index.ts +2 -0
- package/src/mcpl/channel-registry.ts +54 -8
- package/src/mcpl/protocol-family.ts +1 -1
- package/src/modules/workspace/index.ts +47 -9
- package/src/timezone.ts +4 -2
- package/src/tool-image-ledger.ts +62 -8
- package/src/tool-result-guard.ts +12 -10
- package/src/tool-result-history.ts +2 -1
- package/src/tune-out/coordinator.ts +3 -3
- package/src/types/agent.ts +28 -0
- package/src/types/events.ts +5 -1
- package/src/types/framework.ts +7 -4
|
@@ -714,7 +714,7 @@ export function serverConfigProblems(config) {
|
|
|
714
714
|
const timeout = config.requestTimeoutMs;
|
|
715
715
|
if (binding.family === 'modern') {
|
|
716
716
|
if (timeout !== undefined && !(Number.isInteger(timeout) && timeout >= 1 && timeout <= MAX_TIMER_MS)) {
|
|
717
|
-
problems.push(`MCP server "${config.id}": requestTimeoutMs must be an integer from 1 to ${MAX_TIMER_MS} for a modern server (got ${
|
|
717
|
+
problems.push(`MCP server "${config.id}": requestTimeoutMs must be an integer from 1 to ${MAX_TIMER_MS} for a modern server (got ${asText(timeout)}); every modern call has a deadline`);
|
|
718
718
|
}
|
|
719
719
|
for (const path of mcplPolicyGrants(config)) {
|
|
720
720
|
problems.push(`MCP server "${config.id}": "${path}" asks for MCPL behaviour, which a modern MCP server cannot negotiate`);
|
|
@@ -843,9 +843,17 @@ export declare class WorkspaceModule implements Module {
|
|
|
843
843
|
* path, as a file tool names the one it acts on: a path the mount passes
|
|
844
844
|
* over by design is observed, as a sync naming it would observe it (#276),
|
|
845
845
|
* while a path in another mount's directory is refused before this, and
|
|
846
|
-
* passed over by any pass.
|
|
846
|
+
* passed over by any pass. Answers the pass's report on the path, and why
|
|
847
|
+
* the pass decided nothing where it did (undecidedOf), which leaves disk
|
|
848
|
+
* unchecked. The caller holds the mount's turn.
|
|
847
849
|
*/
|
|
848
850
|
private ensureSynced;
|
|
851
|
+
/**
|
|
852
|
+
* Why the workspace holds no entry at a path, after a pass over it that
|
|
853
|
+
* decided nothing: disk wasn't checked, so it may have a copy, and the same
|
|
854
|
+
* call made again checks it.
|
|
855
|
+
*/
|
|
856
|
+
private notCheckedYet;
|
|
849
857
|
/** Why the workspace holds no entry at a path, when disk explains it. */
|
|
850
858
|
private notInWorkspace;
|
|
851
859
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAEV,eAAe,EAoBhB,MAAM,YAAY,CAAC;AAuDpB,YAAY,EACV,eAAe,EACf,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,UAAU,EACV,SAAS,EACT,aAAa,EACb,WAAW,EACX,OAAO,EACP,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,SAAS,GACV,MAAM,YAAY,CAAC;AA4BpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,aAAa,GACb,mBAAmB,GACnB,WAAW,GACX,WAAW,GACX,SAAS,GACT,gBAAgB,GAChB,QAAQ,GACR,SAAS,CAAC;AAEd,kFAAkF;AAClF,MAAM,MAAM,kBAAkB,GAC1B,OAAO;AACT,4EAA4E;GAC1E,MAAM,GACN,UAAU,GACV,OAAO,GACP,eAAe,GACf,MAAM,GACN,OAAO,GACP,YAAY,GACZ,UAAU,GACV,MAAM,GACN,MAAM,CAAC;AAqBX;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAEzC,QAAQ,CAAC,IAAI,EAAE,sBAAsB;IAErC,QAAQ,CAAC,KAAK,EAAE,kBAAkB;IAClC,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM;IALzB,YACW,IAAI,EAAE,sBAAsB,EACrC,OAAO,EAAE,MAAM,EACN,KAAK,EAAE,kBAAkB;IAClC,4EAA4E;IACnE,KAAK,CAAC,EAAE,MAAM,YAAA,EAIxB;CACF;AAED,8CAA8C;AAC9C,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,sGAAsG;IACtG,SAAS,EAAE,OAAO,CAAC;IACnB,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,wGAAwG;IACxG,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,sBAAsB,CAAC;AACjE,OAAO,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CAAC,CA0B3D;YAEa,UAAU;IA6JxB;;;;OAIG;YACW,kBAAkB;IAiBhC;;;;;;;;;OASG;YACW,eAAe;IAQ7B;;;;;;;;;;;;OAYG;IACG,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B5D;IAED;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAOhC,qFAAqF;IACrF,OAAO,CAAC,qBAAqB;IAK7B;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IAsCvB,8EAA8E;IAC9E,OAAO,CAAC,yBAAyB;IAajC;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;CAgCrB;AA0BD;;;;;;;GAOG;AACH,wBAAsB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAcxJ"}
|
|
@@ -88,6 +88,15 @@ export class WorkspaceReadError extends Error {
|
|
|
88
88
|
this.name = 'WorkspaceReadError';
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Why a pass decided nothing, or null where it decided its paths. A pass gives
|
|
93
|
+
* up deciding, and reports no path, when the selected branch kept changing
|
|
94
|
+
* while it gathered, or when a sync's branch was no longer selected; it then
|
|
95
|
+
* carries no branchId, and the region it leaves incomplete says why.
|
|
96
|
+
*/
|
|
97
|
+
function undecidedOf(pass) {
|
|
98
|
+
return pass.branchId === undefined ? (pass.incomplete[0]?.reason ?? 'the pass decided nothing') : null;
|
|
99
|
+
}
|
|
91
100
|
function errnoOf(err) {
|
|
92
101
|
return typeof err === 'object' && err !== null && 'code' in err && typeof err.code === 'string'
|
|
93
102
|
? err.code
|
|
@@ -1971,10 +1980,10 @@ export class WorkspaceModule {
|
|
|
1971
1980
|
return this.bytesFromDisk(mount, relativePath, mountPrefixedPath, mount.config.maxFileSize ?? DEFAULT_MAX_FILE_SIZE);
|
|
1972
1981
|
const store = this.getStore();
|
|
1973
1982
|
return this.withMount(mount, async () => {
|
|
1974
|
-
await this.ensureSynced(mount, relativePath);
|
|
1983
|
+
const { report, undecided } = await this.ensureSynced(mount, relativePath);
|
|
1975
1984
|
const entry = store.treeGet(mount.treeStateId, relativePath);
|
|
1976
1985
|
if (!entry)
|
|
1977
|
-
return { error:
|
|
1986
|
+
return { error: undecided !== null ? this.notCheckedYet(mountPrefixedPath, undecided) : this.notInWorkspace(mountPrefixedPath, report) };
|
|
1978
1987
|
const blob = store.getBlob(entry.blobHash);
|
|
1979
1988
|
if (!blob)
|
|
1980
1989
|
return { error: `Blob not found for: ${mountPrefixedPath}` };
|
|
@@ -3339,14 +3348,24 @@ export class WorkspaceModule {
|
|
|
3339
3348
|
* path, as a file tool names the one it acts on: a path the mount passes
|
|
3340
3349
|
* over by design is observed, as a sync naming it would observe it (#276),
|
|
3341
3350
|
* while a path in another mount's directory is refused before this, and
|
|
3342
|
-
* passed over by any pass.
|
|
3351
|
+
* passed over by any pass. Answers the pass's report on the path, and why
|
|
3352
|
+
* the pass decided nothing where it did (undecidedOf), which leaves disk
|
|
3353
|
+
* unchecked. The caller holds the mount's turn.
|
|
3343
3354
|
*/
|
|
3344
3355
|
async ensureSynced(mount, relativePath) {
|
|
3345
3356
|
const store = this.getStore();
|
|
3346
3357
|
if (store.treeGet(mount.treeStateId, relativePath))
|
|
3347
|
-
return undefined;
|
|
3358
|
+
return { report: undefined, undecided: null };
|
|
3348
3359
|
const pass = await this.passUnlocked(mount, { kind: 'paths', paths: [relativePath] }, { named: true });
|
|
3349
|
-
return pass.reports.get(relativePath);
|
|
3360
|
+
return { report: pass.reports.get(relativePath), undecided: undecidedOf(pass) };
|
|
3361
|
+
}
|
|
3362
|
+
/**
|
|
3363
|
+
* Why the workspace holds no entry at a path, after a pass over it that
|
|
3364
|
+
* decided nothing: disk wasn't checked, so it may have a copy, and the same
|
|
3365
|
+
* call made again checks it.
|
|
3366
|
+
*/
|
|
3367
|
+
notCheckedYet(path, reason) {
|
|
3368
|
+
return `${this.notInWorkspace(path, { path, state: 'unverified', note: reason })} Make the same call again, which checks disk first.`;
|
|
3350
3369
|
}
|
|
3351
3370
|
/** Why the workspace holds no entry at a path, when disk explains it. */
|
|
3352
3371
|
notInWorkspace(path, report) {
|
|
@@ -3378,7 +3397,7 @@ export class WorkspaceModule {
|
|
|
3378
3397
|
return this.bytesOnDisk(mount, relativePath, path);
|
|
3379
3398
|
const store = this.getStore();
|
|
3380
3399
|
return this.withMount(mount, async () => {
|
|
3381
|
-
const report = await this.ensureSynced(mount, relativePath);
|
|
3400
|
+
const { report } = await this.ensureSynced(mount, relativePath);
|
|
3382
3401
|
const entry = store.treeGet(mount.treeStateId, relativePath);
|
|
3383
3402
|
if (!entry)
|
|
3384
3403
|
return { error: this.notInWorkspace(path, report) };
|
|
@@ -3744,6 +3763,8 @@ export class WorkspaceModule {
|
|
|
3744
3763
|
// As every file tool's pass does, it names the paths it acts on, so a
|
|
3745
3764
|
// file the mount passes over by design is observed (see PassOptions.named).
|
|
3746
3765
|
const pass = await this.passUnlocked(mount, { kind: 'paths', paths: [...targets.values()].map((target) => target.relativePath) }, { named: true });
|
|
3766
|
+
// A pass that decided nothing checked no file's disk copy.
|
|
3767
|
+
const undecided = undecidedOf(pass);
|
|
3747
3768
|
// Nothing below awaits until the commit's push.
|
|
3748
3769
|
const maxSize = mount.config.maxFileSize ?? DEFAULT_MAX_FILE_SIZE;
|
|
3749
3770
|
const hints = hintBudget();
|
|
@@ -3768,6 +3789,20 @@ export class WorkspaceModule {
|
|
|
3768
3789
|
// workspace didn't hold has no older copy, so taking it in needs no
|
|
3769
3790
|
// word.
|
|
3770
3791
|
const subject = tool === 'edit' ? 'the edit' : editList(target.edits);
|
|
3792
|
+
// A pass that decided nothing checked no copy on disk, held or not,
|
|
3793
|
+
// and took nothing in, so the edits would apply to text disk may
|
|
3794
|
+
// have moved past, on whichever branch is selected once it gave up.
|
|
3795
|
+
// They're refused, as a call made again can check.
|
|
3796
|
+
if (undecided !== null) {
|
|
3797
|
+
problems.push({
|
|
3798
|
+
kind: 'file',
|
|
3799
|
+
edits: target.edits,
|
|
3800
|
+
path: target.path,
|
|
3801
|
+
text: `${target.path} couldn't be checked against disk (${undecided}), so ${subject} changed nothing. Make the same call again, which checks disk first.`,
|
|
3802
|
+
whole: true,
|
|
3803
|
+
});
|
|
3804
|
+
continue;
|
|
3805
|
+
}
|
|
3771
3806
|
const whichCopy = (verb) => took('modified')
|
|
3772
3807
|
? `Disk's copy${tool === 'edit' ? '' : ` of ${target.path}`} had changed since the workspace last agreed with it, so it was taken in first, and ${subject} ${verb} that text.`
|
|
3773
3808
|
: report?.state === 'unverified'
|
|
@@ -4033,11 +4068,12 @@ export class WorkspaceModule {
|
|
|
4033
4068
|
let committed = false;
|
|
4034
4069
|
try {
|
|
4035
4070
|
return await this.withMount(mount, async () => {
|
|
4036
|
-
const report = await this.ensureSynced(mount, relativePath);
|
|
4071
|
+
const { report, undecided } = await this.ensureSynced(mount, relativePath);
|
|
4037
4072
|
await this.settleBeforeMutation(mount, relativePath);
|
|
4038
4073
|
const entry = store.treeGet(mount.treeStateId, relativePath);
|
|
4039
4074
|
if (!entry) {
|
|
4040
|
-
|
|
4075
|
+
const error = undecided !== null ? this.notCheckedYet(input.path, undecided) : this.notInWorkspace(input.path, report);
|
|
4076
|
+
return { success: false, error, isError: true };
|
|
4041
4077
|
}
|
|
4042
4078
|
const { refused, note } = await this.commitToolChange(mount, relativePath, { kind: 'remove', previousHash: entry.blobHash }, () => { committed = true; });
|
|
4043
4079
|
if (refused !== null)
|