@selesai/code 0.5.23 → 0.5.25

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.
Files changed (66) hide show
  1. package/README.md +5 -4
  2. package/dist/extensions/pi-powerline-footer/guide.ts +4 -4
  3. package/dist/extensions/workflow/adapter.ts +4 -4
  4. package/dist/extensions/workflow/extension.ts +3 -2
  5. package/dist/extensions/workflow/modes/loop.ts +55 -0
  6. package/dist/extensions/workflow/modes/{quick.ts → quicktype.ts} +12 -12
  7. package/dist/modes/index.d.ts +1 -1
  8. package/dist/modes/index.d.ts.map +1 -1
  9. package/dist/modes/index.js.map +1 -1
  10. package/dist/modes/rpc/rpc-mode.d.ts +1 -1
  11. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  12. package/dist/modes/rpc/rpc-mode.js +2 -2
  13. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  14. package/dist/modes/rpc/rpc-types.d.ts +3 -3
  15. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  16. package/dist/modes/rpc/rpc-types.js.map +1 -1
  17. package/dist/skills/agent-browser/SKILL.md +52 -0
  18. package/docs/workflows.md +29 -9
  19. package/package.json +2 -2
  20. package/dist/core/provider-display-names.d.ts +0 -2
  21. package/dist/core/provider-display-names.d.ts.map +0 -1
  22. package/dist/core/provider-display-names.js +0 -36
  23. package/dist/core/provider-display-names.js.map +0 -1
  24. package/dist/data/capabilities.d.ts +0 -48
  25. package/dist/data/capabilities.d.ts.map +0 -1
  26. package/dist/data/capabilities.js +0 -282
  27. package/dist/data/capabilities.js.map +0 -1
  28. package/dist/data/navigation.d.ts +0 -3
  29. package/dist/data/navigation.d.ts.map +0 -1
  30. package/dist/data/navigation.js +0 -90
  31. package/dist/data/navigation.js.map +0 -1
  32. package/dist/extensions/index.d.ts +0 -3
  33. package/dist/extensions/index.d.ts.map +0 -1
  34. package/dist/extensions/index.js +0 -9
  35. package/dist/extensions/index.js.map +0 -1
  36. package/dist/extensions/llama/client.d.ts +0 -61
  37. package/dist/extensions/llama/client.d.ts.map +0 -1
  38. package/dist/extensions/llama/client.js +0 -309
  39. package/dist/extensions/llama/client.js.map +0 -1
  40. package/dist/extensions/llama/huggingface.d.ts +0 -23
  41. package/dist/extensions/llama/huggingface.d.ts.map +0 -1
  42. package/dist/extensions/llama/huggingface.js +0 -146
  43. package/dist/extensions/llama/huggingface.js.map +0 -1
  44. package/dist/extensions/llama/index.d.ts +0 -3
  45. package/dist/extensions/llama/index.d.ts.map +0 -1
  46. package/dist/extensions/llama/index.js +0 -211
  47. package/dist/extensions/llama/index.js.map +0 -1
  48. package/dist/extensions/llama/provider.d.ts +0 -10
  49. package/dist/extensions/llama/provider.d.ts.map +0 -1
  50. package/dist/extensions/llama/provider.js +0 -106
  51. package/dist/extensions/llama/provider.js.map +0 -1
  52. package/dist/extensions/llama/ui.d.ts +0 -42
  53. package/dist/extensions/llama/ui.d.ts.map +0 -1
  54. package/dist/extensions/llama/ui.js +0 -420
  55. package/dist/extensions/llama/ui.js.map +0 -1
  56. package/dist/extensions/pi-subagents/src/runs/background/wait.ts +0 -353
  57. package/dist/extensions/pi-subagents/test/unit/live-async-resume.test.ts +0 -170
  58. package/dist/extensions/pi-subagents/test/unit/wait.test.ts +0 -398
  59. package/dist/extensions/question/dialog-adapter.ts +0 -96
  60. package/dist/extensions/question/tests/ui-protocol.test.ts +0 -157
  61. package/dist/extensions/question/tui-adapter.ts +0 -15
  62. package/dist/extensions/question/ui-protocol.ts +0 -31
  63. package/dist/modes/interactive/interactive-mode.test.d.ts +0 -2
  64. package/dist/modes/interactive/interactive-mode.test.d.ts.map +0 -1
  65. package/dist/modes/interactive/interactive-mode.test.js +0 -45
  66. package/dist/modes/interactive/interactive-mode.test.js.map +0 -1
