lalph 0.1.111 → 0.1.113
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/cli.mjs +54 -45
- package/package.json +1 -1
- package/src/IssueSources.ts +6 -4
- package/src/cli.ts +10 -8
- package/src/commands/root.ts +1 -0
- package/src/domain/CliAgent.ts +1 -1
- package/src/shared/runtime.ts +4 -1
package/dist/cli.mjs
CHANGED
|
@@ -65770,7 +65770,7 @@ const opencode = new CliAgent({
|
|
|
65770
65770
|
name: "opencode",
|
|
65771
65771
|
command: ({ prompt, prdFilePath }) => make$23({
|
|
65772
65772
|
extendEnv: true,
|
|
65773
|
-
env: { OPENCODE_PERMISSION: "{\"*\":\"allow\"}" },
|
|
65773
|
+
env: { OPENCODE_PERMISSION: "{\"*\":\"allow\", \"question\":\"deny\"}" },
|
|
65774
65774
|
stdout: "pipe",
|
|
65775
65775
|
stderr: "pipe",
|
|
65776
65776
|
stdin: "inherit"
|
|
@@ -149003,10 +149003,47 @@ const getOrSelectAutoMergeLabel = gen(function* () {
|
|
|
149003
149003
|
const resetGithub = labelFilter.set(none$3()).pipe(andThen(autoMergeLabel.set(none$3())));
|
|
149004
149004
|
const maybeNextPage = (page, linkHeader) => pipe(fromNullishOr$2(linkHeader), filter$8((_) => _.includes(`rel="next"`)), as$2(page + 1));
|
|
149005
149005
|
|
|
149006
|
+
//#endregion
|
|
149007
|
+
//#region src/Tracing.ts
|
|
149008
|
+
const TracingLayer = unwrap$3(gen(function* () {
|
|
149009
|
+
const logLevel = yield* MinimumLogLevel;
|
|
149010
|
+
if (isLessThan$1("Trace", logLevel)) return empty$14;
|
|
149011
|
+
return TracerLogger;
|
|
149012
|
+
}));
|
|
149013
|
+
const TracerLogger = gen(function* () {
|
|
149014
|
+
const loggers = yield* CurrentLoggers;
|
|
149015
|
+
const tracer = yield* Tracer;
|
|
149016
|
+
const fiber = getCurrent();
|
|
149017
|
+
const log = (message, time) => {
|
|
149018
|
+
const options = {
|
|
149019
|
+
message,
|
|
149020
|
+
fiber,
|
|
149021
|
+
date: new Date(Number(time / BigInt(1e6))),
|
|
149022
|
+
logLevel: "Trace",
|
|
149023
|
+
cause: empty$13
|
|
149024
|
+
};
|
|
149025
|
+
loggers.forEach((logger) => {
|
|
149026
|
+
logger.log(options);
|
|
149027
|
+
});
|
|
149028
|
+
};
|
|
149029
|
+
return make$55({ span(name, parent, annotations, links, startTime, kind, options) {
|
|
149030
|
+
const span = tracer.span(name, parent, annotations, links, startTime, kind, options);
|
|
149031
|
+
log(`${name}: started`, startTime);
|
|
149032
|
+
const oldEnd = span.end;
|
|
149033
|
+
span.end = (endTime, cause) => {
|
|
149034
|
+
const duration = nanos(endTime - span.status.startTime);
|
|
149035
|
+
log(`${name}: completed. Took ${format$2(duration)}`, endTime);
|
|
149036
|
+
return oldEnd.call(span, endTime, cause);
|
|
149037
|
+
};
|
|
149038
|
+
return span;
|
|
149039
|
+
} });
|
|
149040
|
+
}).pipe(effect$1(Tracer));
|
|
149041
|
+
|
|
149006
149042
|
//#endregion
|
|
149007
149043
|
//#region src/shared/runtime.ts
|
|
149008
149044
|
const lalphMemoMap = makeMemoMapUnsafe();
|
|
149009
|
-
const
|
|
149045
|
+
const atomRuntime = context({ memoMap: lalphMemoMap });
|
|
149046
|
+
atomRuntime.addGlobalLayer(TracingLayer);
|
|
149010
149047
|
|
|
149011
149048
|
//#endregion
|
|
149012
149049
|
//#region src/IssueSources.ts
|
|
@@ -149021,7 +149058,7 @@ const issueSources = [{
|
|
|
149021
149058
|
name: "GitHub Issues",
|
|
149022
149059
|
layer: GithubIssueSource,
|
|
149023
149060
|
reset: resetGithub,
|
|
149024
|
-
githubPrInstructions: `At the start of your PR description, include a line that closes the issue
|
|
149061
|
+
githubPrInstructions: `At the start of your PR description, include a line that closes the issue: Closes {task id}`
|
|
149025
149062
|
}];
|
|
149026
149063
|
const selectedIssueSource = new Setting("issueSource", Literals(issueSources.map((s) => s.id)));
|
|
149027
149064
|
const selectIssueSource = gen(function* () {
|
|
@@ -149051,15 +149088,15 @@ var CurrentIssueSource = class CurrentIssueSource extends Service()("lalph/Curre
|
|
|
149051
149088
|
return add$5(services, CurrentIssueSource, source);
|
|
149052
149089
|
})).pipe(provide$3([Settings.layer, PlatformServices]));
|
|
149053
149090
|
};
|
|
149054
|
-
const issueSourceRuntime =
|
|
149091
|
+
const issueSourceRuntime = atomRuntime(CurrentIssueSource.layer.pipe(orDie$3));
|
|
149055
149092
|
const currentIssuesAtom = pipe(issueSourceRuntime.atom(fnUntraced(function* (get) {
|
|
149056
|
-
const issues = yield* (yield* IssueSource).issues;
|
|
149093
|
+
const issues = yield* (yield* IssueSource).issues.pipe(withSpan("currentIssuesAtom.refresh"));
|
|
149057
149094
|
const handle = setTimeout(() => {
|
|
149058
149095
|
get.refreshSelf();
|
|
149059
149096
|
}, 3e4);
|
|
149060
149097
|
get.addFinalizer(() => clearTimeout(handle));
|
|
149061
149098
|
return issues;
|
|
149062
|
-
})),
|
|
149099
|
+
})), atomRuntime.withReactivity(["issues"]), keepAlive);
|
|
149063
149100
|
const getCurrentIssues = getResult(currentIssuesAtom, { suspendOnWaiting: true });
|
|
149064
149101
|
const checkForWork = gen(function* () {
|
|
149065
149102
|
if (!(yield* getCurrentIssues).some((issue) => issue.state === "todo" && issue.blockedBy.length === 0)) return yield* new NoMoreWork({});
|
|
@@ -149909,7 +149946,10 @@ const run = fnUntraced(function* (options) {
|
|
|
149909
149946
|
yield* worktree.exec`git push -u ${parsed.remote} ${parsed.branch}`;
|
|
149910
149947
|
}
|
|
149911
149948
|
}
|
|
149912
|
-
if (gitFlow.branch)
|
|
149949
|
+
if (gitFlow.branch) {
|
|
149950
|
+
yield* worktree.exec`git branch -D ${gitFlow.branch}`;
|
|
149951
|
+
yield* worktree.exec`git checkout -b ${gitFlow.branch}`;
|
|
149952
|
+
}
|
|
149913
149953
|
yield* addFinalizer(fnUntraced(function* () {
|
|
149914
149954
|
const currentBranchName = yield* worktree.currentBranch(worktree.directory).pipe(option$1, map$8(getOrUndefined));
|
|
149915
149955
|
if (!currentBranchName) return;
|
|
@@ -150197,43 +150237,7 @@ const commandSource = make$34("source").pipe(withDescription("Select the issue s
|
|
|
150197
150237
|
|
|
150198
150238
|
//#endregion
|
|
150199
150239
|
//#region package.json
|
|
150200
|
-
var version = "0.1.
|
|
150201
|
-
|
|
150202
|
-
//#endregion
|
|
150203
|
-
//#region src/Tracing.ts
|
|
150204
|
-
const TracingLayer = unwrap$3(gen(function* () {
|
|
150205
|
-
const logLevel = yield* MinimumLogLevel;
|
|
150206
|
-
if (isLessThan$1("Trace", logLevel)) return empty$14;
|
|
150207
|
-
return TracerLogger;
|
|
150208
|
-
}));
|
|
150209
|
-
const TracerLogger = gen(function* () {
|
|
150210
|
-
const loggers = yield* CurrentLoggers;
|
|
150211
|
-
const tracer = yield* Tracer;
|
|
150212
|
-
const fiber = getCurrent();
|
|
150213
|
-
const log = (message, time) => {
|
|
150214
|
-
const options = {
|
|
150215
|
-
message,
|
|
150216
|
-
fiber,
|
|
150217
|
-
date: new Date(Number(time / BigInt(1e6))),
|
|
150218
|
-
logLevel: "Trace",
|
|
150219
|
-
cause: empty$13
|
|
150220
|
-
};
|
|
150221
|
-
loggers.forEach((logger) => {
|
|
150222
|
-
logger.log(options);
|
|
150223
|
-
});
|
|
150224
|
-
};
|
|
150225
|
-
return make$55({ span(name, parent, annotations, links, startTime, kind, options) {
|
|
150226
|
-
const span = tracer.span(name, parent, annotations, links, startTime, kind, options);
|
|
150227
|
-
log(`${name}: started`, startTime);
|
|
150228
|
-
const oldEnd = span.end;
|
|
150229
|
-
span.end = (endTime, cause) => {
|
|
150230
|
-
const duration = nanos(endTime - span.status.startTime);
|
|
150231
|
-
log(`${name}: completed. Took ${format$2(duration)}`, endTime);
|
|
150232
|
-
return oldEnd.call(span, endTime, cause);
|
|
150233
|
-
};
|
|
150234
|
-
return span;
|
|
150235
|
-
} });
|
|
150236
|
-
}).pipe(effect$1(Tracer));
|
|
150240
|
+
var version = "0.1.113";
|
|
150237
150241
|
|
|
150238
150242
|
//#endregion
|
|
150239
150243
|
//#region src/cli.ts
|
|
@@ -150246,7 +150250,12 @@ commandRoot.pipe(withSubcommands([
|
|
|
150246
150250
|
commandAgent
|
|
150247
150251
|
]), provideEffectDiscard(fnUntraced(function* (options) {
|
|
150248
150252
|
if (options.reset) yield* resetCurrentIssueSource;
|
|
150249
|
-
})), provide(Settings.layer), provide(TracingLayer), provide(({ verbose }) =>
|
|
150253
|
+
})), provide(Settings.layer), provide(TracingLayer), provide(({ verbose }) => {
|
|
150254
|
+
if (!verbose) return empty$14;
|
|
150255
|
+
const logLevel = succeed$2(MinimumLogLevel, "All");
|
|
150256
|
+
atomRuntime.addGlobalLayer(logLevel);
|
|
150257
|
+
return logLevel;
|
|
150258
|
+
}), run$4({ version }), provide$1(PlatformServices), provideService(CurrentMemoMap, lalphMemoMap), runMain);
|
|
150250
150259
|
|
|
150251
150260
|
//#endregion
|
|
150252
150261
|
export { };
|
package/package.json
CHANGED
package/src/IssueSources.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { Prompt } from "effect/unstable/cli"
|
|
|
5
5
|
import { GithubIssueSource, resetGithub } from "./Github.ts"
|
|
6
6
|
import { IssueSource } from "./IssueSource.ts"
|
|
7
7
|
import { PlatformServices } from "./shared/platform.ts"
|
|
8
|
-
import {
|
|
8
|
+
import { atomRuntime } from "./shared/runtime.ts"
|
|
9
9
|
import { Atom, Reactivity } from "effect/unstable/reactivity"
|
|
10
10
|
import type { PrdIssue } from "./domain/PrdIssue.ts"
|
|
11
11
|
|
|
@@ -22,7 +22,7 @@ const issueSources: ReadonlyArray<typeof CurrentIssueSource.Service> = [
|
|
|
22
22
|
name: "GitHub Issues",
|
|
23
23
|
layer: GithubIssueSource,
|
|
24
24
|
reset: resetGithub,
|
|
25
|
-
githubPrInstructions: `At the start of your PR description, include a line that closes the issue
|
|
25
|
+
githubPrInstructions: `At the start of your PR description, include a line that closes the issue: Closes {task id}`,
|
|
26
26
|
},
|
|
27
27
|
]
|
|
28
28
|
|
|
@@ -92,10 +92,12 @@ export const currentIssuesAtom = pipe(
|
|
|
92
92
|
issueSourceRuntime.atom(
|
|
93
93
|
Effect.fnUntraced(function* (get) {
|
|
94
94
|
const source = yield* IssueSource
|
|
95
|
-
const issues = yield* source.issues
|
|
95
|
+
const issues = yield* source.issues.pipe(
|
|
96
|
+
Effect.withSpan("currentIssuesAtom.refresh"),
|
|
97
|
+
)
|
|
96
98
|
const handle = setTimeout(() => {
|
|
97
99
|
get.refreshSelf()
|
|
98
|
-
},
|
|
100
|
+
}, 30_000)
|
|
99
101
|
get.addFinalizer(() => clearTimeout(handle))
|
|
100
102
|
return issues
|
|
101
103
|
}),
|
package/src/cli.ts
CHANGED
|
@@ -15,7 +15,7 @@ import PackageJson from "../package.json" with { type: "json" }
|
|
|
15
15
|
import { resetCurrentIssueSource } from "./IssueSources.ts"
|
|
16
16
|
import { TracingLayer } from "./Tracing.ts"
|
|
17
17
|
import { MinimumLogLevel } from "effect/References"
|
|
18
|
-
import { lalphMemoMap } from "./shared/runtime.ts"
|
|
18
|
+
import { atomRuntime, lalphMemoMap } from "./shared/runtime.ts"
|
|
19
19
|
import { PlatformServices } from "./shared/platform.ts"
|
|
20
20
|
|
|
21
21
|
commandRoot.pipe(
|
|
@@ -37,13 +37,15 @@ commandRoot.pipe(
|
|
|
37
37
|
),
|
|
38
38
|
Command.provide(Settings.layer),
|
|
39
39
|
Command.provide(TracingLayer),
|
|
40
|
-
Command.provide(({ verbose }) =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
Command.provide(({ verbose }) => {
|
|
41
|
+
if (!verbose) return Layer.empty
|
|
42
|
+
const logLevel = Layer.succeed(MinimumLogLevel, "All")
|
|
43
|
+
atomRuntime.addGlobalLayer(logLevel)
|
|
44
|
+
return logLevel
|
|
45
|
+
}),
|
|
46
|
+
Command.run({
|
|
47
|
+
version: PackageJson.version,
|
|
48
|
+
}),
|
|
47
49
|
Effect.provide(PlatformServices),
|
|
48
50
|
Effect.provideService(Layer.CurrentMemoMap, lalphMemoMap),
|
|
49
51
|
NodeRuntime.runMain,
|
package/src/commands/root.ts
CHANGED
package/src/domain/CliAgent.ts
CHANGED
package/src/shared/runtime.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Layer } from "effect"
|
|
2
2
|
import { Atom } from "effect/unstable/reactivity"
|
|
3
|
+
import { TracingLayer } from "../Tracing.ts"
|
|
3
4
|
|
|
4
5
|
export const lalphMemoMap = Layer.makeMemoMapUnsafe()
|
|
5
6
|
|
|
6
|
-
export const
|
|
7
|
+
export const atomRuntime = Atom.context({ memoMap: lalphMemoMap })
|
|
8
|
+
|
|
9
|
+
atomRuntime.addGlobalLayer(TracingLayer)
|