zeitlich 0.1.1 → 0.2.1
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/README.md +168 -180
- package/dist/index.cjs +1337 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +128 -0
- package/dist/index.d.ts +51 -75
- package/dist/index.js +764 -1091
- package/dist/index.js.map +1 -1
- package/dist/workflow-CCoHnc3B.d.cts +943 -0
- package/dist/workflow-CCoHnc3B.d.ts +943 -0
- package/dist/workflow.cjs +930 -0
- package/dist/workflow.cjs.map +1 -0
- package/dist/workflow.d.cts +5 -0
- package/dist/workflow.d.ts +2 -1
- package/dist/workflow.js +559 -423
- package/dist/workflow.js.map +1 -1
- package/package.json +14 -13
- package/src/activities.ts +112 -0
- package/src/index.ts +49 -0
- package/src/lib/fs.ts +80 -0
- package/src/lib/model-invoker.ts +75 -0
- package/src/lib/session.ts +216 -0
- package/src/lib/state-manager.ts +268 -0
- package/src/lib/thread-manager.ts +169 -0
- package/src/lib/tool-router.ts +717 -0
- package/src/lib/types.ts +354 -0
- package/src/plugin.ts +28 -0
- package/src/tools/ask-user-question/handler.ts +25 -0
- package/src/tools/ask-user-question/tool.ts +46 -0
- package/src/tools/bash/bash.test.ts +104 -0
- package/src/tools/bash/handler.ts +45 -0
- package/src/tools/bash/tool.ts +36 -0
- package/src/tools/edit/handler.ts +156 -0
- package/src/tools/edit/tool.ts +39 -0
- package/src/tools/glob/handler.ts +62 -0
- package/src/tools/glob/tool.ts +27 -0
- package/src/tools/grep/tool.ts +45 -0
- package/src/tools/read/tool.ts +33 -0
- package/src/tools/task/handler.ts +75 -0
- package/src/tools/task/tool.ts +96 -0
- package/src/tools/task-create/handler.ts +49 -0
- package/src/tools/task-create/tool.ts +66 -0
- package/src/tools/task-get/handler.ts +38 -0
- package/src/tools/task-get/tool.ts +11 -0
- package/src/tools/task-list/handler.ts +33 -0
- package/src/tools/task-list/tool.ts +9 -0
- package/src/tools/task-update/handler.ts +79 -0
- package/src/tools/task-update/tool.ts +20 -0
- package/src/tools/write/tool.ts +26 -0
- package/src/workflow.ts +138 -0
- package/tsup.config.ts +22 -0
- package/dist/index.d.mts +0 -152
- package/dist/index.mjs +0 -1587
- package/dist/index.mjs.map +0 -1
- package/dist/workflow-7_MT-5-w.d.mts +0 -1203
- package/dist/workflow-7_MT-5-w.d.ts +0 -1203
- package/dist/workflow.d.mts +0 -4
- package/dist/workflow.mjs +0 -739
- package/dist/workflow.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { A as AgentResponse, a as ActivityToolHandler, b as AskUserQuestionToolSchemaType, G as GlobToolSchemaType, E as EditToolSchemaType } from './workflow-CCoHnc3B.js';
|
|
2
|
+
export { c as AGENT_HANDLER_NAMES, d as AgentFile, e as AgentState, f as AgentStateManager, g as AgentStatus, h as AppendToolResultFn, B as BaseAgentState, i as GenericTaskToolSchemaType, j as GrepToolSchemaType, I as InferToolResults, J as JsonPrimitive, k as JsonSerializable, l as JsonValue, P as ParsedToolCall, m as ParsedToolCallUnion, n as PostToolUseFailureHook, o as PostToolUseFailureHookContext, p as PostToolUseFailureHookResult, q as PostToolUseHook, r as PostToolUseHookContext, s as PreToolUseHook, t as PreToolUseHookContext, u as PreToolUseHookResult, v as ProcessToolCallsContext, R as RawToolCall, w as ReadToolSchemaType, x as RunAgentActivity, y as RunAgentConfig, S as SessionEndHook, z as SessionEndHookContext, C as SessionExitReason, D as SessionLifecycleHooks, F as SessionStartHook, H as SessionStartHookContext, K as SubagentConfig, L as SubagentInput, T as TaskCreateToolSchemaType, M as TaskGetToolSchemaType, N as TaskHandlerResult, O as TaskStatus, Q as TaskToolSchemaType, U as TaskUpdateToolSchemaType, V as ToolArgs, W as ToolCallResult, X as ToolCallResultUnion, Y as ToolDefinition, Z as ToolHandler, _ as ToolHandlerContext, $ as ToolHandlerResponse, a0 as ToolMap, a1 as ToolMessageContent, a2 as ToolNames, a3 as ToolResult, a4 as ToolResultConfig, a5 as ToolRouter, a6 as ToolWithHandler, a7 as WorkflowTask, a8 as WriteToolSchemaType, a9 as ZeitlichAgentConfig, aa as ZeitlichSession, ab as ZeitlichSharedActivities, ac as askUserQuestionTool, ad as bashTool, ae as bashToolSchemaType, af as createAgentStateManager, ag as createSession, ah as createSharedActivities, ai as createTaskCreateHandler, aj as createTaskGetHandler, ak as createTaskListHandler, al as createTaskTool, am as createTaskUpdateHandler, an as createToolRouter, ao as editTool, ap as globTool, aq as grepTool, ar as handleBashTool, as as hasNoOtherToolCalls, at as isTerminalStatus, au as readTool, av as taskCreateTool, aw as taskGetTool, ax as taskListTool, ay as taskUpdateTool, az as writeTool } from './workflow-CCoHnc3B.js';
|
|
3
3
|
import { SimplePlugin } from '@temporalio/plugin';
|
|
4
4
|
import Redis from 'ioredis';
|
|
5
|
+
import { WorkflowClient } from '@temporalio/client';
|
|
5
6
|
import { BaseChatModel, BaseChatModelCallOptions, BindToolsInput } from '@langchain/core/language_models/chat_models';
|
|
6
|
-
import { StoredMessage
|
|
7
|
+
import { StoredMessage } from '@langchain/core/messages';
|
|
8
|
+
import { IFileSystem } from 'just-bash';
|
|
7
9
|
import 'zod';
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -31,7 +33,6 @@ declare class ZeitlichPlugin extends SimplePlugin {
|
|
|
31
33
|
interface InvokeModelConfig {
|
|
32
34
|
threadId: string;
|
|
33
35
|
agentName: string;
|
|
34
|
-
tools: ToolDefinition[];
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Core model invocation logic - shared utility for workflow-specific activities
|
|
@@ -42,9 +43,14 @@ interface InvokeModelConfig {
|
|
|
42
43
|
* @param invocationConfig - Per-invocation configuration (system prompt, etc.)
|
|
43
44
|
* @returns Agent response with message and metadata
|
|
44
45
|
*/
|
|
45
|
-
declare function invokeModel(redis
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
declare function invokeModel({ redis, model, client, config: { threadId, agentName }, }: {
|
|
47
|
+
redis: Redis;
|
|
48
|
+
client: WorkflowClient;
|
|
49
|
+
config: InvokeModelConfig;
|
|
50
|
+
model: BaseChatModel<BaseChatModelCallOptions & {
|
|
51
|
+
tools?: BindToolsInput;
|
|
52
|
+
}>;
|
|
53
|
+
}): Promise<AgentResponse>;
|
|
48
54
|
|
|
49
55
|
/**
|
|
50
56
|
* Handle user interaction tool result - creates AI messages for display.
|
|
@@ -53,79 +59,46 @@ declare const handleAskUserQuestionToolResult: ActivityToolHandler<AskUserQuesti
|
|
|
53
59
|
chatMessages: StoredMessage[];
|
|
54
60
|
}>;
|
|
55
61
|
|
|
56
|
-
interface GlobHandlerConfig {
|
|
57
|
-
provider: FileSystemProvider;
|
|
58
|
-
scopedNodes: FileNode[];
|
|
59
|
-
}
|
|
60
62
|
/**
|
|
61
|
-
*
|
|
63
|
+
* Result of a glob operation
|
|
62
64
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
result: {
|
|
66
|
-
files: FileNode[];
|
|
67
|
-
};
|
|
68
|
-
}>;
|
|
69
|
-
|
|
70
|
-
interface GrepHandlerConfig {
|
|
71
|
-
provider: FileSystemProvider;
|
|
72
|
-
scopedNodes: FileNode[];
|
|
65
|
+
interface GlobResult {
|
|
66
|
+
files: string[];
|
|
73
67
|
}
|
|
74
68
|
/**
|
|
75
|
-
*
|
|
69
|
+
* Glob handler response
|
|
76
70
|
*/
|
|
77
|
-
|
|
71
|
+
interface GlobHandlerResponse {
|
|
78
72
|
content: string;
|
|
79
|
-
result:
|
|
80
|
-
matches: GrepMatch[];
|
|
81
|
-
};
|
|
82
|
-
}>;
|
|
83
|
-
|
|
84
|
-
interface ReadHandlerConfig {
|
|
85
|
-
provider: FileSystemProvider;
|
|
86
|
-
scopedNodes: FileNode[];
|
|
73
|
+
result: GlobResult;
|
|
87
74
|
}
|
|
88
75
|
/**
|
|
89
|
-
*
|
|
76
|
+
* Glob handler that searches within the scoped file tree.
|
|
77
|
+
*
|
|
78
|
+
* @param args - Tool arguments (pattern, root)
|
|
79
|
+
* @param provider - FileSystemProvider for I/O operations
|
|
90
80
|
*/
|
|
91
|
-
declare function
|
|
92
|
-
content: ContentBlock[];
|
|
93
|
-
result: {
|
|
94
|
-
path: string;
|
|
95
|
-
content: FileContent;
|
|
96
|
-
};
|
|
97
|
-
}>;
|
|
81
|
+
declare function globHandler(_args: GlobToolSchemaType, fs: IFileSystem): Promise<GlobHandlerResponse>;
|
|
98
82
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
* Set of file paths that have been read in this session.
|
|
104
|
-
* Required for enforcing read-before-write policy.
|
|
105
|
-
*/
|
|
106
|
-
readFiles: Set<string>;
|
|
107
|
-
/**
|
|
108
|
-
* If true, skip the read-before-write check (not recommended)
|
|
109
|
-
*/
|
|
110
|
-
skipReadCheck?: boolean;
|
|
111
|
-
}
|
|
112
|
-
interface WriteResult {
|
|
83
|
+
/**
|
|
84
|
+
* Result of an edit operation
|
|
85
|
+
*/
|
|
86
|
+
interface EditResult {
|
|
113
87
|
path: string;
|
|
114
88
|
success: boolean;
|
|
115
|
-
|
|
116
|
-
bytesWritten: number;
|
|
89
|
+
replacements: number;
|
|
117
90
|
}
|
|
118
91
|
/**
|
|
119
|
-
*
|
|
92
|
+
* Edit handler response
|
|
120
93
|
*/
|
|
121
|
-
|
|
94
|
+
interface EditHandlerResponse {
|
|
122
95
|
content: string;
|
|
123
|
-
result:
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
96
|
+
result: EditResult;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Options for edit handler
|
|
100
|
+
*/
|
|
101
|
+
interface EditHandlerOptions {
|
|
129
102
|
/**
|
|
130
103
|
* Set of file paths that have been read in this session.
|
|
131
104
|
* Required for enforcing read-before-write policy.
|
|
@@ -136,17 +109,20 @@ interface EditHandlerConfig {
|
|
|
136
109
|
*/
|
|
137
110
|
skipReadCheck?: boolean;
|
|
138
111
|
}
|
|
139
|
-
interface EditResult {
|
|
140
|
-
path: string;
|
|
141
|
-
success: boolean;
|
|
142
|
-
replacements: number;
|
|
143
|
-
}
|
|
144
112
|
/**
|
|
145
|
-
*
|
|
113
|
+
* Edit handler that edits files within the scoped file tree.
|
|
114
|
+
*
|
|
115
|
+
* @param args - Tool arguments (file_path, old_string, new_string, replace_all)
|
|
116
|
+
* @param options - Additional options (readFiles, skipReadCheck)
|
|
146
117
|
*/
|
|
147
|
-
declare function
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
118
|
+
declare function editHandler(args: EditToolSchemaType, fs: IFileSystem): Promise<EditHandlerResponse>;
|
|
119
|
+
|
|
120
|
+
declare const toTree: (fs: IFileSystem, opts?: {
|
|
121
|
+
dir?: string;
|
|
122
|
+
separator?: "/" | "\\";
|
|
123
|
+
depth?: number;
|
|
124
|
+
tab?: string;
|
|
125
|
+
sort?: boolean;
|
|
126
|
+
}) => Promise<string>;
|
|
151
127
|
|
|
152
|
-
export { ActivityToolHandler, AgentResponse, AskUserQuestionToolSchemaType, type
|
|
128
|
+
export { ActivityToolHandler, AgentResponse, AskUserQuestionToolSchemaType, type EditHandlerOptions, type EditHandlerResponse, type EditResult, EditToolSchemaType, GlobToolSchemaType, type InvokeModelConfig, ZeitlichPlugin, type ZeitlichPluginOptions, editHandler, globHandler, handleAskUserQuestionToolResult, invokeModel, toTree };
|