@agentxm/workspace-state 0.28.12 → 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 -219
- package/dist/src/workspace/transaction.js +0 -177
|
@@ -9,13 +9,10 @@
|
|
|
9
9
|
* @packageDocumentation
|
|
10
10
|
*/
|
|
11
11
|
import type * as Effect from "effect/Effect";
|
|
12
|
-
import type * as FileSystem from "effect/FileSystem";
|
|
13
12
|
import * as Layer from "effect/Layer";
|
|
14
13
|
import type * as Option from "effect/Option";
|
|
15
|
-
import type * as Path from "effect/Path";
|
|
16
|
-
import type * as Scope from "effect/Scope";
|
|
17
14
|
import * as ServiceMap from "effect/Context";
|
|
18
|
-
import type {
|
|
15
|
+
import type { WorkspaceSnapshotError } from "@agentxm/workspace-transactions";
|
|
19
16
|
import type { LockfileReadError, SettingsReadError, WorkspaceRootEscape } from "./read-model/errors.js";
|
|
20
17
|
import type { SettingsWriteError } from "../settings/errors.js";
|
|
21
18
|
import type { LockfileValidationError, LockfileWriteError } from "../lockfile/errors.js";
|
|
@@ -111,56 +108,6 @@ export type WorkspaceSettingsMutationFailure = WorkspaceSettingsReadFailure | Se
|
|
|
111
108
|
export type WorkspaceLockfileMutationFailure = WorkspaceLockfileReadFailure | LockfileValidationError | LockfileWriteError;
|
|
112
109
|
/** Coupled settings-and-lockfile mutation. */
|
|
113
110
|
export type WorkspaceStateMutationFailure = WorkspaceSettingsMutationFailure | WorkspaceLockfileMutationFailure;
|
|
114
|
-
export interface WorkspaceLifecycleTransactionArgs<A, E = never, R = never> {
|
|
115
|
-
readonly targets?: ReadonlyArray<string>;
|
|
116
|
-
readonly transition: Effect.Effect<A, E, R>;
|
|
117
|
-
readonly validate: (value: A) => Effect.Effect<void, E, R>;
|
|
118
|
-
/** Observes the start of rollback restoration; never controls it. */
|
|
119
|
-
readonly onRestorationStarted?: Effect.Effect<void>;
|
|
120
|
-
/**
|
|
121
|
-
* When `false`, the transaction does not claim the shared settings and
|
|
122
|
-
* lockfile targets up front. A closure-scoped plan apply passes `false`:
|
|
123
|
-
* each closure protects the shared files at its own first touch, so a
|
|
124
|
-
* closure's rollback restores only its own delta and never tears an
|
|
125
|
-
* earlier closure's settled commit out of the shared files. Defaults to
|
|
126
|
-
* `true` — a direct transaction is one closure and claims them itself.
|
|
127
|
-
*/
|
|
128
|
-
readonly claimDefaultTargets?: boolean;
|
|
129
|
-
}
|
|
130
|
-
export type WorkspaceTransactionRunner = <A, E = never, R = never>(args: WorkspaceLifecycleTransactionArgs<A, E, R>) => Effect.Effect<A, WorkspaceTransactionFailure | WorkspaceRestorationIncomplete | E, R>;
|
|
131
|
-
/** What a post-confirmation apply records as the workspace transition holder. */
|
|
132
|
-
export interface WorkspaceTransitionRequest {
|
|
133
|
-
readonly command: string;
|
|
134
|
-
readonly candidateId?: string;
|
|
135
|
-
/** Called once when the invocation starts waiting on another holder. */
|
|
136
|
-
readonly onWaiting?: (holder: Option.Option<TransitionLockHolder>) => Effect.Effect<void>;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Acquire the workspace transition for the calling scope's lifetime. Resolves
|
|
140
|
-
* `None` when acquired (release is a scope finalizer) and `Some(contention)`
|
|
141
|
-
* when the wait bound elapsed while another invocation held it.
|
|
142
|
-
*/
|
|
143
|
-
export type WorkspaceTransitionAcquirer = (request: WorkspaceTransitionRequest) => Effect.Effect<Option.Option<TransitionContention>, WorkspaceTransitionAcquireFailure, Scope.Scope>;
|
|
144
|
-
/**
|
|
145
|
-
* The two operations-side capabilities the workspace mutation facade
|
|
146
|
-
* receives by injection: the transaction runner and the transition acquirer.
|
|
147
|
-
*/
|
|
148
|
-
export interface WorkspaceTransactionCapabilities {
|
|
149
|
-
readonly runTransaction: WorkspaceTransactionRunner;
|
|
150
|
-
readonly acquireTransition: WorkspaceTransitionAcquirer;
|
|
151
|
-
}
|
|
152
|
-
/** Workspace paths the capability closures are anchored to. */
|
|
153
|
-
export interface WorkspaceTransactionCapabilityArgs {
|
|
154
|
-
readonly workspaceDir: string;
|
|
155
|
-
readonly settingsPath: string;
|
|
156
|
-
readonly lockPath: string;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Builds the injected capabilities for one workspace-service instance. The
|
|
160
|
-
* facade calls this once with its resolved paths; the implementation owns
|
|
161
|
-
* transaction admission and eliminates FileSystem/Path from the members.
|
|
162
|
-
*/
|
|
163
|
-
export type MakeWorkspaceTransactionCapabilities = (args: WorkspaceTransactionCapabilityArgs) => Effect.Effect<WorkspaceTransactionCapabilities, never, FileSystem.FileSystem | Path.Path>;
|
|
164
111
|
export interface WorkspaceReadModelRecords {
|
|
165
112
|
/** Deterministic inventory across every installable extension type or one selected type. */
|
|
166
113
|
readonly getInventory: (options: {
|
|
@@ -242,8 +189,13 @@ export interface SetKnowledgeArgs {
|
|
|
242
189
|
/**
|
|
243
190
|
* WorkspaceMutations mutation service interface.
|
|
244
191
|
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
192
|
+
* TRANSITIONAL: a thin composition over the narrow workspace-state services
|
|
193
|
+
* (`WorkspaceLocation`, `SettingsReader`, `LockfileReader`,
|
|
194
|
+
* `DesiredStateReader`, `WorkspaceRecords`, `ExtensionPaths`,
|
|
195
|
+
* `SettingsWriter`, `AcceptedResolutionWriter`, `DesiredStateWriter`),
|
|
196
|
+
* removed when the last domain package reads and writes through them.
|
|
197
|
+
* Transactions run through `runWorkspaceTransaction` from
|
|
198
|
+
* `@agentxm/workspace-transactions`.
|
|
247
199
|
*
|
|
248
200
|
* @experimental This API is unstable and may change without notice.
|
|
249
201
|
*/
|
|
@@ -256,10 +208,6 @@ export interface WorkspaceMutationsService {
|
|
|
256
208
|
readonly baseDir: string;
|
|
257
209
|
/** Explicit scope-aware paths for authoritative, runtime, and package state. */
|
|
258
210
|
readonly layout: WorkspaceLayout;
|
|
259
|
-
/** Run one coupled authoritative workspace transition under the workspace lock. */
|
|
260
|
-
readonly runTransaction: WorkspaceTransactionRunner;
|
|
261
|
-
/** Acquire the workspace transition for a post-confirmation apply. */
|
|
262
|
-
readonly acquireTransition: WorkspaceTransitionAcquirer;
|
|
263
211
|
/** Probe lockfile state for policy decisions: ok | missing | invalid. */
|
|
264
212
|
readonly getLockfileState: () => Effect.Effect<LockfileState, LockfileValidationError | WorkspaceRootEscape>;
|
|
265
213
|
/** Build desired extension state from settings and installed or prospective Pack manifests. */
|