@agentxm/workspace-state 0.28.11 → 0.28.13
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/index.d.ts +22 -13
- package/dist/src/index.js +25 -16
- package/dist/src/live.d.ts +46 -0
- package/dist/src/live.js +60 -0
- package/dist/src/lockfile/lockfile.js +1 -2
- package/dist/src/settings/index.d.ts +1 -1
- package/dist/src/settings/index.js +1 -1
- package/dist/src/settings/schema.d.ts +12 -0
- package/dist/src/settings/schema.js +13 -1
- package/dist/src/settings/settings.d.ts +1 -1
- package/dist/src/settings/settings.js +1 -3
- package/dist/src/testing.d.ts +24 -0
- package/dist/src/testing.js +35 -0
- package/dist/src/utils/path-safety.d.ts +0 -5
- package/dist/src/utils/path-safety.js +1 -10
- package/dist/src/workspace/accepted-canonical-ref.d.ts +1 -1
- package/dist/src/workspace/accepted-canonical-ref.js +1 -1
- package/dist/src/workspace/accepted-resolution-writer.d.ts +42 -0
- package/dist/src/workspace/accepted-resolution-writer.js +67 -0
- package/dist/src/workspace/canonical-observation.js +1 -1
- package/dist/src/workspace/configured-entry.d.ts +11 -0
- package/dist/src/workspace/configured-entry.js +8 -0
- package/dist/src/workspace/create-symlink.d.ts +1 -1
- package/dist/src/workspace/create-symlink.js +1 -2
- package/dist/src/workspace/desired-identity.d.ts +19 -0
- package/dist/src/workspace/desired-identity.js +26 -0
- package/dist/src/workspace/desired-state-reader.d.ts +32 -0
- package/dist/src/workspace/desired-state-reader.js +56 -0
- package/dist/src/workspace/desired-state-writer.d.ts +46 -0
- package/dist/src/workspace/desired-state-writer.js +214 -0
- package/dist/src/workspace/entry-accessors.d.ts +50 -0
- package/dist/src/workspace/entry-accessors.js +41 -0
- package/dist/src/workspace/extension-paths-service.d.ts +33 -0
- package/dist/src/workspace/extension-paths-service.js +133 -0
- package/dist/src/workspace/location.d.ts +49 -0
- package/dist/src/workspace/location.js +85 -0
- package/dist/src/workspace/lockfile-reader.d.ts +41 -0
- package/dist/src/workspace/lockfile-reader.js +54 -0
- package/dist/src/workspace/materialized-file-target.d.ts +2 -2
- package/dist/src/workspace/materialized-file-target.js +2 -2
- package/dist/src/workspace/other-scope-reader.d.ts +34 -0
- package/dist/src/workspace/other-scope-reader.js +35 -0
- package/dist/src/workspace/paths.d.ts +2 -2
- package/dist/src/workspace/read-model/__fixtures__/test-layer.d.ts +1 -1
- package/dist/src/workspace/read-model/__fixtures__/test-layer.js +1 -1
- package/dist/src/workspace/read-model/discovery/skills.d.ts +1 -1
- package/dist/src/workspace/read-model/discovery/skills.js +1 -1
- package/dist/src/workspace/read-model/scanners/canonical-extensions.js +2 -2
- package/dist/src/workspace/read-model/scanners/mcp-config.js +1 -1
- package/dist/src/workspace/read-model/service.js +1 -1
- package/dist/src/workspace/read-model-record-readers.js +1 -1
- package/dist/src/workspace/remove-if-exists.d.ts +1 -1
- package/dist/src/workspace/remove-if-exists.js +1 -2
- package/dist/src/workspace/service-interface.d.ts +8 -60
- package/dist/src/workspace/service.d.ts +26 -1886
- package/dist/src/workspace/service.js +144 -1285
- package/dist/src/workspace/settings-reader.d.ts +59 -0
- package/dist/src/workspace/settings-reader.js +109 -0
- package/dist/src/workspace/settings-writer.d.ts +53 -0
- package/dist/src/workspace/settings-writer.js +90 -0
- package/dist/src/workspace/setup-scope-support.js +1 -1
- package/dist/src/workspace/shared.d.ts +24 -0
- package/dist/src/workspace/shared.js +20 -0
- package/dist/src/workspace/state-cells.d.ts +35 -0
- package/dist/src/workspace/state-cells.js +42 -0
- package/dist/src/workspace/subagent-paths.d.ts +49 -0
- package/dist/src/workspace/subagent-paths.js +26 -0
- package/dist/src/workspace/test-stubs.js +0 -11
- package/dist/src/workspace/workspace-records.d.ts +41 -0
- package/dist/src/workspace/workspace-records.js +43 -0
- package/package.json +14 -5
- package/dist/src/utils/atomic-write.d.ts +0 -67
- package/dist/src/utils/atomic-write.js +0 -71
- package/dist/src/workspace/configured-entry-resolution/types.d.ts +0 -32
- package/dist/src/workspace/configured-entry-resolution/types.js +0 -2
- package/dist/src/workspace/footprint-recorder.d.ts +0 -30
- package/dist/src/workspace/footprint-recorder.js +0 -32
- package/dist/src/workspace/mcp-entry-semantics.d.ts +0 -28
- package/dist/src/workspace/mcp-entry-semantics.js +0 -58
- package/dist/src/workspace/read-model/agent-presence.d.ts +0 -32
- package/dist/src/workspace/read-model/agent-presence.js +0 -21
- package/dist/src/workspace/scope-refusal.d.ts +0 -26
- package/dist/src/workspace/scope-refusal.js +0 -29
- package/dist/src/workspace/transaction.d.ts +0 -218
- package/dist/src/workspace/transaction.js +0 -177
package/package.json
CHANGED
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
"url": "https://github.com/agentxm/axm/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@agentxm/
|
|
8
|
-
"@agentxm/
|
|
7
|
+
"@agentxm/agent-integration": "^0.28.13",
|
|
8
|
+
"@agentxm/extension-content": "^0.28.13",
|
|
9
|
+
"@agentxm/extension-model": "^0.28.13",
|
|
10
|
+
"@agentxm/registry-protocol": "^0.28.13",
|
|
11
|
+
"@agentxm/workspace-transactions": "^0.28.13",
|
|
9
12
|
"effect": "4.0.0-rc.112",
|
|
10
13
|
"jsonc-parser": "^3.3.1",
|
|
11
14
|
"semver": "^7.8.5",
|
|
@@ -13,6 +16,7 @@
|
|
|
13
16
|
},
|
|
14
17
|
"description": "AXM workspace state kernel: settings, lockfile, read model, and desired-state vocabulary for the axm CLI. Unstable and unsupported — use the axm.sh CLI.",
|
|
15
18
|
"devDependencies": {
|
|
19
|
+
"@agentxm/specification-metadata": "^0.28.13",
|
|
16
20
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
17
21
|
"@effect/vitest": "4.0.0-rc.112",
|
|
18
22
|
"@types/semver": "^7.7.1",
|
|
@@ -29,6 +33,11 @@
|
|
|
29
33
|
"default": "./dist/src/index.js",
|
|
30
34
|
"types": "./dist/src/index.d.ts"
|
|
31
35
|
},
|
|
36
|
+
"./live": {
|
|
37
|
+
"axm-source": "./src/live.ts",
|
|
38
|
+
"default": "./dist/src/live.js",
|
|
39
|
+
"types": "./dist/src/live.d.ts"
|
|
40
|
+
},
|
|
32
41
|
"./testing": {
|
|
33
42
|
"axm-source": "./src/testing.ts",
|
|
34
43
|
"default": "./dist/src/testing.js",
|
|
@@ -49,11 +58,11 @@
|
|
|
49
58
|
"access": "public"
|
|
50
59
|
},
|
|
51
60
|
"repository": {
|
|
52
|
-
"directory": "packages/workspace-state",
|
|
61
|
+
"directory": "packages/core/workspace-state",
|
|
53
62
|
"type": "git",
|
|
54
63
|
"url": "https://github.com/agentxm/axm.git"
|
|
55
64
|
},
|
|
56
65
|
"sideEffects": false,
|
|
57
66
|
"type": "module",
|
|
58
|
-
"version": "0.28.
|
|
59
|
-
}
|
|
67
|
+
"version": "0.28.13"
|
|
68
|
+
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared atomic single-file replacement: write a uniquely named temp file in
|
|
3
|
-
* the target's directory, then rename it over the target.
|
|
4
|
-
*
|
|
5
|
-
* The temp file lives next to the target so the rename stays on one
|
|
6
|
-
* filesystem (and therefore atomic), and is removed on any failure or
|
|
7
|
-
* interruption. Temp names follow `<target>.tmp.<unique>`; sweepers that
|
|
8
|
-
* clean stale temps (e.g. the lockfile writer) rely on that prefix.
|
|
9
|
-
*
|
|
10
|
-
* @experimental This API is unstable and may change without notice.
|
|
11
|
-
*/
|
|
12
|
-
import * as Effect from "effect/Effect";
|
|
13
|
-
import type * as FileSystem from "effect/FileSystem";
|
|
14
|
-
import * as Path from "effect/Path";
|
|
15
|
-
import type { PlatformError } from "effect/PlatformError";
|
|
16
|
-
/**
|
|
17
|
-
* Step at which an atomic write failed. `check-target` and `read-target` can
|
|
18
|
-
* only occur with `skipIfUnchanged: "fail-on-read-error"`.
|
|
19
|
-
*
|
|
20
|
-
* @experimental This API is unstable and may change without notice.
|
|
21
|
-
*/
|
|
22
|
-
export type AtomicWriteStep = "check-target" | "read-target" | "write-temp" | "rename";
|
|
23
|
-
/**
|
|
24
|
-
* Failure passed to `mapError` so each call site keeps its own error shape.
|
|
25
|
-
*
|
|
26
|
-
* @experimental This API is unstable and may change without notice.
|
|
27
|
-
*/
|
|
28
|
-
export interface AtomicWriteFailure {
|
|
29
|
-
readonly step: AtomicWriteStep;
|
|
30
|
-
readonly targetPath: string;
|
|
31
|
-
readonly tempPath: string;
|
|
32
|
-
readonly cause: PlatformError;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Content-equality short-circuit mode: `fail-on-read-error` surfaces
|
|
36
|
-
* check/read failures via `mapError`; `ignore-read-errors` treats an
|
|
37
|
-
* unreadable target as changed and proceeds to write.
|
|
38
|
-
*
|
|
39
|
-
* @experimental This API is unstable and may change without notice.
|
|
40
|
-
*/
|
|
41
|
-
export type SkipIfUnchanged = "fail-on-read-error" | "ignore-read-errors";
|
|
42
|
-
/**
|
|
43
|
-
* Options for `writeFileAtomic`.
|
|
44
|
-
*
|
|
45
|
-
* @experimental This API is unstable and may change without notice.
|
|
46
|
-
*/
|
|
47
|
-
export interface WriteFileAtomicOptions<E> {
|
|
48
|
-
readonly targetPath: string;
|
|
49
|
-
readonly content: string | Uint8Array;
|
|
50
|
-
/** When set, leave the target untouched if it already has this content. */
|
|
51
|
-
readonly skipIfUnchanged?: SkipIfUnchanged;
|
|
52
|
-
/** Best-effort remove of the target before rename (Windows cannot always rename over an existing file). */
|
|
53
|
-
readonly removeTargetBeforeRename?: boolean;
|
|
54
|
-
readonly mapError: (failure: AtomicWriteFailure) => E;
|
|
55
|
-
}
|
|
56
|
-
export declare const atomicWriteTempPrefix: (targetPath: string) => string;
|
|
57
|
-
/** Remove only stale temp siblings belonging to one atomic-write target. */
|
|
58
|
-
export declare const sweepStaleAtomicWriteTemps: (fs: FileSystem.FileSystem, targetPath: string) => Effect.Effect<void, never, Path.Path>;
|
|
59
|
-
/**
|
|
60
|
-
* Atomically replace `targetPath` with `content` via a same-directory temp
|
|
61
|
-
* file and rename. Failures at each step are mapped by the caller, so error
|
|
62
|
-
* codes, details, and suggestions stay call-site specific.
|
|
63
|
-
*
|
|
64
|
-
* @experimental This API is unstable and may change without notice.
|
|
65
|
-
*/
|
|
66
|
-
export declare const writeFileAtomic: <E>(fs: FileSystem.FileSystem, options: WriteFileAtomicOptions<E>) => Effect.Effect<"written" | "skipped", E>;
|
|
67
|
-
//# sourceMappingURL=atomic-write.d.ts.map
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared atomic single-file replacement: write a uniquely named temp file in
|
|
3
|
-
* the target's directory, then rename it over the target.
|
|
4
|
-
*
|
|
5
|
-
* The temp file lives next to the target so the rename stays on one
|
|
6
|
-
* filesystem (and therefore atomic), and is removed on any failure or
|
|
7
|
-
* interruption. Temp names follow `<target>.tmp.<unique>`; sweepers that
|
|
8
|
-
* clean stale temps (e.g. the lockfile writer) rely on that prefix.
|
|
9
|
-
*
|
|
10
|
-
* @experimental This API is unstable and may change without notice.
|
|
11
|
-
*/
|
|
12
|
-
import * as Effect from "effect/Effect";
|
|
13
|
-
import * as Option from "effect/Option";
|
|
14
|
-
import * as Path from "effect/Path";
|
|
15
|
-
/** In-process sequence so concurrent fibers never share a temp path. */
|
|
16
|
-
let tempSequence = 0;
|
|
17
|
-
export const atomicWriteTempPrefix = (targetPath) => `${targetPath}.tmp.`;
|
|
18
|
-
/** Remove only stale temp siblings belonging to one atomic-write target. */
|
|
19
|
-
export const sweepStaleAtomicWriteTemps = (fs, targetPath) => Effect.gen(function* () {
|
|
20
|
-
const path = yield* Path.Path;
|
|
21
|
-
const parent = path.dirname(targetPath);
|
|
22
|
-
const filenamePrefix = `${path.basename(targetPath)}.tmp.`;
|
|
23
|
-
const entries = yield* fs.readDirectory(parent).pipe(Effect.orElseSucceed(() => []));
|
|
24
|
-
yield* Effect.forEach(entries.filter((entry) => entry.startsWith(filenamePrefix)), (entry) => fs.remove(path.join(parent, entry), { force: true }).pipe(Effect.ignore), { discard: true });
|
|
25
|
-
});
|
|
26
|
-
const makeTempPath = (targetPath) => {
|
|
27
|
-
tempSequence += 1;
|
|
28
|
-
const pid = typeof process === "object" ? process.pid.toString(36) : "x";
|
|
29
|
-
const random = Math.random().toString(36).slice(2, 8);
|
|
30
|
-
return `${atomicWriteTempPrefix(targetPath)}${pid}.${tempSequence.toString(36)}.${random}`;
|
|
31
|
-
};
|
|
32
|
-
const bytesEqual = (a, b) => a.length === b.length && a.every((value, index) => value === b[index]);
|
|
33
|
-
const targetHasContent = (fs, targetPath, content) => typeof content === "string"
|
|
34
|
-
? Effect.map(fs.readFileString(targetPath), (current) => current === content)
|
|
35
|
-
: Effect.map(fs.readFile(targetPath), (current) => bytesEqual(current, content));
|
|
36
|
-
/**
|
|
37
|
-
* Atomically replace `targetPath` with `content` via a same-directory temp
|
|
38
|
-
* file and rename. Failures at each step are mapped by the caller, so error
|
|
39
|
-
* codes, details, and suggestions stay call-site specific.
|
|
40
|
-
*
|
|
41
|
-
* @experimental This API is unstable and may change without notice.
|
|
42
|
-
*/
|
|
43
|
-
export const writeFileAtomic = (fs, options) => Effect.gen(function* () {
|
|
44
|
-
const { content, mapError, targetPath } = options;
|
|
45
|
-
const tempPath = makeTempPath(targetPath);
|
|
46
|
-
const fail = (step) => (cause) => mapError({ step, targetPath, tempPath, cause });
|
|
47
|
-
if (options.skipIfUnchanged === "fail-on-read-error") {
|
|
48
|
-
const exists = yield* fs.exists(targetPath).pipe(Effect.mapError(fail("check-target")));
|
|
49
|
-
if (exists) {
|
|
50
|
-
const unchanged = yield* targetHasContent(fs, targetPath, content).pipe(Effect.mapError(fail("read-target")));
|
|
51
|
-
if (unchanged)
|
|
52
|
-
return "skipped";
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
else if (options.skipIfUnchanged === "ignore-read-errors") {
|
|
56
|
-
const unchanged = yield* targetHasContent(fs, targetPath, content).pipe(Effect.option);
|
|
57
|
-
if (Option.isSome(unchanged) && unchanged.value)
|
|
58
|
-
return "skipped";
|
|
59
|
-
}
|
|
60
|
-
yield* Effect.gen(function* () {
|
|
61
|
-
yield* (typeof content === "string"
|
|
62
|
-
? fs.writeFileString(tempPath, content)
|
|
63
|
-
: fs.writeFile(tempPath, content)).pipe(Effect.mapError(fail("write-temp")));
|
|
64
|
-
if (options.removeTargetBeforeRename === true) {
|
|
65
|
-
yield* fs.remove(targetPath).pipe(Effect.ignore);
|
|
66
|
-
}
|
|
67
|
-
yield* fs.rename(tempPath, targetPath).pipe(Effect.mapError(fail("rename")));
|
|
68
|
-
}).pipe(Effect.ensuring(fs.remove(tempPath, { force: true }).pipe(Effect.ignore)));
|
|
69
|
-
return "written";
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=atomic-write.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type * as Option from "effect/Option";
|
|
2
|
-
import type { HookExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/hook";
|
|
3
|
-
import type { KnowledgeExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/knowledge";
|
|
4
|
-
import type { McpServerExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/mcp-server";
|
|
5
|
-
import type { PackRef } from "@agentxm/extension-model/unstable/extensions/refs/pack";
|
|
6
|
-
import type { RuleExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/rule";
|
|
7
|
-
import type { SkillExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/skill";
|
|
8
|
-
import type { SubagentExtensionRef } from "@agentxm/extension-model/unstable/extensions/refs/subagent";
|
|
9
|
-
import type { VersionRange } from "@agentxm/extension-model/unstable/version-constraints";
|
|
10
|
-
import type { NamedRegistryResolution } from "@agentxm/extension-model/unstable/sources/source-host-provider";
|
|
11
|
-
import type { ReleaseAgeBypassRecord, ReleaseAgeHoldbackRecord } from "@agentxm/registry-protocol/unstable/registry/release-age-policy";
|
|
12
|
-
export type ConfiguredEntryFailureReason = "entry-malformed" | "source-not-found" | "source-multiple-matches" | "source-resolution-failed" | "source-timeout";
|
|
13
|
-
export interface ResolvedConfiguredEntry<TRef> {
|
|
14
|
-
readonly ref: TRef;
|
|
15
|
-
readonly versionRange: Option.Option<VersionRange>;
|
|
16
|
-
readonly releaseAge?: {
|
|
17
|
-
readonly holdbacks: ReadonlyArray<ReleaseAgeHoldbackRecord>;
|
|
18
|
-
readonly bypasses: ReadonlyArray<ReleaseAgeBypassRecord>;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export type ResolvedConfiguredSkill = ResolvedConfiguredEntry<SkillExtensionRef>;
|
|
22
|
-
export type ResolvedConfiguredSubagent = ResolvedConfiguredEntry<SubagentExtensionRef>;
|
|
23
|
-
export type ResolvedConfiguredRule = ResolvedConfiguredEntry<RuleExtensionRef>;
|
|
24
|
-
export type ResolvedConfiguredHook = ResolvedConfiguredEntry<HookExtensionRef>;
|
|
25
|
-
export type ResolvedConfiguredKnowledge = ResolvedConfiguredEntry<KnowledgeExtensionRef>;
|
|
26
|
-
export type ResolvedConfiguredMcpServer = ResolvedConfiguredEntry<McpServerExtensionRef>;
|
|
27
|
-
export type ResolvedConfiguredPack = ResolvedConfiguredEntry<PackRef>;
|
|
28
|
-
export type ConfiguredRegistryResolution = NamedRegistryResolution & {
|
|
29
|
-
readonly versionRange: Option.Option<VersionRange>;
|
|
30
|
-
readonly acceptedVersion?: string;
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Footprint recorder — observed durable changes.
|
|
3
|
-
*
|
|
4
|
-
* The layers that touch durable state record what they actually committed,
|
|
5
|
-
* removed, or restored here; the operation resolution's footprint is these
|
|
6
|
-
* observations, not planner-claimed artifact paths. Recording is a no-op when
|
|
7
|
-
* no recorder is provided, so the writers stay usable outside an operation
|
|
8
|
-
* boundary.
|
|
9
|
-
*
|
|
10
|
-
* @experimental This API is unstable and may change without notice.
|
|
11
|
-
*/
|
|
12
|
-
import * as Effect from "effect/Effect";
|
|
13
|
-
import * as Ref from "effect/Ref";
|
|
14
|
-
import * as ServiceMap from "effect/Context";
|
|
15
|
-
export interface FootprintObservation {
|
|
16
|
-
/** Absolute path of the durable change. */
|
|
17
|
-
readonly path: string;
|
|
18
|
-
readonly change: "created" | "modified" | "removed" | "restored";
|
|
19
|
-
}
|
|
20
|
-
declare const FootprintRecorder_base: ServiceMap.ServiceClass<FootprintRecorder, "@agentxm/workspace-state/workspace/footprint-recorder/FootprintRecorder", {
|
|
21
|
-
readonly ref: Ref.Ref<ReadonlyArray<FootprintObservation>>;
|
|
22
|
-
}>;
|
|
23
|
-
export declare class FootprintRecorder extends FootprintRecorder_base {
|
|
24
|
-
}
|
|
25
|
-
/** Record one observed durable change. No-op without a recorder. */
|
|
26
|
-
export declare const recordFootprint: (observation: FootprintObservation) => Effect.Effect<void>;
|
|
27
|
-
export declare const readFootprint: Effect.Effect<ReadonlyArray<FootprintObservation>>;
|
|
28
|
-
export declare const makeFootprintRecorder: Effect.Effect<ServiceMap.Service.Shape<typeof FootprintRecorder>>;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=footprint-recorder.d.ts.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Footprint recorder — observed durable changes.
|
|
3
|
-
*
|
|
4
|
-
* The layers that touch durable state record what they actually committed,
|
|
5
|
-
* removed, or restored here; the operation resolution's footprint is these
|
|
6
|
-
* observations, not planner-claimed artifact paths. Recording is a no-op when
|
|
7
|
-
* no recorder is provided, so the writers stay usable outside an operation
|
|
8
|
-
* boundary.
|
|
9
|
-
*
|
|
10
|
-
* @experimental This API is unstable and may change without notice.
|
|
11
|
-
*/
|
|
12
|
-
import * as Effect from "effect/Effect";
|
|
13
|
-
import * as Option from "effect/Option";
|
|
14
|
-
import * as Ref from "effect/Ref";
|
|
15
|
-
import * as ServiceMap from "effect/Context";
|
|
16
|
-
export class FootprintRecorder extends ServiceMap.Service()("@agentxm/workspace-state/workspace/footprint-recorder/FootprintRecorder") {
|
|
17
|
-
}
|
|
18
|
-
/** Record one observed durable change. No-op without a recorder. */
|
|
19
|
-
export const recordFootprint = (observation) => Effect.gen(function* () {
|
|
20
|
-
const service = yield* Effect.serviceOption(FootprintRecorder);
|
|
21
|
-
if (Option.isNone(service))
|
|
22
|
-
return;
|
|
23
|
-
yield* Ref.update(service.value.ref, (entries) => [...entries, observation]);
|
|
24
|
-
});
|
|
25
|
-
export const readFootprint = Effect.gen(function* () {
|
|
26
|
-
const service = yield* Effect.serviceOption(FootprintRecorder);
|
|
27
|
-
if (Option.isNone(service))
|
|
28
|
-
return [];
|
|
29
|
-
return yield* Ref.get(service.value.ref);
|
|
30
|
-
});
|
|
31
|
-
export const makeFootprintRecorder = Ref.make([]).pipe(Effect.map((ref) => ({ ref })));
|
|
32
|
-
//# sourceMappingURL=footprint-recorder.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings-semantics predicates for MCP server entries.
|
|
3
|
-
*
|
|
4
|
-
* Pure derivations over workspace-owned MCP entry shapes: AXM
|
|
5
|
-
* ownership/provenance metadata embedded in agent-native MCP config entries.
|
|
6
|
-
*
|
|
7
|
-
* @experimental This API is unstable and may change without notice.
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import * as Option from "effect/Option";
|
|
11
|
-
import * as Schema from "effect/Schema";
|
|
12
|
-
export declare const AXM_MCP_METADATA_KEY = "x-axm";
|
|
13
|
-
export declare const AxmMcpMetadataSchema: Schema.Union<readonly [Schema.Struct<{
|
|
14
|
-
readonly v: Schema.Literal<1>;
|
|
15
|
-
readonly managed: Schema.Literal<true>;
|
|
16
|
-
readonly ext: Schema.NonEmptyString;
|
|
17
|
-
readonly source: Schema.Literal<"inline">;
|
|
18
|
-
}>, Schema.Struct<{
|
|
19
|
-
readonly v: Schema.Literal<1>;
|
|
20
|
-
readonly managed: Schema.Literal<true>;
|
|
21
|
-
readonly ext: Schema.NonEmptyString;
|
|
22
|
-
readonly source: Schema.Literals<readonly ["github", "gitlab", "bitbucket", "azurerepos", "git", "registry", "local", "workspace"]>;
|
|
23
|
-
readonly ref: Schema.NonEmptyString;
|
|
24
|
-
}>]>;
|
|
25
|
-
export type AxmMcpMetadata = typeof AxmMcpMetadataSchema.Type;
|
|
26
|
-
export declare const readAxmMcpMetadata: (entry: Readonly<Record<string, unknown>>) => Option.Option<AxmMcpMetadata>;
|
|
27
|
-
export declare const isAxmManagedMcpEntry: (entry: Readonly<Record<string, unknown>>) => boolean;
|
|
28
|
-
//# sourceMappingURL=mcp-entry-semantics.d.ts.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings-semantics predicates for MCP server entries.
|
|
3
|
-
*
|
|
4
|
-
* Pure derivations over workspace-owned MCP entry shapes: AXM
|
|
5
|
-
* ownership/provenance metadata embedded in agent-native MCP config entries.
|
|
6
|
-
*
|
|
7
|
-
* @experimental This API is unstable and may change without notice.
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import * as Option from "effect/Option";
|
|
11
|
-
import * as Schema from "effect/Schema";
|
|
12
|
-
export const AXM_MCP_METADATA_KEY = "x-axm";
|
|
13
|
-
const ResolvableSourceTypeSchema = Schema.Literals([
|
|
14
|
-
"github",
|
|
15
|
-
"gitlab",
|
|
16
|
-
"bitbucket",
|
|
17
|
-
"azurerepos",
|
|
18
|
-
"git",
|
|
19
|
-
"registry",
|
|
20
|
-
"local",
|
|
21
|
-
"workspace",
|
|
22
|
-
]);
|
|
23
|
-
export const AxmMcpMetadataSchema = Schema.Union([
|
|
24
|
-
Schema.Struct({
|
|
25
|
-
v: Schema.Literal(1),
|
|
26
|
-
managed: Schema.Literal(true),
|
|
27
|
-
ext: Schema.NonEmptyString,
|
|
28
|
-
source: Schema.Literal("inline"),
|
|
29
|
-
}),
|
|
30
|
-
Schema.Struct({
|
|
31
|
-
v: Schema.Literal(1),
|
|
32
|
-
managed: Schema.Literal(true),
|
|
33
|
-
ext: Schema.NonEmptyString,
|
|
34
|
-
source: ResolvableSourceTypeSchema,
|
|
35
|
-
ref: Schema.NonEmptyString,
|
|
36
|
-
}),
|
|
37
|
-
]).annotate({
|
|
38
|
-
identifier: "AxmMcpMetadata",
|
|
39
|
-
title: "AXM MCP Metadata",
|
|
40
|
-
description: "AXM ownership and provenance metadata for an agent MCP config entry.",
|
|
41
|
-
});
|
|
42
|
-
const decodeMetadataOption = Schema.decodeUnknownOption(AxmMcpMetadataSchema);
|
|
43
|
-
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
44
|
-
const hasValidRefShape = (metadata) => {
|
|
45
|
-
const source = metadata["source"];
|
|
46
|
-
const ref = metadata["ref"];
|
|
47
|
-
if (source === "inline")
|
|
48
|
-
return ref === undefined;
|
|
49
|
-
return typeof ref === "string" && ref.length > 0;
|
|
50
|
-
};
|
|
51
|
-
export const readAxmMcpMetadata = (entry) => {
|
|
52
|
-
const metadata = entry[AXM_MCP_METADATA_KEY];
|
|
53
|
-
if (!isRecord(metadata) || !hasValidRefShape(metadata))
|
|
54
|
-
return Option.none();
|
|
55
|
-
return decodeMetadataOption(metadata);
|
|
56
|
-
};
|
|
57
|
-
export const isAxmManagedMcpEntry = (entry) => Option.isSome(readAxmMcpMetadata(entry));
|
|
58
|
-
//# sourceMappingURL=mcp-entry-semantics.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent-presence probe port.
|
|
3
|
-
*
|
|
4
|
-
* The read model records which agents are present on the machine as a
|
|
5
|
-
* scoped fact. Detection itself is agent-surface integration, so the state
|
|
6
|
-
* layer declares only this optional port; the application composes an
|
|
7
|
-
* implementation backed by agent detection. An absent probe degrades to an
|
|
8
|
-
* empty presence set, matching the read model's existing failure
|
|
9
|
-
* degradation.
|
|
10
|
-
*
|
|
11
|
-
* @experimental This API is unstable and may change without notice.
|
|
12
|
-
*/
|
|
13
|
-
import * as Effect from "effect/Effect";
|
|
14
|
-
import * as ServiceMap from "effect/Context";
|
|
15
|
-
import type { AgentId } from "@agentxm/extension-model/unstable/agents/types";
|
|
16
|
-
import type { WorkspaceScope } from "@agentxm/extension-model/unstable/workspace-scope";
|
|
17
|
-
declare const AgentPresenceUnavailable_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
18
|
-
readonly _tag: "AgentPresenceUnavailable";
|
|
19
|
-
} & Readonly<A>;
|
|
20
|
-
/** Presence detection failed; the read model degrades to an empty set. */
|
|
21
|
-
export declare class AgentPresenceUnavailable extends AgentPresenceUnavailable_base<{
|
|
22
|
-
readonly message: string;
|
|
23
|
-
}> {
|
|
24
|
-
}
|
|
25
|
-
export interface AgentPresenceProbeService {
|
|
26
|
-
readonly detect: (root: string, scope: WorkspaceScope) => Effect.Effect<ReadonlySet<AgentId>, AgentPresenceUnavailable>;
|
|
27
|
-
}
|
|
28
|
-
declare const AgentPresenceProbe_base: ServiceMap.ServiceClass<AgentPresenceProbe, "@agentxm/workspace-state/workspace/read-model/agent-presence/AgentPresenceProbe", AgentPresenceProbeService>;
|
|
29
|
-
export declare class AgentPresenceProbe extends AgentPresenceProbe_base {
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=agent-presence.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent-presence probe port.
|
|
3
|
-
*
|
|
4
|
-
* The read model records which agents are present on the machine as a
|
|
5
|
-
* scoped fact. Detection itself is agent-surface integration, so the state
|
|
6
|
-
* layer declares only this optional port; the application composes an
|
|
7
|
-
* implementation backed by agent detection. An absent probe degrades to an
|
|
8
|
-
* empty presence set, matching the read model's existing failure
|
|
9
|
-
* degradation.
|
|
10
|
-
*
|
|
11
|
-
* @experimental This API is unstable and may change without notice.
|
|
12
|
-
*/
|
|
13
|
-
import * as Data from "effect/Data";
|
|
14
|
-
import * as Effect from "effect/Effect";
|
|
15
|
-
import * as ServiceMap from "effect/Context";
|
|
16
|
-
/** Presence detection failed; the read model degrades to an empty set. */
|
|
17
|
-
export class AgentPresenceUnavailable extends Data.TaggedError("AgentPresenceUnavailable") {
|
|
18
|
-
}
|
|
19
|
-
export class AgentPresenceProbe extends ServiceMap.Service()("@agentxm/workspace-state/workspace/read-model/agent-presence/AgentPresenceProbe") {
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=agent-presence.js.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Refusal messages for user-scope resolves.
|
|
3
|
-
*
|
|
4
|
-
* AXM writes subagents to a single workspace-relative directory,
|
|
5
|
-
* so every user-scope resolve is refused. The reason why differs, and the
|
|
6
|
-
* catalog knows which: an agent whose capability declares the `user` scope has
|
|
7
|
-
* a real user-scope surface AXM has not modeled, while an agent without it has
|
|
8
|
-
* nowhere to write at all. Reporting both as "does not support" mislabels the
|
|
9
|
-
* first group.
|
|
10
|
-
*
|
|
11
|
-
* @experimental This API is unstable and may change without notice.
|
|
12
|
-
*/
|
|
13
|
-
import type { AgentId } from "@agentxm/extension-model/unstable/agents/types";
|
|
14
|
-
/** Extension types AXM resolves per scope. */
|
|
15
|
-
export type UserScopedExtension = "subagents";
|
|
16
|
-
/**
|
|
17
|
-
* Why AXM will not resolve a user-scope directory for this agent.
|
|
18
|
-
*
|
|
19
|
-
* @experimental This API is unstable and may change without notice.
|
|
20
|
-
*/
|
|
21
|
-
export declare const userScopeRefusal: (args: {
|
|
22
|
-
readonly agentId: AgentId;
|
|
23
|
-
readonly agentName: string;
|
|
24
|
-
readonly type: UserScopedExtension;
|
|
25
|
-
}) => string;
|
|
26
|
-
//# sourceMappingURL=scope-refusal.d.ts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Refusal messages for user-scope resolves.
|
|
3
|
-
*
|
|
4
|
-
* AXM writes subagents to a single workspace-relative directory,
|
|
5
|
-
* so every user-scope resolve is refused. The reason why differs, and the
|
|
6
|
-
* catalog knows which: an agent whose capability declares the `user` scope has
|
|
7
|
-
* a real user-scope surface AXM has not modeled, while an agent without it has
|
|
8
|
-
* nowhere to write at all. Reporting both as "does not support" mislabels the
|
|
9
|
-
* first group.
|
|
10
|
-
*
|
|
11
|
-
* @experimental This API is unstable and may change without notice.
|
|
12
|
-
*/
|
|
13
|
-
import { AGENTS } from "@agentxm/extension-model/unstable/agents/registry";
|
|
14
|
-
const declaresUserScope = (agentId) => {
|
|
15
|
-
const descriptor = AGENTS[agentId];
|
|
16
|
-
if (descriptor === undefined)
|
|
17
|
-
return false;
|
|
18
|
-
const scopes = descriptor.subagents?.scopes;
|
|
19
|
-
return scopes?.includes("user") ?? false;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Why AXM will not resolve a user-scope directory for this agent.
|
|
23
|
-
*
|
|
24
|
-
* @experimental This API is unstable and may change without notice.
|
|
25
|
-
*/
|
|
26
|
-
export const userScopeRefusal = (args) => declaresUserScope(args.agentId)
|
|
27
|
-
? `AXM manages only the project-scope ${args.type} directory for ${args.agentName}; ${args.agentName} supports user-scope ${args.type} natively but AXM has not modeled that location`
|
|
28
|
-
: `${args.agentName} does not support user-scope ${args.type}`;
|
|
29
|
-
//# sourceMappingURL=scope-refusal.js.map
|