lalph 0.3.38 → 0.3.39
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 +13 -20
- package/package.json +1 -1
- package/src/Clanka.ts +9 -2
- package/src/TaskTools.ts +28 -22
- package/src/commands/root.ts +1 -0
package/dist/cli.mjs
CHANGED
|
@@ -197913,12 +197913,6 @@ var TaskTools = class extends make$8(make$6("listTasks", {
|
|
|
197913
197913
|
])
|
|
197914
197914
|
})),
|
|
197915
197915
|
dependencies: [CurrentProjectId]
|
|
197916
|
-
}), make$6("chooseTask", {
|
|
197917
|
-
description: "Choose the task to work on",
|
|
197918
|
-
parameters: Struct({
|
|
197919
|
-
taskId: String$1,
|
|
197920
|
-
githubPrNumber: optional$2(Number$1)
|
|
197921
|
-
})
|
|
197922
197916
|
}), make$6("createTask", {
|
|
197923
197917
|
description: "Create a new task and return it's id.",
|
|
197924
197918
|
parameters: Struct({
|
|
@@ -197941,11 +197935,14 @@ var TaskTools = class extends make$8(make$6("listTasks", {
|
|
|
197941
197935
|
blockedBy: optional$2(PrdIssue.fields.blockedBy)
|
|
197942
197936
|
}),
|
|
197943
197937
|
dependencies: [CurrentProjectId]
|
|
197944
|
-
}), make$6("removeTask", {
|
|
197945
|
-
description: "Remove a task by it's id.",
|
|
197946
|
-
parameters: String$1.annotate({ identifier: "taskId" }),
|
|
197947
|
-
dependencies: [CurrentProjectId]
|
|
197948
197938
|
})) {};
|
|
197939
|
+
var TaskToolsWithChoose = class extends merge$1(TaskTools, make$8(make$6("chooseTask", {
|
|
197940
|
+
description: "Choose the task to work on",
|
|
197941
|
+
parameters: Struct({
|
|
197942
|
+
taskId: String$1,
|
|
197943
|
+
githubPrNumber: optional$2(Number$1)
|
|
197944
|
+
})
|
|
197945
|
+
}))) {};
|
|
197949
197946
|
//#endregion
|
|
197950
197947
|
//#region src/Clanka.ts
|
|
197951
197948
|
const runClanka = fnUntraced(
|
|
@@ -197953,7 +197950,7 @@ const runClanka = fnUntraced(
|
|
|
197953
197950
|
function* (options) {
|
|
197954
197951
|
const agent = yield* make$4({
|
|
197955
197952
|
...options,
|
|
197956
|
-
tools: TaskTools,
|
|
197953
|
+
tools: options.withChoose ? TaskToolsWithChoose : TaskTools,
|
|
197957
197954
|
subagentModel: clankaSubagent
|
|
197958
197955
|
});
|
|
197959
197956
|
return yield* (options.stallTimeout ? withStallTimeout(options.stallTimeout)(agent.output) : agent.output).pipe(pretty, runForEachArray((out) => {
|
|
@@ -197962,9 +197959,9 @@ const runClanka = fnUntraced(
|
|
|
197962
197959
|
}), (_) => _);
|
|
197963
197960
|
},
|
|
197964
197961
|
scoped$1,
|
|
197965
|
-
provide$1([layerServices,
|
|
197962
|
+
provide$1([layerServices, TaskToolsWithChoose.toLayer(gen(function* () {
|
|
197966
197963
|
const source = yield* IssueSource;
|
|
197967
|
-
return
|
|
197964
|
+
return TaskToolsWithChoose.of({
|
|
197968
197965
|
listTasks: fn("TaskTools.listTasks")(function* () {
|
|
197969
197966
|
yield* log$1(`Calling "listTasks"`);
|
|
197970
197967
|
const projectId = yield* CurrentProjectId;
|
|
@@ -197999,11 +197996,6 @@ const runClanka = fnUntraced(
|
|
|
197999
197996
|
issueId: options.taskId,
|
|
198000
197997
|
...options
|
|
198001
197998
|
});
|
|
198002
|
-
}, orDie$2),
|
|
198003
|
-
removeTask: fn("TaskTools.removeTask")(function* (taskId) {
|
|
198004
|
-
yield* log$1(`Calling "removeTask"`).pipe(annotateLogs({ taskId }));
|
|
198005
|
-
const projectId = yield* CurrentProjectId;
|
|
198006
|
-
yield* source.cancelIssue(projectId, taskId);
|
|
198007
197999
|
}, orDie$2)
|
|
198008
198000
|
});
|
|
198009
198001
|
}))])
|
|
@@ -198140,7 +198132,8 @@ const runWithClanka = fnUntraced(function* (options) {
|
|
|
198140
198132
|
const chooseResult = yield* runClanka({
|
|
198141
198133
|
directory: worktree.directory,
|
|
198142
198134
|
prompt: promptGen.promptChooseClanka({ gitFlow }),
|
|
198143
|
-
stallTimeout: options.stallTimeout
|
|
198135
|
+
stallTimeout: options.stallTimeout,
|
|
198136
|
+
withChoose: true
|
|
198144
198137
|
}).pipe(andThen(fail$6(new ChosenTaskNotFound())), provideService$2(ChosenTaskDeferred, deferred), provide$1(model), raceFirst(_await(deferred)), withSpan("Main.choose"));
|
|
198145
198138
|
const chosenTask = yield* taskById(chooseResult.taskId);
|
|
198146
198139
|
if (!chosenTask) return yield* new ChosenTaskNotFound();
|
|
@@ -198556,7 +198549,7 @@ const commandEdit = make$45("edit").pipe(withDescription("Open the selected proj
|
|
|
198556
198549
|
const commandSource = make$45("source").pipe(withDescription("Select the issue source to use (e.g. GitHub Issues or Linear). This applies to all projects."), withHandler(() => selectIssueSource), provide(Settings.layer));
|
|
198557
198550
|
//#endregion
|
|
198558
198551
|
//#region package.json
|
|
198559
|
-
var version = "0.3.
|
|
198552
|
+
var version = "0.3.39";
|
|
198560
198553
|
//#endregion
|
|
198561
198554
|
//#region src/commands/projects/ls.ts
|
|
198562
198555
|
const commandProjectsLs = make$45("ls").pipe(withDescription("List configured projects and how they run (enabled state, concurrency, branch, git flow, review agent)."), withHandler(fnUntraced(function* () {
|
package/package.json
CHANGED
package/src/Clanka.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Agent, OutputFormatter } from "clanka"
|
|
2
2
|
import { Duration, Effect, Stream } from "effect"
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
TaskTools,
|
|
5
|
+
TaskToolsHandlers,
|
|
6
|
+
TaskToolsWithChoose,
|
|
7
|
+
} from "./TaskTools.ts"
|
|
4
8
|
import { clankaSubagent } from "./ClankaModels.ts"
|
|
5
9
|
import { withStallTimeout } from "./shared/stream.ts"
|
|
6
10
|
import type { AiError } from "effect/unstable/ai"
|
|
@@ -13,10 +17,13 @@ export const runClanka = Effect.fnUntraced(
|
|
|
13
17
|
readonly prompt: string
|
|
14
18
|
readonly system?: string | undefined
|
|
15
19
|
readonly stallTimeout?: Duration.Input | undefined
|
|
20
|
+
readonly withChoose?: boolean | undefined
|
|
16
21
|
}) {
|
|
17
22
|
const agent = yield* Agent.make({
|
|
18
23
|
...options,
|
|
19
|
-
tools:
|
|
24
|
+
tools: options.withChoose
|
|
25
|
+
? TaskToolsWithChoose
|
|
26
|
+
: (TaskTools as unknown as typeof TaskToolsWithChoose),
|
|
20
27
|
subagentModel: clankaSubagent,
|
|
21
28
|
})
|
|
22
29
|
let stream = options.stallTimeout
|
package/src/TaskTools.ts
CHANGED
|
@@ -34,13 +34,6 @@ export class TaskTools extends Toolkit.make(
|
|
|
34
34
|
),
|
|
35
35
|
dependencies: [CurrentProjectId],
|
|
36
36
|
}),
|
|
37
|
-
Tool.make("chooseTask", {
|
|
38
|
-
description: "Choose the task to work on",
|
|
39
|
-
parameters: Schema.Struct({
|
|
40
|
-
taskId: Schema.String,
|
|
41
|
-
githubPrNumber: Schema.optional(Schema.Number),
|
|
42
|
-
}),
|
|
43
|
-
}),
|
|
44
37
|
Tool.make("createTask", {
|
|
45
38
|
description: "Create a new task and return it's id.",
|
|
46
39
|
parameters: Schema.Struct({
|
|
@@ -65,20 +58,33 @@ export class TaskTools extends Toolkit.make(
|
|
|
65
58
|
}),
|
|
66
59
|
dependencies: [CurrentProjectId],
|
|
67
60
|
}),
|
|
68
|
-
Tool.make("removeTask", {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
// Tool.make("removeTask", {
|
|
62
|
+
// description: "Remove a task by it's id.",
|
|
63
|
+
// parameters: Schema.String.annotate({
|
|
64
|
+
// identifier: "taskId",
|
|
65
|
+
// }),
|
|
66
|
+
// dependencies: [CurrentProjectId],
|
|
67
|
+
// }),
|
|
68
|
+
) {}
|
|
69
|
+
|
|
70
|
+
export class TaskToolsWithChoose extends Toolkit.merge(
|
|
71
|
+
TaskTools,
|
|
72
|
+
Toolkit.make(
|
|
73
|
+
Tool.make("chooseTask", {
|
|
74
|
+
description: "Choose the task to work on",
|
|
75
|
+
parameters: Schema.Struct({
|
|
76
|
+
taskId: Schema.String,
|
|
77
|
+
githubPrNumber: Schema.optional(Schema.Number),
|
|
78
|
+
}),
|
|
72
79
|
}),
|
|
73
|
-
|
|
74
|
-
}),
|
|
80
|
+
),
|
|
75
81
|
) {}
|
|
76
82
|
|
|
77
|
-
export const TaskToolsHandlers =
|
|
83
|
+
export const TaskToolsHandlers = TaskToolsWithChoose.toLayer(
|
|
78
84
|
Effect.gen(function* () {
|
|
79
85
|
const source = yield* IssueSource
|
|
80
86
|
|
|
81
|
-
return
|
|
87
|
+
return TaskToolsWithChoose.of({
|
|
82
88
|
listTasks: Effect.fn("TaskTools.listTasks")(function* () {
|
|
83
89
|
yield* Effect.log(`Calling "listTasks"`)
|
|
84
90
|
const projectId = yield* CurrentProjectId
|
|
@@ -124,13 +130,13 @@ export const TaskToolsHandlers = TaskTools.toLayer(
|
|
|
124
130
|
...options,
|
|
125
131
|
})
|
|
126
132
|
}, Effect.orDie),
|
|
127
|
-
removeTask: Effect.fn("TaskTools.removeTask")(function* (taskId) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}, Effect.orDie),
|
|
133
|
+
// removeTask: Effect.fn("TaskTools.removeTask")(function* (taskId) {
|
|
134
|
+
// yield* Effect.log(`Calling "removeTask"`).pipe(
|
|
135
|
+
// Effect.annotateLogs({ taskId }),
|
|
136
|
+
// )
|
|
137
|
+
// const projectId = yield* CurrentProjectId
|
|
138
|
+
// yield* source.cancelIssue(projectId, taskId)
|
|
139
|
+
// }, Effect.orDie),
|
|
134
140
|
})
|
|
135
141
|
}),
|
|
136
142
|
)
|
package/src/commands/root.ts
CHANGED
|
@@ -369,6 +369,7 @@ const runWithClanka = Effect.fnUntraced(
|
|
|
369
369
|
directory: worktree.directory,
|
|
370
370
|
prompt: promptGen.promptChooseClanka({ gitFlow }),
|
|
371
371
|
stallTimeout: options.stallTimeout,
|
|
372
|
+
withChoose: true,
|
|
372
373
|
}).pipe(
|
|
373
374
|
Effect.andThen(Effect.fail(new ChosenTaskNotFound())),
|
|
374
375
|
Effect.provideService(ChosenTaskDeferred, deferred),
|