clanka 0.7.4 → 0.7.6

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.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env -S node --optimize-for-size
2
2
  export {};
3
3
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env -S node --optimize-for-size
2
2
  import * as Effect from "effect/Effect";
3
3
  import * as Prompt from "effect/unstable/cli/Prompt";
4
4
  import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clanka",
3
3
  "type": "module",
4
- "version": "0.7.4",
4
+ "version": "0.7.6",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
package/src/Agent.ts CHANGED
@@ -744,8 +744,7 @@ const generateSystemTools = (
744
744
  - You can add / update / remove multiple files in one go with "applyPatch".
745
745
  - Avoid passing scripts into the "bash" function, and instead write javascript.
746
746
  - Variables are not shared between executions.
747
- - Do not use \`require\`, \`import\`, \`process\`, or any other Node.js apis.
748
- - Make use of the todo functions to keep track of your progress.${
747
+ - Do not use \`require\`, \`import\`, \`process\`, or any other Node.js apis.${
749
748
  conversationMode
750
749
  ? ""
751
750
  : `
package/src/AgentTools.ts CHANGED
@@ -94,14 +94,6 @@ export const makeContextNoop = (cwd?: string) =>
94
94
  Context.add(ImageAttacher, () => Effect.void),
95
95
  )
96
96
 
97
- class TodoItem extends Schema.Opaque<TodoItem>()(
98
- Schema.Struct({
99
- id: Schema.Number,
100
- text: Schema.String,
101
- completed: Schema.Boolean,
102
- }),
103
- ) {}
104
-
105
97
  /**
106
98
  * @since 1.0.0
107
99
  * @category Toolkit
@@ -169,29 +161,6 @@ export const AgentTools = Toolkit.make(
169
161
  success: Schema.String,
170
162
  dependencies: [CurrentDirectory],
171
163
  }),
172
- Tool.make("listTodos", {
173
- description: "Read your todo list",
174
- parameters: Schema.Void,
175
- success: Schema.Array(TodoItem),
176
- }),
177
- Tool.make("addTodo", {
178
- description: "Add an item to your todo list",
179
- parameters: Schema.String.annotate({
180
- identifier: "text",
181
- }),
182
- }),
183
- Tool.make("updateTodo", {
184
- description: "Update an item in your todo list",
185
- parameters: Schema.Struct({
186
- id: Schema.Number,
187
- text: Schema.optional(Schema.String),
188
- completed: Schema.optional(Schema.Boolean),
189
- }),
190
- }),
191
- Tool.make("clearTodos", {
192
- description: "Clear all items in your todo list",
193
- parameters: Schema.Void,
194
- }),
195
164
  Tool.make("bash", {
196
165
  description: "Run a bash command and return the output",
197
166
  parameters: Schema.Struct({
@@ -305,9 +274,6 @@ export const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(
305
274
  const pathService = yield* Path.Path
306
275
  const webSearch = yield* ExaSearch.ExaSearch
307
276
  const fetchMarkdown = yield* WebToMarkdown.WebToMarkdown
308
- const todoMap = new Map<number, TodoItem>()
309
- let todoIdCounter = 0
310
-
311
277
  const execute = Effect.fn(function* (command: ChildProcess.Command) {
312
278
  const handle = yield* spawner.spawn(command)
313
279
  return yield* handle.all.pipe(
@@ -502,36 +468,6 @@ export const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(
502
468
  import("glob").then((Glob) => Glob.glob(pattern, { cwd })),
503
469
  )
504
470
  }),
505
- listTodos: Effect.fn("AgentTools.listTodos")(function* () {
506
- yield* Effect.logInfo(`Calling "listTodos"`)
507
- return Array.fromIterable(todoMap.values())
508
- }),
509
- addTodo: Effect.fn("AgentTools.addTodo")(function* (text) {
510
- yield* Effect.logInfo(`Calling "addTodo"`).pipe(
511
- Effect.annotateLogs({ text }),
512
- )
513
- const id = ++todoIdCounter
514
- const item = { id, text, completed: false }
515
- todoMap.set(id, item)
516
- }),
517
- updateTodo: Effect.fn("AgentTools.updateTodo")(function* (options) {
518
- yield* Effect.logInfo(`Calling "updateTodo"`).pipe(
519
- Effect.annotateLogs(options),
520
- )
521
- const item = todoMap.get(options.id)
522
- if (item === undefined) {
523
- return yield* Effect.die(`Todo item ${options.id} not found`)
524
- }
525
- todoMap.set(item.id, {
526
- ...item,
527
- text: options.text ?? item.text,
528
- completed: options.completed ?? item.completed,
529
- })
530
- }),
531
- clearTodos: Effect.fn("AgentTools.clearTodos")(function* () {
532
- yield* Effect.logInfo(`Calling "clearTodos"`)
533
- todoMap.clear()
534
- }),
535
471
  bash: Effect.fn("AgentTools.bash")(function* (options) {
536
472
  const timeoutMs = Math.min(options.timeoutMs ?? 120_000, 240_000)
537
473
  yield* Effect.logInfo(`Calling "bash"`).pipe(
package/src/cli.ts CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env -S node --optimize-for-size
2
2
  import * as Effect from "effect/Effect"
3
3
  import * as Prompt from "effect/unstable/cli/Prompt"
4
4
  import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient"