clanka 0.0.3 → 0.0.5
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/Agent.d.ts +78 -29
- package/dist/Agent.d.ts.map +1 -1
- package/dist/Agent.js +307 -87
- package/dist/Agent.js.map +1 -1
- package/dist/AgentTools.d.ts +1 -1
- package/dist/AgentTools.d.ts.map +1 -1
- package/dist/AgentTools.js +3 -4
- package/dist/AgentTools.js.map +1 -1
- package/dist/Codex.d.ts +6 -1
- package/dist/Codex.d.ts.map +1 -1
- package/dist/Codex.js +16 -3
- package/dist/Codex.js.map +1 -1
- package/dist/CodexAuth.d.ts +4 -4
- package/dist/Executor.d.ts.map +1 -1
- package/dist/Executor.js +1 -1
- package/dist/Executor.js.map +1 -1
- package/dist/GithubCopilot.d.ts +11 -0
- package/dist/GithubCopilot.d.ts.map +1 -0
- package/dist/GithubCopilot.js +14 -0
- package/dist/GithubCopilot.js.map +1 -0
- package/dist/GithubCopilotAuth.d.ts +57 -0
- package/dist/GithubCopilotAuth.d.ts.map +1 -0
- package/dist/GithubCopilotAuth.js +218 -0
- package/dist/GithubCopilotAuth.js.map +1 -0
- package/dist/GithubCopilotAuth.test.d.ts +2 -0
- package/dist/GithubCopilotAuth.test.d.ts.map +1 -0
- package/dist/GithubCopilotAuth.test.js +267 -0
- package/dist/GithubCopilotAuth.test.js.map +1 -0
- package/dist/OutputFormatter.d.ts +4 -3
- package/dist/OutputFormatter.d.ts.map +1 -1
- package/dist/OutputFormatter.js +49 -54
- package/dist/OutputFormatter.js.map +1 -1
- package/dist/ScriptExtraction.d.ts +34 -0
- package/dist/ScriptExtraction.d.ts.map +1 -0
- package/dist/ScriptExtraction.js +68 -0
- package/dist/ScriptExtraction.js.map +1 -0
- package/dist/ScriptExtraction.test.d.ts +2 -0
- package/dist/ScriptExtraction.test.d.ts.map +1 -0
- package/dist/ScriptExtraction.test.js +64 -0
- package/dist/ScriptExtraction.test.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/Agent.ts +427 -133
- package/src/AgentTools.ts +3 -4
- package/src/Codex.ts +18 -3
- package/src/Executor.ts +0 -1
- package/src/GithubCopilot.ts +14 -0
- package/src/GithubCopilotAuth.test.ts +469 -0
- package/src/GithubCopilotAuth.ts +441 -0
- package/src/OutputFormatter.ts +51 -68
- package/src/ScriptExtraction.test.ts +96 -0
- package/src/ScriptExtraction.ts +75 -0
- package/src/index.ts +5 -0
package/dist/Agent.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import { Effect, FileSystem, Layer, Path, Schema, Scope, Stream } from "effect";
|
|
5
|
-
import { LanguageModel, Prompt, Tool, Toolkit } from "effect/unstable/ai";
|
|
4
|
+
import { Effect, FileSystem, Layer, Path, Schema, Scope, ServiceMap, Stream } from "effect";
|
|
5
|
+
import { AiError, LanguageModel, Prompt, Tool, Toolkit } from "effect/unstable/ai";
|
|
6
6
|
import { AgentTools } from "./AgentTools.ts";
|
|
7
7
|
import { Executor } from "./Executor.ts";
|
|
8
8
|
import { ToolkitRenderer } from "./ToolkitRenderer.ts";
|
|
@@ -13,15 +13,17 @@ import type { ChildProcessSpawner } from "effect/unstable/process";
|
|
|
13
13
|
* @category Models
|
|
14
14
|
*/
|
|
15
15
|
export interface Agent {
|
|
16
|
-
readonly output: Stream.Stream<Output, AgentFinished>;
|
|
16
|
+
readonly output: Stream.Stream<Output, AgentFinished | AiError.AiError>;
|
|
17
|
+
/**
|
|
18
|
+
* Send a message to the agent to steer its behavior. This is useful for
|
|
19
|
+
* providing feedback or new instructions while the agent is running.
|
|
20
|
+
*
|
|
21
|
+
* The effect will only complete once the message has been sent.
|
|
22
|
+
* Interrupting the effect will withdraw the message, so it will not be sent
|
|
23
|
+
* to the agent.
|
|
24
|
+
*/
|
|
25
|
+
steer(message: string): Effect.Effect<void>;
|
|
17
26
|
}
|
|
18
|
-
/**
|
|
19
|
-
* A layer that provides most of the common services needed to run an agent.
|
|
20
|
-
*
|
|
21
|
-
* @since 1.0.0
|
|
22
|
-
* @category Services
|
|
23
|
-
*/
|
|
24
|
-
export declare const layerServices: Layer.Layer<Tool.HandlersFor<typeof AgentTools.tools> | Executor | ToolkitRenderer, never, FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner>;
|
|
25
27
|
/**
|
|
26
28
|
* Start an agent in the given directory with the given prompt and tools.
|
|
27
29
|
*
|
|
@@ -40,6 +42,25 @@ export declare const make: <Tools extends Record<string, Tool.Any> = {}, SE = ne
|
|
|
40
42
|
/** Layer to use for subagents */
|
|
41
43
|
readonly subagentModel?: Layer.Layer<LanguageModel.LanguageModel | ProviderName, SE, SR> | undefined;
|
|
42
44
|
}) => Effect.Effect<Agent, never, Scope.Scope | FileSystem.FileSystem | Path.Path | Executor | LanguageModel.LanguageModel | ProviderName | ModelName | ToolkitRenderer | Tool.HandlersFor<Tools> | Tool.HandlersFor<typeof AgentTools.tools> | Tool.HandlerServices<Tools[keyof Tools]> | SR>;
|
|
45
|
+
declare const AgentModelConfig_base: ServiceMap.Reference<{
|
|
46
|
+
readonly systemPromptTransform?: <A, E, R>(system: string, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
47
|
+
readonly supportsAssistantPrefill?: boolean | undefined;
|
|
48
|
+
readonly supportsNoTools?: boolean | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* @since 1.0.0
|
|
52
|
+
* @category System prompts
|
|
53
|
+
*/
|
|
54
|
+
export declare class AgentModelConfig extends AgentModelConfig_base {
|
|
55
|
+
static readonly layer: (options: typeof AgentModelConfig.Service) => Layer.Layer<never, never, never>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A layer that provides most of the common services needed to run an agent.
|
|
59
|
+
*
|
|
60
|
+
* @since 1.0.0
|
|
61
|
+
* @category Services
|
|
62
|
+
*/
|
|
63
|
+
export declare const layerServices: Layer.Layer<Tool.HandlersFor<typeof AgentTools.tools> | Executor | ToolkitRenderer, never, FileSystem.FileSystem | Path.Path | ChildProcessSpawner.ChildProcessSpawner>;
|
|
43
64
|
declare const ReasoningStart_base: Schema.ExtendableClass<ReasoningStart, Schema.TaggedStruct<"ReasoningStart", {}>, {}>;
|
|
44
65
|
/**
|
|
45
66
|
* @since 1.0.0
|
|
@@ -63,24 +84,38 @@ declare const ReasoningEnd_base: Schema.ExtendableClass<ReasoningEnd, Schema.Tag
|
|
|
63
84
|
*/
|
|
64
85
|
export declare class ReasoningEnd extends ReasoningEnd_base {
|
|
65
86
|
}
|
|
66
|
-
declare const ScriptStart_base: Schema.ExtendableClass<ScriptStart, Schema.TaggedStruct<"ScriptStart", {
|
|
67
|
-
readonly script: Schema.String;
|
|
68
|
-
}>, {}>;
|
|
87
|
+
declare const ScriptStart_base: Schema.ExtendableClass<ScriptStart, Schema.TaggedStruct<"ScriptStart", {}>, {}>;
|
|
69
88
|
/**
|
|
70
89
|
* @since 1.0.0
|
|
71
90
|
* @category Output
|
|
72
91
|
*/
|
|
73
92
|
export declare class ScriptStart extends ScriptStart_base {
|
|
74
93
|
}
|
|
75
|
-
declare const
|
|
76
|
-
readonly
|
|
94
|
+
declare const ScriptDelta_base: Schema.ExtendableClass<ScriptDelta, Schema.TaggedStruct<"ScriptDelta", {
|
|
95
|
+
readonly delta: Schema.String;
|
|
77
96
|
}>, {}>;
|
|
97
|
+
/**
|
|
98
|
+
* @since 1.0.0
|
|
99
|
+
* @category Output
|
|
100
|
+
*/
|
|
101
|
+
export declare class ScriptDelta extends ScriptDelta_base {
|
|
102
|
+
}
|
|
103
|
+
declare const ScriptEnd_base: Schema.ExtendableClass<ScriptEnd, Schema.TaggedStruct<"ScriptEnd", {}>, {}>;
|
|
78
104
|
/**
|
|
79
105
|
* @since 1.0.0
|
|
80
106
|
* @category Output
|
|
81
107
|
*/
|
|
82
108
|
export declare class ScriptEnd extends ScriptEnd_base {
|
|
83
109
|
}
|
|
110
|
+
declare const ScriptOutput_base: Schema.ExtendableClass<ScriptOutput, Schema.TaggedStruct<"ScriptOutput", {
|
|
111
|
+
readonly output: Schema.String;
|
|
112
|
+
}>, {}>;
|
|
113
|
+
/**
|
|
114
|
+
* @since 1.0.0
|
|
115
|
+
* @category Output
|
|
116
|
+
*/
|
|
117
|
+
export declare class ScriptOutput extends ScriptOutput_base {
|
|
118
|
+
}
|
|
84
119
|
declare const AgentFinished_base: Schema.ErrorClass<AgentFinished, Schema.TaggedStruct<"AgentFinished", {
|
|
85
120
|
readonly summary: Schema.String;
|
|
86
121
|
}>, import("effect/Cause").YieldableError>;
|
|
@@ -90,36 +125,50 @@ declare const AgentFinished_base: Schema.ErrorClass<AgentFinished, Schema.Tagged
|
|
|
90
125
|
*/
|
|
91
126
|
export declare class AgentFinished extends AgentFinished_base {
|
|
92
127
|
}
|
|
128
|
+
declare const SubagentStart_base: Schema.ExtendableClass<SubagentStart, Schema.TaggedStruct<"SubagentStart", {
|
|
129
|
+
readonly id: Schema.Number;
|
|
130
|
+
readonly prompt: Schema.String;
|
|
131
|
+
readonly model: Schema.String;
|
|
132
|
+
readonly provider: Schema.String;
|
|
133
|
+
}>, {}>;
|
|
93
134
|
/**
|
|
94
135
|
* @since 1.0.0
|
|
95
136
|
* @category Output
|
|
96
137
|
*/
|
|
97
|
-
export declare
|
|
138
|
+
export declare class SubagentStart extends SubagentStart_base {
|
|
139
|
+
get modelAndProvider(): string;
|
|
140
|
+
}
|
|
141
|
+
declare const SubagentComplete_base: Schema.ExtendableClass<SubagentComplete, Schema.TaggedStruct<"SubagentComplete", {
|
|
142
|
+
readonly id: Schema.Number;
|
|
143
|
+
readonly summary: Schema.String;
|
|
144
|
+
}>, {}>;
|
|
98
145
|
/**
|
|
99
146
|
* @since 1.0.0
|
|
100
147
|
* @category Output
|
|
101
148
|
*/
|
|
102
|
-
export
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
149
|
+
export declare class SubagentComplete extends SubagentComplete_base {
|
|
150
|
+
}
|
|
151
|
+
export type ContentPart = ReasoningStart | ReasoningDelta | ReasoningEnd | ScriptStart | ScriptDelta | ScriptEnd | ScriptOutput;
|
|
152
|
+
export declare const ContentPart: Schema.Union<readonly [typeof ReasoningStart, typeof ReasoningDelta, typeof ReasoningEnd, typeof ScriptStart, typeof ScriptDelta, typeof ScriptEnd, typeof ScriptOutput]>;
|
|
153
|
+
declare const SubagentPart_base: Schema.ExtendableClass<SubagentPart, Schema.TaggedStruct<"SubagentPart", {
|
|
154
|
+
readonly id: Schema.Number;
|
|
155
|
+
readonly part: Schema.Union<readonly [typeof ReasoningStart, typeof ReasoningDelta, typeof ReasoningEnd, typeof ScriptStart, typeof ScriptDelta, typeof ScriptEnd, typeof ScriptOutput]>;
|
|
156
|
+
}>, {}>;
|
|
106
157
|
/**
|
|
107
158
|
* @since 1.0.0
|
|
108
159
|
* @category Output
|
|
109
160
|
*/
|
|
110
|
-
export declare class SubagentPart extends SubagentPart_base
|
|
111
|
-
id: number;
|
|
112
|
-
prompt: string;
|
|
113
|
-
model: string;
|
|
114
|
-
provider: string;
|
|
115
|
-
output: Stream.Stream<Output, AgentFinished>;
|
|
116
|
-
}> {
|
|
117
|
-
get modelAndProvider(): string;
|
|
161
|
+
export declare class SubagentPart extends SubagentPart_base {
|
|
118
162
|
}
|
|
119
163
|
/**
|
|
120
164
|
* @since 1.0.0
|
|
121
165
|
* @category Output
|
|
122
166
|
*/
|
|
123
|
-
export type Output =
|
|
167
|
+
export type Output = ContentPart | SubagentStart | SubagentComplete | SubagentPart;
|
|
168
|
+
/**
|
|
169
|
+
* @since 1.0.0
|
|
170
|
+
* @category Output
|
|
171
|
+
*/
|
|
172
|
+
export declare const Output: Schema.Union<readonly [typeof ReasoningStart, typeof ReasoningDelta, typeof ReasoningEnd, typeof ScriptStart, typeof ScriptDelta, typeof ScriptEnd, typeof ScriptOutput, typeof SubagentStart, typeof SubagentComplete, typeof SubagentPart]>;
|
|
124
173
|
export {};
|
|
125
174
|
//# sourceMappingURL=Agent.d.ts.map
|
package/dist/Agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../src/Agent.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../src/Agent.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAGL,MAAM,EACN,UAAU,EAEV,KAAK,EAEL,IAAI,EAGJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,MAAM,EACP,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,OAAO,EACP,aAAa,EACb,MAAM,EACN,IAAI,EACJ,OAAO,EACR,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEL,UAAU,EAIX,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAElE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAElE;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAEvE;;;;;;;OAOG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;CAC5C;AAED;;;;;GAKG;AACH,eAAO,MAAM,IAAI,EAAE,CACjB,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC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