@codeworksh/harness 0.6.0 → 0.7.0-canary.115.1.g7f5c4260
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/effect.d.mts +77 -51
- package/effect.mjs +71 -26
- package/effect.mjs.map +1 -1
- package/package.json +3 -3
package/effect.d.mts
CHANGED
|
@@ -28302,24 +28302,38 @@ type Provides = io_d_exports.SandboxIO.Provides;
|
|
|
28302
28302
|
/** A sandbox is any Layer providing the runtime services above. */
|
|
28303
28303
|
type Sandbox<E = never, RIn = never> = Layer.Layer<Provides, E, RIn>;
|
|
28304
28304
|
declare namespace git_d_exports {
|
|
28305
|
-
export {
|
|
28305
|
+
export { CloneInput, CommandError, git_d_exports as Git, Interface$16 as Interface, OperationError, Result$1 as Result, RevParse, Service$16 as Service, defaultLayer$5 as defaultLayer, layer$16 as layer, layerWith$5 as layerWith, resolvePath };
|
|
28306
28306
|
}
|
|
28307
|
-
declare const
|
|
28308
|
-
readonly
|
|
28309
|
-
readonly exitCode: Schema.optional<Schema.Finite>;
|
|
28310
|
-
readonly stderr: Schema.optional<Schema.String>;
|
|
28307
|
+
declare const CommandError_base: Schema.Class<CommandError, Schema.TaggedStruct<"Git.CommandError", {
|
|
28308
|
+
readonly args: Schema.$Array<Schema.String>;
|
|
28311
28309
|
readonly cause: Schema.optional<Schema.Defect>;
|
|
28312
28310
|
}>, import("effect/Cause").YieldableError>;
|
|
28313
|
-
|
|
28311
|
+
/** Git could not be run at all: the process failed to spawn. */
|
|
28312
|
+
declare class CommandError extends CommandError_base {}
|
|
28313
|
+
declare const OperationError_base: Schema.Class<OperationError, Schema.TaggedStruct<"Git.OperationError", {
|
|
28314
|
+
readonly operation: Schema.Literals<readonly ["init", "clone", "fetch", "checkout", "reset", "push"]>;
|
|
28315
|
+
readonly message: Schema.String;
|
|
28316
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
28317
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
28318
|
+
}>, import("effect/Cause").YieldableError>;
|
|
28319
|
+
/** A git operation that ran and failed; `message` is git's own stderr when it printed one. */
|
|
28320
|
+
declare class OperationError extends OperationError_base {}
|
|
28314
28321
|
interface Result$1 {
|
|
28315
28322
|
readonly exitCode: number;
|
|
28316
28323
|
readonly text: string;
|
|
28317
28324
|
readonly stderr: string;
|
|
28318
28325
|
}
|
|
28326
|
+
interface CloneInput {
|
|
28327
|
+
readonly remote: string;
|
|
28328
|
+
readonly target: string;
|
|
28329
|
+
readonly branch?: string;
|
|
28330
|
+
readonly depth?: number;
|
|
28331
|
+
readonly env?: Record<string, string>;
|
|
28332
|
+
}
|
|
28319
28333
|
type RevParse = "--show-toplevel" | "--git-dir" | "--git-common-dir";
|
|
28320
28334
|
interface Interface$16 {
|
|
28321
28335
|
/** Run `git <args>` in `directory`; fails only when the process cannot be spawned. */
|
|
28322
|
-
readonly exec: (directory: string, args: ReadonlyArray<string>) => Effect.Effect<Result$1,
|
|
28336
|
+
readonly exec: (directory: string, args: ReadonlyArray<string>) => Effect.Effect<Result$1, CommandError>;
|
|
28323
28337
|
readonly revParse: (directory: string, arg: RevParse) => Effect.Effect<string | undefined>;
|
|
28324
28338
|
readonly remote: (directory: string, name?: string) => Effect.Effect<string | undefined>;
|
|
28325
28339
|
readonly roots: (directory: string) => Effect.Effect<string[]>;
|
|
@@ -28328,22 +28342,22 @@ interface Interface$16 {
|
|
|
28328
28342
|
readonly dir: (directory: string) => Effect.Effect<string | undefined>;
|
|
28329
28343
|
readonly branch: (directory: string) => Effect.Effect<string | undefined>;
|
|
28330
28344
|
readonly remoteHead: (directory: string) => Effect.Effect<string | undefined>;
|
|
28331
|
-
|
|
28332
|
-
|
|
28333
|
-
|
|
28334
|
-
|
|
28335
|
-
|
|
28336
|
-
|
|
28337
|
-
readonly fetch: (directory: string) => Effect.Effect<
|
|
28338
|
-
readonly fetchBranch: (directory: string, branch: string) => Effect.Effect<
|
|
28339
|
-
readonly checkout: (directory: string, branch: string) => Effect.Effect<
|
|
28340
|
-
readonly reset: (directory: string, target: string) => Effect.Effect<
|
|
28345
|
+
/** A new repository in `directory`, which must exist; `branch` names its first branch. */
|
|
28346
|
+
readonly init: (directory: string, options?: {
|
|
28347
|
+
readonly branch?: string;
|
|
28348
|
+
}) => Effect.Effect<void, OperationError>;
|
|
28349
|
+
/** A full clone unless `depth` asks for a shallow one; `target` must not exist yet. */
|
|
28350
|
+
readonly clone: (input: CloneInput) => Effect.Effect<void, OperationError>;
|
|
28351
|
+
readonly fetch: (directory: string) => Effect.Effect<void, OperationError>;
|
|
28352
|
+
readonly fetchBranch: (directory: string, branch: string) => Effect.Effect<void, OperationError>;
|
|
28353
|
+
readonly checkout: (directory: string, branch: string) => Effect.Effect<void, OperationError>;
|
|
28354
|
+
readonly reset: (directory: string, target: string) => Effect.Effect<void, OperationError>;
|
|
28341
28355
|
readonly push: (input: {
|
|
28342
28356
|
readonly directory: string;
|
|
28343
28357
|
readonly refspec: string;
|
|
28344
28358
|
readonly remote?: string;
|
|
28345
28359
|
readonly env?: Record<string, string>;
|
|
28346
|
-
}) => Effect.Effect<
|
|
28360
|
+
}) => Effect.Effect<void, OperationError>;
|
|
28347
28361
|
}
|
|
28348
28362
|
declare const Service_base$14: Context.ServiceClass<Service$16, "@codeworksh/harness/git/git/Service", Interface$16>;
|
|
28349
28363
|
declare class Service$16 extends Service_base$14 {}
|
|
@@ -30038,18 +30052,13 @@ declare const parts: (message: Message.Message) => ({
|
|
|
30038
30052
|
type: "image";
|
|
30039
30053
|
data: string;
|
|
30040
30054
|
mimeType: string;
|
|
30041
|
-
} | {
|
|
30042
|
-
type: "thinking";
|
|
30043
|
-
thinking: string;
|
|
30044
|
-
thinkingSignature?: string;
|
|
30045
|
-
redacted?: boolean;
|
|
30046
30055
|
} | {
|
|
30047
30056
|
arguments: Record<string, any>;
|
|
30048
30057
|
callID: string;
|
|
30049
30058
|
name: string;
|
|
30050
30059
|
namespace?: string;
|
|
30051
|
-
|
|
30052
|
-
content
|
|
30060
|
+
result: {
|
|
30061
|
+
content: ({
|
|
30053
30062
|
type: "text";
|
|
30054
30063
|
text: string;
|
|
30055
30064
|
textSignature?: string;
|
|
@@ -30059,8 +30068,9 @@ declare const parts: (message: Message.Message) => ({
|
|
|
30059
30068
|
mimeType: string;
|
|
30060
30069
|
})[];
|
|
30061
30070
|
details?: any;
|
|
30071
|
+
isError: false;
|
|
30062
30072
|
};
|
|
30063
|
-
status: "
|
|
30073
|
+
status: "completed";
|
|
30064
30074
|
thoughtSignature?: string;
|
|
30065
30075
|
time: {
|
|
30066
30076
|
start: number;
|
|
@@ -30083,9 +30093,9 @@ declare const parts: (message: Message.Message) => ({
|
|
|
30083
30093
|
mimeType: string;
|
|
30084
30094
|
})[];
|
|
30085
30095
|
details?: any;
|
|
30086
|
-
isError:
|
|
30096
|
+
isError: true;
|
|
30087
30097
|
};
|
|
30088
|
-
status: "
|
|
30098
|
+
status: "error";
|
|
30089
30099
|
thoughtSignature?: string;
|
|
30090
30100
|
time: {
|
|
30091
30101
|
start: number;
|
|
@@ -30110,7 +30120,7 @@ declare const parts: (message: Message.Message) => ({
|
|
|
30110
30120
|
details?: any;
|
|
30111
30121
|
isError: true;
|
|
30112
30122
|
};
|
|
30113
|
-
status: "
|
|
30123
|
+
status: "skipped";
|
|
30114
30124
|
thoughtSignature?: string;
|
|
30115
30125
|
time: {
|
|
30116
30126
|
start: number;
|
|
@@ -30135,20 +30145,25 @@ declare const parts: (message: Message.Message) => ({
|
|
|
30135
30145
|
details?: any;
|
|
30136
30146
|
isError: true;
|
|
30137
30147
|
};
|
|
30138
|
-
status: "
|
|
30148
|
+
status: "aborted";
|
|
30139
30149
|
thoughtSignature?: string;
|
|
30140
30150
|
time: {
|
|
30141
30151
|
start: number;
|
|
30142
30152
|
end: number;
|
|
30143
30153
|
};
|
|
30144
30154
|
type: "toolCall";
|
|
30155
|
+
} | {
|
|
30156
|
+
type: "thinking";
|
|
30157
|
+
thinking: string;
|
|
30158
|
+
thinkingSignature?: string;
|
|
30159
|
+
redacted?: boolean;
|
|
30145
30160
|
} | {
|
|
30146
30161
|
arguments: Record<string, any>;
|
|
30147
30162
|
callID: string;
|
|
30148
30163
|
name: string;
|
|
30149
30164
|
namespace?: string;
|
|
30150
|
-
|
|
30151
|
-
content
|
|
30165
|
+
partial?: {
|
|
30166
|
+
content?: ({
|
|
30152
30167
|
type: "text";
|
|
30153
30168
|
text: string;
|
|
30154
30169
|
textSignature?: string;
|
|
@@ -30158,9 +30173,8 @@ declare const parts: (message: Message.Message) => ({
|
|
|
30158
30173
|
mimeType: string;
|
|
30159
30174
|
})[];
|
|
30160
30175
|
details?: any;
|
|
30161
|
-
isError: true;
|
|
30162
30176
|
};
|
|
30163
|
-
status: "
|
|
30177
|
+
status: "running";
|
|
30164
30178
|
thoughtSignature?: string;
|
|
30165
30179
|
time: {
|
|
30166
30180
|
start: number;
|
|
@@ -30343,18 +30357,13 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
30343
30357
|
type: "image";
|
|
30344
30358
|
data: string;
|
|
30345
30359
|
mimeType: string;
|
|
30346
|
-
} | {
|
|
30347
|
-
type: "thinking";
|
|
30348
|
-
thinking: string;
|
|
30349
|
-
thinkingSignature?: string;
|
|
30350
|
-
redacted?: boolean;
|
|
30351
30360
|
} | {
|
|
30352
30361
|
arguments: Record<string, any>;
|
|
30353
30362
|
callID: string;
|
|
30354
30363
|
name: string;
|
|
30355
30364
|
namespace?: string;
|
|
30356
|
-
|
|
30357
|
-
content
|
|
30365
|
+
result: {
|
|
30366
|
+
content: ({
|
|
30358
30367
|
type: "text";
|
|
30359
30368
|
text: string;
|
|
30360
30369
|
textSignature?: string;
|
|
@@ -30364,8 +30373,9 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
30364
30373
|
mimeType: string;
|
|
30365
30374
|
})[];
|
|
30366
30375
|
details?: any;
|
|
30376
|
+
isError: false;
|
|
30367
30377
|
};
|
|
30368
|
-
status: "
|
|
30378
|
+
status: "completed";
|
|
30369
30379
|
thoughtSignature?: string;
|
|
30370
30380
|
time: {
|
|
30371
30381
|
start: number;
|
|
@@ -30388,9 +30398,9 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
30388
30398
|
mimeType: string;
|
|
30389
30399
|
})[];
|
|
30390
30400
|
details?: any;
|
|
30391
|
-
isError:
|
|
30401
|
+
isError: true;
|
|
30392
30402
|
};
|
|
30393
|
-
status: "
|
|
30403
|
+
status: "error";
|
|
30394
30404
|
thoughtSignature?: string;
|
|
30395
30405
|
time: {
|
|
30396
30406
|
start: number;
|
|
@@ -30415,7 +30425,7 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
30415
30425
|
details?: any;
|
|
30416
30426
|
isError: true;
|
|
30417
30427
|
};
|
|
30418
|
-
status: "
|
|
30428
|
+
status: "skipped";
|
|
30419
30429
|
thoughtSignature?: string;
|
|
30420
30430
|
time: {
|
|
30421
30431
|
start: number;
|
|
@@ -30440,20 +30450,25 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
30440
30450
|
details?: any;
|
|
30441
30451
|
isError: true;
|
|
30442
30452
|
};
|
|
30443
|
-
status: "
|
|
30453
|
+
status: "aborted";
|
|
30444
30454
|
thoughtSignature?: string;
|
|
30445
30455
|
time: {
|
|
30446
30456
|
start: number;
|
|
30447
30457
|
end: number;
|
|
30448
30458
|
};
|
|
30449
30459
|
type: "toolCall";
|
|
30460
|
+
} | {
|
|
30461
|
+
type: "thinking";
|
|
30462
|
+
thinking: string;
|
|
30463
|
+
thinkingSignature?: string;
|
|
30464
|
+
redacted?: boolean;
|
|
30450
30465
|
} | {
|
|
30451
30466
|
arguments: Record<string, any>;
|
|
30452
30467
|
callID: string;
|
|
30453
30468
|
name: string;
|
|
30454
30469
|
namespace?: string;
|
|
30455
|
-
|
|
30456
|
-
content
|
|
30470
|
+
partial?: {
|
|
30471
|
+
content?: ({
|
|
30457
30472
|
type: "text";
|
|
30458
30473
|
text: string;
|
|
30459
30474
|
textSignature?: string;
|
|
@@ -30463,9 +30478,8 @@ declare const decodeMessage: (hydrated: HydratedEntry) => Effect.Effect<{
|
|
|
30463
30478
|
mimeType: string;
|
|
30464
30479
|
})[];
|
|
30465
30480
|
details?: any;
|
|
30466
|
-
isError: true;
|
|
30467
30481
|
};
|
|
30468
|
-
status: "
|
|
30482
|
+
status: "running";
|
|
30469
30483
|
thoughtSignature?: string;
|
|
30470
30484
|
time: {
|
|
30471
30485
|
start: number;
|
|
@@ -32041,6 +32055,18 @@ declare const login: (input: {
|
|
|
32041
32055
|
/** Remove the server's stored credentials. Returns whether there were any. */
|
|
32042
32056
|
declare const signOut: (store: Store, server: Pick<Server, "name" | "url">) => Effect.Effect<boolean, OAuthError, never>;
|
|
32043
32057
|
//#endregion
|
|
32058
|
+
//#region src/util/home.d.ts
|
|
32059
|
+
/**
|
|
32060
|
+
* Expand a leading `~`, leaving every other value untouched for the caller to resolve.
|
|
32061
|
+
*
|
|
32062
|
+
* The path module is the caller's, because the home directory is host-native while some
|
|
32063
|
+
* callers spell their paths POSIX-only. Anything beyond the tilde is not this function's
|
|
32064
|
+
* business: it never resolves, normalizes, or validates.
|
|
32065
|
+
*/
|
|
32066
|
+
export declare const expandTilde: (value: string, path: {
|
|
32067
|
+
readonly join: (...parts: ReadonlyArray<string>) => string;
|
|
32068
|
+
}) => string;
|
|
32069
|
+
//#endregion
|
|
32044
32070
|
//#region src/plugin/host.d.ts
|
|
32045
32071
|
declare const SetupError_base: Schema.Class<SetupError, Schema.TaggedStruct<"Plugin.SetupError", {
|
|
32046
32072
|
readonly pluginId: Schema.optional<Schema.String>;
|
|
@@ -32274,5 +32300,5 @@ type DateTimeUtcFromMillis = import__codeworksh_plugin_schema.DateTimeUtcFromMil
|
|
|
32274
32300
|
type EventSchema = import__codeworksh_plugin_event.EventSchema;
|
|
32275
32301
|
type SandboxError = import__codeworksh_plugin_sandbox_errors.SandboxError;
|
|
32276
32302
|
type optional = import__codeworksh_plugin_schema.optional;
|
|
32277
|
-
export { control_d_exports as Control, db_d_exports as Database, DateTimeUtcFromMillis, schema_d_exports as DocumentSchema, event_d_exports as Event, list_d_exports as EventList, registry_d_exports as EventRegistry, EventSchema, global_d_exports as Global, harness_d_exports as Harness, location_d_exports as Location, mcp_d_exports as Mcp, config_d_exports as McpConfig, error_d_exports as McpError, oauth_d_exports as McpOAuth, catalog_d_exports as ModelCatalog, index_d_exports as Plugin, project_d_exports as Project, schema_d_exports$1 as PromptSchema, run_d_exports as Runner, sandbox_d_exports as Sandbox, SandboxError, session_d_exports as Session, session_d_exports$1 as SessionStore, settings_d_exports as Settings, state_d_exports as State, schema_d_exports$2 as ThreadSchema, thread_d_exports as ThreadStore, tool_d_exports as Tool, optional };
|
|
32303
|
+
export { control_d_exports as Control, db_d_exports as Database, DateTimeUtcFromMillis, schema_d_exports as DocumentSchema, event_d_exports as Event, list_d_exports as EventList, registry_d_exports as EventRegistry, EventSchema, git_d_exports as Git, global_d_exports as Global, harness_d_exports as Harness, location_d_exports as Location, mcp_d_exports as Mcp, config_d_exports as McpConfig, error_d_exports as McpError, oauth_d_exports as McpOAuth, catalog_d_exports as ModelCatalog, index_d_exports as Plugin, project_d_exports as Project, schema_d_exports$1 as PromptSchema, run_d_exports as Runner, sandbox_d_exports as Sandbox, SandboxError, session_d_exports as Session, session_d_exports$1 as SessionStore, settings_d_exports as Settings, state_d_exports as State, schema_d_exports$2 as ThreadSchema, thread_d_exports as ThreadStore, tool_d_exports as Tool, optional };
|
|
32278
32304
|
//# sourceMappingURL=effect.d.mts.map
|
package/effect.mjs
CHANGED
|
@@ -3463,10 +3463,10 @@ var global_exports = /* @__PURE__ */ __exportAll({
|
|
|
3463
3463
|
app: () => app,
|
|
3464
3464
|
appConfigDir: () => appConfigDir,
|
|
3465
3465
|
authFile: () => authFile,
|
|
3466
|
-
defaultLayer: () => defaultLayer$
|
|
3466
|
+
defaultLayer: () => defaultLayer$4,
|
|
3467
3467
|
homeConfig: () => homeConfig,
|
|
3468
3468
|
layer: () => layer$27,
|
|
3469
|
-
layerWith: () => layerWith$
|
|
3469
|
+
layerWith: () => layerWith$2,
|
|
3470
3470
|
make: () => make$21,
|
|
3471
3471
|
resolve: () => resolve$5
|
|
3472
3472
|
});
|
|
@@ -3513,8 +3513,8 @@ const build = (input) => Effect.gen(function* () {
|
|
|
3513
3513
|
return Service$17.of(paths);
|
|
3514
3514
|
});
|
|
3515
3515
|
const layer$27 = Layer.effect(Service$17, build({}));
|
|
3516
|
-
const defaultLayer$
|
|
3517
|
-
const layerWith$
|
|
3516
|
+
const defaultLayer$4 = layer$27;
|
|
3517
|
+
const layerWith$2 = (input) => Layer.effect(Service$17, build(input));
|
|
3518
3518
|
//#endregion
|
|
3519
3519
|
//#region src/util/jsonc.ts
|
|
3520
3520
|
/** `line:column`, 1-based, for a parser offset into the source. */
|
|
@@ -5809,7 +5809,7 @@ var db_exports = /* @__PURE__ */ __exportAll({
|
|
|
5809
5809
|
Database: () => db_exports,
|
|
5810
5810
|
SqlClient: () => SqlClient$1,
|
|
5811
5811
|
SqlSchema: () => SqlSchema$1,
|
|
5812
|
-
defaultLayer: () => defaultLayer$
|
|
5812
|
+
defaultLayer: () => defaultLayer$3,
|
|
5813
5813
|
layer: () => layer$26,
|
|
5814
5814
|
locationConfig: () => locationConfig,
|
|
5815
5815
|
path: () => path$1,
|
|
@@ -5843,7 +5843,7 @@ const path$1 = Effect.fn("Database.path")(function* (data) {
|
|
|
5843
5843
|
const directory = data ?? (yield* resolve$5()).data;
|
|
5844
5844
|
return resolveDatabaseLocation(yield* locationConfig, directory);
|
|
5845
5845
|
});
|
|
5846
|
-
const defaultLayer$
|
|
5846
|
+
const defaultLayer$3 = Layer.unwrap(path$1().pipe(Effect.map(layer$26)));
|
|
5847
5847
|
//#endregion
|
|
5848
5848
|
//#region src/space/space.ts
|
|
5849
5849
|
/** `hash(env, location)` — no project component (D-SPACEID). */
|
|
@@ -7606,13 +7606,36 @@ const make$9 = () => {
|
|
|
7606
7606
|
*/
|
|
7607
7607
|
const services = (backend, identity) => Layer.provideMerge(io_exports.SandboxIO.mount(identity), Layer.provideMerge(Layer.merge(layer$24, layer$21()), backend));
|
|
7608
7608
|
/** Default sandbox: the real OS filesystem and processes, mounted at `cwd`. */
|
|
7609
|
-
const defaultLayer$
|
|
7609
|
+
const defaultLayer$2 = (cwd) => services(layer$23(), io_exports.SandboxIO.host(cwd));
|
|
7610
7610
|
//#endregion
|
|
7611
7611
|
//#region src/git/git.ts
|
|
7612
|
-
var
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7612
|
+
var git_exports = /* @__PURE__ */ __exportAll({
|
|
7613
|
+
CommandError: () => CommandError,
|
|
7614
|
+
Git: () => git_exports,
|
|
7615
|
+
OperationError: () => OperationError,
|
|
7616
|
+
Service: () => Service$15,
|
|
7617
|
+
defaultLayer: () => defaultLayer$1,
|
|
7618
|
+
layer: () => layer$18,
|
|
7619
|
+
layerWith: () => layerWith$1,
|
|
7620
|
+
resolvePath: () => resolvePath
|
|
7621
|
+
});
|
|
7622
|
+
/** Git could not be run at all: the process failed to spawn. */
|
|
7623
|
+
var CommandError = class extends Schema.TaggedError()("Git.CommandError", {
|
|
7624
|
+
args: Schema.Array(Schema.String),
|
|
7625
|
+
cause: Schema.optional(Schema.Defect())
|
|
7626
|
+
}) {};
|
|
7627
|
+
/** A git operation that ran and failed; `message` is git's own stderr when it printed one. */
|
|
7628
|
+
var OperationError = class extends Schema.TaggedError()("Git.OperationError", {
|
|
7629
|
+
operation: Schema.Literals([
|
|
7630
|
+
"init",
|
|
7631
|
+
"clone",
|
|
7632
|
+
"fetch",
|
|
7633
|
+
"checkout",
|
|
7634
|
+
"reset",
|
|
7635
|
+
"push"
|
|
7636
|
+
]),
|
|
7637
|
+
message: Schema.String,
|
|
7638
|
+
directory: Schema.optional(Schema.String),
|
|
7616
7639
|
cause: Schema.optional(Schema.Defect())
|
|
7617
7640
|
}) {};
|
|
7618
7641
|
var Service$15 = class extends Context.Service()("@codeworksh/harness/git/git/Service") {};
|
|
@@ -7625,8 +7648,8 @@ const layer$18 = Layer.effect(Service$15, Effect.gen(function* () {
|
|
|
7625
7648
|
exitCode: result.exitCode,
|
|
7626
7649
|
text: result.stdout,
|
|
7627
7650
|
stderr: result.stderr
|
|
7628
|
-
})), Effect.mapError((cause) => new
|
|
7629
|
-
|
|
7651
|
+
})), Effect.mapError((cause) => new CommandError({
|
|
7652
|
+
args: [...args],
|
|
7630
7653
|
cause
|
|
7631
7654
|
})));
|
|
7632
7655
|
const run = (cwd) => (args) => execute(cwd)(args).pipe(Effect.orElseSucceed(() => ({
|
|
@@ -7691,37 +7714,47 @@ const layer$18 = Layer.effect(Service$15, Effect.gen(function* () {
|
|
|
7691
7714
|
if (result.exitCode !== 0) return void 0;
|
|
7692
7715
|
return result.text.trim().replace(/^refs\/remotes\//, "") || void 0;
|
|
7693
7716
|
});
|
|
7694
|
-
const
|
|
7717
|
+
const operation = (name, directory, args, options) => execute(directory)(args, options).pipe(Effect.mapError((cause) => new OperationError({
|
|
7718
|
+
operation: name,
|
|
7719
|
+
directory,
|
|
7720
|
+
message: `Could not run git ${name}`,
|
|
7721
|
+
cause
|
|
7722
|
+
})), Effect.flatMap((result) => result.exitCode === 0 ? Effect.void : Effect.fail(new OperationError({
|
|
7723
|
+
operation: name,
|
|
7724
|
+
directory,
|
|
7725
|
+
message: result.stderr.trim() || result.text.trim() || `git ${name} failed`
|
|
7726
|
+
}))));
|
|
7727
|
+
const init = Effect.fn("Git.init")((directory, options) => operation("init", directory, ["init", ...options?.branch ? [`--initial-branch=${options.branch}`] : []]));
|
|
7728
|
+
const clone = Effect.fn("Git.clone")((input) => operation("clone", posix.dirname(input.target), [
|
|
7695
7729
|
"clone",
|
|
7696
|
-
"--depth",
|
|
7697
|
-
String(input.depth ?? 100),
|
|
7730
|
+
...input.depth === void 0 ? [] : ["--depth", String(input.depth)],
|
|
7698
7731
|
...input.branch ? ["--branch", input.branch] : [],
|
|
7699
7732
|
"--",
|
|
7700
7733
|
input.remote,
|
|
7701
7734
|
input.target
|
|
7702
|
-
]));
|
|
7703
|
-
const fetch = Effect.fn("Git.fetch")((directory) =>
|
|
7735
|
+
], input.env === void 0 ? void 0 : { env: input.env }));
|
|
7736
|
+
const fetch = Effect.fn("Git.fetch")((directory) => operation("fetch", directory, [
|
|
7704
7737
|
"fetch",
|
|
7705
7738
|
"--all",
|
|
7706
7739
|
"--prune"
|
|
7707
7740
|
]));
|
|
7708
|
-
const fetchBranch = Effect.fn("Git.fetchBranch")((directory, branch) =>
|
|
7741
|
+
const fetchBranch = Effect.fn("Git.fetchBranch")((directory, branch) => operation("fetch", directory, [
|
|
7709
7742
|
"fetch",
|
|
7710
7743
|
"origin",
|
|
7711
7744
|
`+refs/heads/${branch}:refs/remotes/origin/${branch}`
|
|
7712
7745
|
]));
|
|
7713
|
-
const checkout = Effect.fn("Git.checkout")((directory, branch) =>
|
|
7746
|
+
const checkout = Effect.fn("Git.checkout")((directory, branch) => operation("checkout", directory, [
|
|
7714
7747
|
"checkout",
|
|
7715
7748
|
"-B",
|
|
7716
7749
|
branch,
|
|
7717
7750
|
`origin/${branch}`
|
|
7718
7751
|
]));
|
|
7719
|
-
const reset = Effect.fn("Git.reset")((directory, target) =>
|
|
7752
|
+
const reset = Effect.fn("Git.reset")((directory, target) => operation("reset", directory, [
|
|
7720
7753
|
"reset",
|
|
7721
7754
|
"--hard",
|
|
7722
7755
|
target
|
|
7723
7756
|
]));
|
|
7724
|
-
const push = Effect.fn("Git.push")((input) =>
|
|
7757
|
+
const push = Effect.fn("Git.push")((input) => operation("push", input.directory, [
|
|
7725
7758
|
"push",
|
|
7726
7759
|
"--",
|
|
7727
7760
|
input.remote ?? "origin",
|
|
@@ -7737,6 +7770,7 @@ const layer$18 = Layer.effect(Service$15, Effect.gen(function* () {
|
|
|
7737
7770
|
dir,
|
|
7738
7771
|
branch,
|
|
7739
7772
|
remoteHead,
|
|
7773
|
+
init,
|
|
7740
7774
|
clone,
|
|
7741
7775
|
fetch,
|
|
7742
7776
|
fetchBranch,
|
|
@@ -7745,6 +7779,17 @@ const layer$18 = Layer.effect(Service$15, Effect.gen(function* () {
|
|
|
7745
7779
|
push
|
|
7746
7780
|
});
|
|
7747
7781
|
}));
|
|
7782
|
+
/**
|
|
7783
|
+
* Run git inside the given sandbox — local, remote, or virtual. Every command
|
|
7784
|
+
* goes through the sandbox shell, so git never executes anywhere other than
|
|
7785
|
+
* where the caller's files live. Discovery and identity live in `repo/`,
|
|
7786
|
+
* worktree management in `worktree/`; this module is only the command runner.
|
|
7787
|
+
*
|
|
7788
|
+
* The sandbox must have a real `git` binary. A VFS-backed shell (`EnvBash`) has
|
|
7789
|
+
* builtins only, so commands there exit 127 and every probe reports nothing.
|
|
7790
|
+
*/
|
|
7791
|
+
const layerWith$1 = (sandbox) => layer$18.pipe(Layer.provide(sandbox));
|
|
7792
|
+
const defaultLayer$1 = (rootPath) => layerWith$1(defaultLayer$2(rootPath));
|
|
7748
7793
|
/** Resolve a (possibly relative) git output path against `cwd`, trimming the trailing newline. */
|
|
7749
7794
|
function resolvePath(cwd, value) {
|
|
7750
7795
|
const trimmed = value.replace(/[\r\n]+$/, "");
|
|
@@ -8119,8 +8164,8 @@ const rename = Effect.fn("Project.rename")(function* (input) {
|
|
|
8119
8164
|
});
|
|
8120
8165
|
});
|
|
8121
8166
|
/** Takes an assembled sandbox — local or remote — not a local backend. */
|
|
8122
|
-
const layerWith = (sandbox) => layer$15.pipe(Layer.provide(Layer.mergeAll(layer$17, layer$16, layer$25)), Layer.provide(layer$18), Layer.provide(sandbox), Layer.provide(defaultLayer$
|
|
8123
|
-
const defaultLayer = (path) => layerWith(defaultLayer$
|
|
8167
|
+
const layerWith = (sandbox) => layer$15.pipe(Layer.provide(Layer.mergeAll(layer$17, layer$16, layer$25)), Layer.provide(layer$18), Layer.provide(sandbox), Layer.provide(defaultLayer$3));
|
|
8168
|
+
const defaultLayer = (path) => layerWith(defaultLayer$2(path));
|
|
8124
8169
|
//#endregion
|
|
8125
8170
|
//#region src/location/location.ts
|
|
8126
8171
|
var location_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -16265,7 +16310,7 @@ var harness_exports = /* @__PURE__ */ __exportAll({
|
|
|
16265
16310
|
const layer = (options = {}) => Layer.unwrap(Effect.gen(function* () {
|
|
16266
16311
|
const hostCwd = options.hostCwd ?? process.cwd();
|
|
16267
16312
|
const paths = yield* resolve$5(options.home === void 0 ? {} : { home: hostPath.resolve(hostCwd, expandTilde(options.home, hostPath)) });
|
|
16268
|
-
const global = layerWith$
|
|
16313
|
+
const global = layerWith$2(paths);
|
|
16269
16314
|
const settingsOptions = options.userConfigDir === void 0 ? {} : { userConfigDir: userConfigDir(options.userConfigDir, hostCwd) };
|
|
16270
16315
|
const config = yield* load$3({
|
|
16271
16316
|
...settingsOptions,
|
|
@@ -16804,6 +16849,6 @@ var DateTimeUtcFromMillis = schema_exports$9.DateTimeUtcFromMillis;
|
|
|
16804
16849
|
var EventSchema = schema_exports$11.EventSchema;
|
|
16805
16850
|
var SandboxError = errors_exports.SandboxError;
|
|
16806
16851
|
var optional = schema_exports$9.optional;
|
|
16807
|
-
export { control_exports as Control, db_exports as Database, DateTimeUtcFromMillis, schema_exports as DocumentSchema, event_exports as Event, list_exports as EventList, registry_exports as EventRegistry, EventSchema, global_exports as Global, harness_exports as Harness, location_exports as Location, mcp_exports as Mcp, config_exports as McpConfig, error_exports as McpError, oauth_exports as McpOAuth, catalog_exports as ModelCatalog, plugin_exports as Plugin, project_exports as Project, schema_exports$1 as PromptSchema, run_exports as Runner, sandbox_exports as Sandbox, SandboxError, session_exports as Session, session_exports$1 as SessionStore, settings_exports as Settings, state_exports as State, schema_exports$2 as ThreadSchema, thread_exports as ThreadStore, tool_exports as Tool, optional };
|
|
16852
|
+
export { control_exports as Control, db_exports as Database, DateTimeUtcFromMillis, schema_exports as DocumentSchema, event_exports as Event, list_exports as EventList, registry_exports as EventRegistry, EventSchema, git_exports as Git, global_exports as Global, harness_exports as Harness, location_exports as Location, mcp_exports as Mcp, config_exports as McpConfig, error_exports as McpError, oauth_exports as McpOAuth, catalog_exports as ModelCatalog, plugin_exports as Plugin, project_exports as Project, schema_exports$1 as PromptSchema, run_exports as Runner, sandbox_exports as Sandbox, SandboxError, session_exports as Session, session_exports$1 as SessionStore, settings_exports as Settings, state_exports as State, schema_exports$2 as ThreadSchema, thread_exports as ThreadStore, tool_exports as Tool, expandTilde, optional };
|
|
16808
16853
|
|
|
16809
16854
|
//# sourceMappingURL=effect.mjs.map
|