@@ -1,31 +0,0 @@
1
- // UIProtocol port — abstracts TUI vs dialog/RPC transport.
2
-
3
- import type { KeybindingsManager } from "@selesai/code";
4
- import type { Theme, TUI } from "@earendil-works/pi-tui";
5
-
6
- import type { QuestionResponse, ResolvedQuestionParams } from "./types.ts";
7
-
8
- export interface CustomFactoryResult {
9
- handleInput(data: string): void;
10
- render(width: number): string[];
11
- focused: boolean;
12
- }
13
-
14
- export type CustomFactory<T> = (
15
- tui: TUI,
16
- theme: Theme,
17
- keybindings: KeybindingsManager,
18
- done: (result: T) => void,
19
- ) => CustomFactoryResult;
20
-
21
- export interface UIProtocol {
22
- readonly hasUI: boolean;
23
- readonly theme: Theme;
24
- custom<T>(factory: CustomFactory<T>): Promise<T | undefined>;
25
- select(prompt: string, options: string[], opts?: { timeout?: number }): Promise<string | undefined>;
26
- input(prompt: string, placeholder?: string, opts?: { timeout?: number }): Promise<string | undefined>;
27
- }
28
-
29
- export interface FallbackProtocol {
30
- ask(params: ResolvedQuestionParams, protocol: UIProtocol): Promise<QuestionResponse | null>;
31
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=interactive-mode.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interactive-mode.test.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.test.ts"],"names":[],"mappings":"","sourcesContent":["import { describe, expect, it, vi } from \"vitest\";\nimport { InteractiveMode } from \"./interactive-mode.js\";\n\ndescribe(\"InteractiveMode handleEvent tool_execution_update\", () => {\n\tit(\"refreshes displayed args from execution update\", () => {\n\t\tconst component = {\n\t\t\tupdateArgs: vi.fn(),\n\t\t\tupdateResult: vi.fn(),\n\t\t};\n\t\tconst requestRender = vi.fn();\n\n\t\tconst mode = Object.create(InteractiveMode.prototype) as InteractiveMode;\n\t\tmode.isInitialized = true;\n\t\tmode.footer = { invalidate: vi.fn() } as any;\n\t\tmode.pendingTools = new Map([[\"tc-1\", component as any]]);\n\t\tmode.ui = { requestRender } as any as InteractiveMode[\"ui\"];\n\n\t\tmode.handleEvent({\n\t\t\ttype: \"tool_execution_update\",\n\t\t\ttoolCallId: \"tc-1\",\n\t\t\ttoolName: \"bash\",\n\t\t\targs: { command: \"rtk ls -la\" },\n\t\t\tpartialResult: { content: [], details: undefined },\n\t\t} as any);\n\n\t\texpect(component.updateArgs).toHaveBeenCalledTimes(1);\n\t\texpect(component.updateArgs).toHaveBeenCalledWith({ command: \"rtk ls -la\" });\n\t\texpect(component.updateResult).toHaveBeenCalledTimes(1);\n\t\texpect(component.updateResult).toHaveBeenCalledWith(\n\t\t\t{ content: [], details: undefined, isError: false },\n\t\t\ttrue,\n\t\t);\n\t\texpect(requestRender).toHaveBeenCalledTimes(1);\n\t});\n\n\tit(\"is a no-op when update references an unknown tool\", () => {\n\t\tconst requestRender = vi.fn();\n\t\tconst mode = Object.create(InteractiveMode.prototype) as InteractiveMode;\n\t\tmode.isInitialized = true;\n\t\tmode.footer = { invalidate: vi.fn() } as any;\n\t\tmode.pendingTools = new Map();\n\t\tmode.ui = { requestRender } as any as InteractiveMode[\"ui\"];\n\n\t\tmode.handleEvent({\n\t\t\ttype: \"tool_execution_update\",\n\t\t\ttoolCallId: \"missing\",\n\t\t\ttoolName: \"bash\",\n\t\t\targs: { command: \"rtk ls -la\" },\n\t\t\tpartialResult: { content: [], details: undefined },\n\t\t} as any);\n\n\t\texpect(requestRender).not.toHaveBeenCalled();\n\t});\n});\n"]}
@@ -1,45 +0,0 @@
1
- import { describe, expect, it, vi } from "vitest";
2
- import { InteractiveMode } from "./interactive-mode.js";
3
- describe("InteractiveMode handleEvent tool_execution_update", () => {
4
- it("refreshes displayed args from execution update", () => {
5
- const component = {
6
- updateArgs: vi.fn(),
7
- updateResult: vi.fn(),
8
- };
9
- const requestRender = vi.fn();
10
- const mode = Object.create(InteractiveMode.prototype);
11
- mode.isInitialized = true;
12
- mode.footer = { invalidate: vi.fn() };
13
- mode.pendingTools = new Map([["tc-1", component]]);
14
- mode.ui = { requestRender };
15
- mode.handleEvent({
16
- type: "tool_execution_update",
17
- toolCallId: "tc-1",
18
- toolName: "bash",
19
- args: { command: "rtk ls -la" },
20
- partialResult: { content: [], details: undefined },
21
- });
22
- expect(component.updateArgs).toHaveBeenCalledTimes(1);
23
- expect(component.updateArgs).toHaveBeenCalledWith({ command: "rtk ls -la" });
24
- expect(component.updateResult).toHaveBeenCalledTimes(1);
25
- expect(component.updateResult).toHaveBeenCalledWith({ content: [], details: undefined, isError: false }, true);
26
- expect(requestRender).toHaveBeenCalledTimes(1);
27
- });
28
- it("is a no-op when update references an unknown tool", () => {
29
- const requestRender = vi.fn();
30
- const mode = Object.create(InteractiveMode.prototype);
31
- mode.isInitialized = true;
32
- mode.footer = { invalidate: vi.fn() };
33
- mode.pendingTools = new Map();
34
- mode.ui = { requestRender };
35
- mode.handleEvent({
36
- type: "tool_execution_update",
37
- toolCallId: "missing",
38
- toolName: "bash",
39
- args: { command: "rtk ls -la" },
40
- partialResult: { content: [], details: undefined },
41
- });
42
- expect(requestRender).not.toHaveBeenCalled();
43
- });
44
- });
45
- //# sourceMappingURL=interactive-mode.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interactive-mode.test.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE,CAAC;IACnE,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE,CAAC;QAC1D,MAAM,SAAS,GAAG;YACjB,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE,CAAC,EAAE,EAAE;SACrB,CAAC;QACF,MAAM,aAAa,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;QAE9B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAoB,CAAC;QACzE,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MA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B,IAAI,CAAC,MAAM,GAAG,EAAE,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE,EAAS,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,EAAE,GAAG,EAAE,aAAa,EAAkC,CAAC;QAE5D,IAAI,CAAC,WAAW,CAAC;YAChB,IAAI,EAAE,uBAAuB;YAC7B,UAAU,EAAE,SAAS;YACrB,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;YAC/B,aAAa,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SAC3C,CAAC,CAAC;QAEV,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;IAAA,CAC7C,CAAC,CAAC;AAAA,CACH,CAAC,CAAC","sourcesContent":["import { describe, expect, it, vi } from \"vitest\";\nimport { InteractiveMode } from \"./interactive-mode.js\";\n\ndescribe(\"InteractiveMode handleEvent tool_execution_update\", () => {\n\tit(\"refreshes displayed args from execution update\", () => {\n\t\tconst component = {\n\t\t\tupdateArgs: vi.fn(),\n\t\t\tupdateResult: vi.fn(),\n\t\t};\n\t\tconst requestRender = vi.fn();\n\n\t\tconst mode = Object.create(InteractiveMode.prototype) as InteractiveMode;\n\t\tmode.isInitialized = true;\n\t\tmode.footer = { invalidate: vi.fn() } as any;\n\t\tmode.pendingTools = new Map([[\"tc-1\", component as any]]);\n\t\tmode.ui = { requestRender } as any as InteractiveMode[\"ui\"];\n\n\t\tmode.handleEvent({\n\t\t\ttype: \"tool_execution_update\",\n\t\t\ttoolCallId: \"tc-1\",\n\t\t\ttoolName: \"bash\",\n\t\t\targs: { command: \"rtk ls -la\" },\n\t\t\tpartialResult: { content: [], details: undefined },\n\t\t} as any);\n\n\t\texpect(component.updateArgs).toHaveBeenCalledTimes(1);\n\t\texpect(component.updateArgs).toHaveBeenCalledWith({ command: \"rtk ls -la\" });\n\t\texpect(component.updateResult).toHaveBeenCalledTimes(1);\n\t\texpect(component.updateResult).toHaveBeenCalledWith(\n\t\t\t{ content: [], details: undefined, isError: false },\n\t\t\ttrue,\n\t\t);\n\t\texpect(requestRender).toHaveBeenCalledTimes(1);\n\t});\n\n\tit(\"is a no-op when update references an unknown tool\", () => {\n\t\tconst requestRender = vi.fn();\n\t\tconst mode = Object.create(InteractiveMode.prototype) as InteractiveMode;\n\t\tmode.isInitialized = true;\n\t\tmode.footer = { invalidate: vi.fn() } as any;\n\t\tmode.pendingTools = new Map();\n\t\tmode.ui = { requestRender } as any as InteractiveMode[\"ui\"];\n\n\t\tmode.handleEvent({\n\t\t\ttype: \"tool_execution_update\",\n\t\t\ttoolCallId: \"missing\",\n\t\t\ttoolName: \"bash\",\n\t\t\targs: { command: \"rtk ls -la\" },\n\t\t\tpartialResult: { content: [], details: undefined },\n\t\t} as any);\n\n\t\texpect(requestRender).not.toHaveBeenCalled();\n\t});\n});\n"]}