wave-agent-sdk 0.0.7 → 0.0.8
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 +32 -20
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +202 -20
- package/dist/constants/events.d.ts +28 -0
- package/dist/constants/events.d.ts.map +1 -0
- package/dist/constants/events.js +27 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/managers/aiManager.d.ts +34 -1
- package/dist/managers/aiManager.d.ts.map +1 -1
- package/dist/managers/aiManager.js +243 -128
- package/dist/managers/backgroundBashManager.d.ts.map +1 -1
- package/dist/managers/backgroundBashManager.js +7 -6
- package/dist/managers/hookManager.d.ts +9 -4
- package/dist/managers/hookManager.d.ts.map +1 -1
- package/dist/managers/hookManager.js +62 -30
- package/dist/managers/liveConfigManager.d.ts +58 -0
- package/dist/managers/liveConfigManager.d.ts.map +1 -0
- package/dist/managers/liveConfigManager.js +160 -0
- package/dist/managers/messageManager.d.ts +38 -13
- package/dist/managers/messageManager.d.ts.map +1 -1
- package/dist/managers/messageManager.js +163 -30
- package/dist/managers/slashCommandManager.d.ts.map +1 -1
- package/dist/managers/slashCommandManager.js +4 -1
- package/dist/managers/subagentManager.d.ts +51 -0
- package/dist/managers/subagentManager.d.ts.map +1 -1
- package/dist/managers/subagentManager.js +189 -18
- package/dist/services/aiService.d.ts +13 -5
- package/dist/services/aiService.d.ts.map +1 -1
- package/dist/services/aiService.js +350 -74
- package/dist/services/configurationWatcher.d.ts +120 -0
- package/dist/services/configurationWatcher.d.ts.map +1 -0
- package/dist/services/configurationWatcher.js +439 -0
- package/dist/services/fileWatcher.d.ts +69 -0
- package/dist/services/fileWatcher.d.ts.map +1 -0
- package/dist/services/fileWatcher.js +213 -0
- package/dist/services/hook.d.ts +91 -9
- package/dist/services/hook.d.ts.map +1 -1
- package/dist/services/hook.js +393 -43
- package/dist/services/jsonlHandler.d.ts +62 -0
- package/dist/services/jsonlHandler.d.ts.map +1 -0
- package/dist/services/jsonlHandler.js +257 -0
- package/dist/services/memory.d.ts +9 -0
- package/dist/services/memory.d.ts.map +1 -1
- package/dist/services/memory.js +81 -12
- package/dist/services/memoryStore.d.ts +81 -0
- package/dist/services/memoryStore.d.ts.map +1 -0
- package/dist/services/memoryStore.js +200 -0
- package/dist/services/session.d.ts +64 -49
- package/dist/services/session.d.ts.map +1 -1
- package/dist/services/session.js +310 -132
- package/dist/tools/bashTool.d.ts.map +1 -1
- package/dist/tools/bashTool.js +5 -4
- package/dist/tools/deleteFileTool.d.ts.map +1 -1
- package/dist/tools/deleteFileTool.js +2 -1
- package/dist/tools/editTool.d.ts.map +1 -1
- package/dist/tools/editTool.js +3 -2
- package/dist/tools/multiEditTool.d.ts.map +1 -1
- package/dist/tools/multiEditTool.js +4 -3
- package/dist/tools/readTool.d.ts.map +1 -1
- package/dist/tools/readTool.js +2 -1
- package/dist/tools/writeTool.d.ts.map +1 -1
- package/dist/tools/writeTool.js +5 -6
- package/dist/types/commands.d.ts +4 -0
- package/dist/types/commands.d.ts.map +1 -1
- package/dist/types/core.d.ts +35 -0
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/environment.d.ts +42 -0
- package/dist/types/environment.d.ts.map +1 -0
- package/dist/types/environment.js +21 -0
- package/dist/types/hooks.d.ts +8 -2
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/hooks.js +8 -2
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/memoryStore.d.ts +82 -0
- package/dist/types/memoryStore.d.ts.map +1 -0
- package/dist/types/memoryStore.js +7 -0
- package/dist/types/messaging.d.ts +14 -2
- package/dist/types/messaging.d.ts.map +1 -1
- package/dist/types/session.d.ts +20 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +7 -0
- package/dist/utils/bashHistory.d.ts.map +1 -1
- package/dist/utils/bashHistory.js +27 -26
- package/dist/utils/cacheControlUtils.d.ts +121 -0
- package/dist/utils/cacheControlUtils.d.ts.map +1 -0
- package/dist/utils/cacheControlUtils.js +367 -0
- package/dist/utils/commandPathResolver.d.ts +52 -0
- package/dist/utils/commandPathResolver.d.ts.map +1 -0
- package/dist/utils/commandPathResolver.js +145 -0
- package/dist/utils/configPaths.d.ts +85 -0
- package/dist/utils/configPaths.d.ts.map +1 -0
- package/dist/utils/configPaths.js +121 -0
- package/dist/utils/configResolver.d.ts +37 -10
- package/dist/utils/configResolver.d.ts.map +1 -1
- package/dist/utils/configResolver.js +127 -23
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/convertMessagesForAPI.d.ts.map +1 -1
- package/dist/utils/convertMessagesForAPI.js +7 -5
- package/dist/utils/customCommands.d.ts.map +1 -1
- package/dist/utils/customCommands.js +66 -21
- package/dist/utils/fileUtils.d.ts +15 -0
- package/dist/utils/fileUtils.d.ts.map +1 -0
- package/dist/utils/fileUtils.js +61 -0
- package/dist/utils/globalLogger.d.ts +102 -0
- package/dist/utils/globalLogger.d.ts.map +1 -0
- package/dist/utils/globalLogger.js +136 -0
- package/dist/utils/mcpUtils.d.ts.map +1 -1
- package/dist/utils/mcpUtils.js +25 -3
- package/dist/utils/messageOperations.d.ts +20 -8
- package/dist/utils/messageOperations.d.ts.map +1 -1
- package/dist/utils/messageOperations.js +25 -16
- package/dist/utils/pathEncoder.d.ts +104 -0
- package/dist/utils/pathEncoder.d.ts.map +1 -0
- package/dist/utils/pathEncoder.js +272 -0
- package/dist/utils/subagentParser.d.ts.map +1 -1
- package/dist/utils/subagentParser.js +2 -1
- package/dist/utils/tokenCalculation.d.ts +26 -0
- package/dist/utils/tokenCalculation.d.ts.map +1 -0
- package/dist/utils/tokenCalculation.js +36 -0
- package/package.json +6 -3
- package/src/agent.ts +298 -34
- package/src/constants/events.ts +38 -0
- package/src/index.ts +2 -0
- package/src/managers/aiManager.ts +323 -170
- package/src/managers/backgroundBashManager.ts +7 -6
- package/src/managers/hookManager.ts +83 -40
- package/src/managers/liveConfigManager.ts +248 -0
- package/src/managers/messageManager.ts +230 -63
- package/src/managers/slashCommandManager.ts +4 -1
- package/src/managers/subagentManager.ts +283 -21
- package/src/services/aiService.ts +474 -83
- package/src/services/configurationWatcher.ts +622 -0
- package/src/services/fileWatcher.ts +301 -0
- package/src/services/hook.ts +538 -47
- package/src/services/jsonlHandler.ts +319 -0
- package/src/services/memory.ts +92 -12
- package/src/services/memoryStore.ts +279 -0
- package/src/services/session.ts +381 -157
- package/src/tools/bashTool.ts +5 -4
- package/src/tools/deleteFileTool.ts +2 -1
- package/src/tools/editTool.ts +3 -2
- package/src/tools/multiEditTool.ts +4 -3
- package/src/tools/readTool.ts +2 -1
- package/src/tools/writeTool.ts +7 -6
- package/src/types/commands.ts +6 -0
- package/src/types/core.ts +44 -0
- package/src/types/environment.ts +60 -0
- package/src/types/hooks.ts +21 -8
- package/src/types/index.ts +2 -0
- package/src/types/memoryStore.ts +94 -0
- package/src/types/messaging.ts +14 -2
- package/src/types/session.ts +25 -0
- package/src/utils/bashHistory.ts +27 -27
- package/src/utils/cacheControlUtils.ts +540 -0
- package/src/utils/commandPathResolver.ts +189 -0
- package/src/utils/configPaths.ts +163 -0
- package/src/utils/configResolver.ts +182 -22
- package/src/utils/constants.ts +1 -1
- package/src/utils/convertMessagesForAPI.ts +7 -5
- package/src/utils/customCommands.ts +90 -22
- package/src/utils/fileUtils.ts +65 -0
- package/src/utils/globalLogger.ts +145 -0
- package/src/utils/mcpUtils.ts +34 -3
- package/src/utils/messageOperations.ts +42 -20
- package/src/utils/pathEncoder.ts +379 -0
- package/src/utils/subagentParser.ts +2 -1
- package/src/utils/tokenCalculation.ts +43 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFile, writeFile } from "fs/promises";
|
|
2
|
+
import { logger } from "../utils/globalLogger.js";
|
|
2
3
|
import { resolvePath, getDisplayPath } from "../utils/path.js";
|
|
3
4
|
import { diffLines } from "diff";
|
|
4
5
|
/**
|
|
@@ -123,7 +124,7 @@ export const multiEditTool = {
|
|
|
123
124
|
if (edits[0] && edits[0].old_string === "") {
|
|
124
125
|
originalContent = "";
|
|
125
126
|
isNewFile = true;
|
|
126
|
-
|
|
127
|
+
logger.debug(`Creating new file: ${resolvedPath}`);
|
|
127
128
|
}
|
|
128
129
|
else {
|
|
129
130
|
return {
|
|
@@ -192,7 +193,7 @@ export const multiEditTool = {
|
|
|
192
193
|
? `Created file with ${edits.length} operations`
|
|
193
194
|
: `Applied ${edits.length} edits`;
|
|
194
195
|
const detailedContent = `${shortResult}\n\nOperations performed:\n${appliedEdits.map((edit, i) => `${i + 1}. ${edit}`).join("\n")}`;
|
|
195
|
-
|
|
196
|
+
logger.debug(`MultiEdit tool: ${shortResult}`);
|
|
196
197
|
return {
|
|
197
198
|
success: true,
|
|
198
199
|
content: detailedContent,
|
|
@@ -205,7 +206,7 @@ export const multiEditTool = {
|
|
|
205
206
|
}
|
|
206
207
|
catch (error) {
|
|
207
208
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
208
|
-
|
|
209
|
+
logger.error(`MultiEdit tool error: ${errorMessage}`);
|
|
209
210
|
return {
|
|
210
211
|
success: false,
|
|
211
212
|
content: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readTool.d.ts","sourceRoot":"","sources":["../../src/tools/readTool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"readTool.d.ts","sourceRoot":"","sources":["../../src/tools/readTool.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAOtE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UA2LtB,CAAC"}
|
package/dist/tools/readTool.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFile } from "fs/promises";
|
|
2
|
+
import { logger } from "../utils/globalLogger.js";
|
|
2
3
|
import { resolvePath, getDisplayPath } from "../utils/path.js";
|
|
3
4
|
import { isBinaryDocument, getBinaryDocumentError, } from "../utils/fileFormat.js";
|
|
4
5
|
/**
|
|
@@ -59,7 +60,7 @@ export const readTool = {
|
|
|
59
60
|
const fileContent = await readFile(actualFilePath, "utf-8");
|
|
60
61
|
// Check if file is empty
|
|
61
62
|
if (fileContent.length === 0) {
|
|
62
|
-
|
|
63
|
+
logger.warn(`File ${filePath} exists but has empty contents`);
|
|
63
64
|
return {
|
|
64
65
|
success: true,
|
|
65
66
|
content: "⚠️ System reminder: This file exists but has empty contents.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeTool.d.ts","sourceRoot":"","sources":["../../src/tools/writeTool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeTool.d.ts","sourceRoot":"","sources":["../../src/tools/writeTool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAItE;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,UAyJvB,CAAC"}
|
package/dist/tools/writeTool.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile, writeFile, mkdir } from "fs/promises";
|
|
2
2
|
import { dirname } from "path";
|
|
3
|
+
import { logger } from "../utils/globalLogger.js";
|
|
3
4
|
import { resolvePath, getDisplayPath } from "../utils/path.js";
|
|
4
5
|
import { diffLines } from "diff";
|
|
5
6
|
/**
|
|
@@ -11,7 +12,7 @@ export const writeTool = {
|
|
|
11
12
|
type: "function",
|
|
12
13
|
function: {
|
|
13
14
|
name: "Write",
|
|
14
|
-
description: "Writes a file to the local filesystem.\n\nUsage:\n- This tool will overwrite the existing file if there is one at the provided path.\n- If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.\n- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.",
|
|
15
|
+
description: "Writes a file to the local filesystem.\n\nUsage:\n- This tool will overwrite the existing file if there is one at the provided path.\n- If this is an existing file, you MUST use the Read tool first to read the file's contents. This tool will fail if you did not read the file first.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.\n- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.\n- IMPORTANT: Always provide file_path parameter before content parameter when calling this tool.",
|
|
15
16
|
parameters: {
|
|
16
17
|
type: "object",
|
|
17
18
|
properties: {
|
|
@@ -81,9 +82,7 @@ export const writeTool = {
|
|
|
81
82
|
// Ignore directory already exists error
|
|
82
83
|
if (mkdirError instanceof Error &&
|
|
83
84
|
!mkdirError.message.includes("EEXIST")) {
|
|
84
|
-
|
|
85
|
-
// `Failed to create directory ${fileDir}: ${mkdirError.message}`,
|
|
86
|
-
// );
|
|
85
|
+
logger.warn(`Failed to create directory ${fileDir}: ${mkdirError.message}`);
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
// Write file
|
|
@@ -103,7 +102,7 @@ export const writeTool = {
|
|
|
103
102
|
const lines = content.split("\n").length;
|
|
104
103
|
const chars = content.length;
|
|
105
104
|
const detailedContent = `${shortResult} (${lines} lines, ${chars} characters)`;
|
|
106
|
-
|
|
105
|
+
logger.debug(`Write tool: ${shortResult}`);
|
|
107
106
|
return {
|
|
108
107
|
success: true,
|
|
109
108
|
content: detailedContent,
|
|
@@ -116,7 +115,7 @@ export const writeTool = {
|
|
|
116
115
|
}
|
|
117
116
|
catch (error) {
|
|
118
117
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
119
|
-
|
|
118
|
+
logger.error(`Write tool error: ${errorMessage}`);
|
|
120
119
|
return {
|
|
121
120
|
success: false,
|
|
122
121
|
content: "",
|
package/dist/types/commands.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/types/commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/types/commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,wBAAwB,CAAC;IAGlC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
|
package/dist/types/core.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Core foundational types used across multiple domains
|
|
3
3
|
* Dependencies: None (foundation layer)
|
|
4
4
|
*/
|
|
5
|
+
import type { CompletionUsage } from "openai/resources";
|
|
5
6
|
/**
|
|
6
7
|
* Logger interface definition
|
|
7
8
|
* Compatible with OpenAI package Logger interface
|
|
@@ -22,6 +23,40 @@ export interface Usage {
|
|
|
22
23
|
total_tokens: number;
|
|
23
24
|
model?: string;
|
|
24
25
|
operation_type?: "agent" | "compress";
|
|
26
|
+
cache_read_input_tokens?: number;
|
|
27
|
+
cache_creation_input_tokens?: number;
|
|
28
|
+
cache_creation?: {
|
|
29
|
+
ephemeral_5m_input_tokens: number;
|
|
30
|
+
ephemeral_1h_input_tokens: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Enhanced usage metrics including Claude cache information
|
|
35
|
+
* Backward compatible with standard OpenAI CompletionUsage
|
|
36
|
+
*/
|
|
37
|
+
export interface ClaudeUsage extends CompletionUsage {
|
|
38
|
+
prompt_tokens: number;
|
|
39
|
+
completion_tokens: number;
|
|
40
|
+
total_tokens: number;
|
|
41
|
+
/**
|
|
42
|
+
* Number of tokens read from existing cache
|
|
43
|
+
* Indicates cost savings from cache hits
|
|
44
|
+
*/
|
|
45
|
+
cache_read_input_tokens?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Number of tokens used to create new cache entries
|
|
48
|
+
* Investment in future cache hits
|
|
49
|
+
*/
|
|
50
|
+
cache_creation_input_tokens?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Detailed breakdown of cache creation by duration
|
|
53
|
+
*/
|
|
54
|
+
cache_creation?: {
|
|
55
|
+
/** Tokens cached for 5 minute duration */
|
|
56
|
+
ephemeral_5m_input_tokens: number;
|
|
57
|
+
/** Tokens cached for 1 hour duration */
|
|
58
|
+
ephemeral_1h_input_tokens: number;
|
|
59
|
+
};
|
|
25
60
|
}
|
|
26
61
|
export declare class ConfigurationError extends Error {
|
|
27
62
|
readonly field: string;
|
package/dist/types/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/types/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/types/core.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,CAAC,GAAG,IAAI,EA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GD,eAAO,MAAM,aAAa;;;;;;CAQhB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Variable System Types
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive TypeScript types for environment variable validation,
|
|
5
|
+
* merging, and conflict resolution in the Wave Agent SDK.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Result of environment variable validation
|
|
9
|
+
*/
|
|
10
|
+
export interface EnvironmentValidationResult {
|
|
11
|
+
isValid: boolean;
|
|
12
|
+
errors: string[];
|
|
13
|
+
warnings: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Context containing merged environment variables and conflict information
|
|
17
|
+
*/
|
|
18
|
+
export interface MergedEnvironmentContext {
|
|
19
|
+
userVars: Record<string, string>;
|
|
20
|
+
projectVars: Record<string, string>;
|
|
21
|
+
mergedVars: Record<string, string>;
|
|
22
|
+
conflicts: Array<{
|
|
23
|
+
key: string;
|
|
24
|
+
userValue: string;
|
|
25
|
+
projectValue: string;
|
|
26
|
+
resolvedValue: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Type guard to check if a value is a valid environment variables object
|
|
31
|
+
*/
|
|
32
|
+
export declare function isValidEnvironmentVars(env: unknown): env is Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Configuration options for environment merging
|
|
35
|
+
*/
|
|
36
|
+
export interface EnvironmentMergeOptions {
|
|
37
|
+
/** Whether to include warnings for conflicting variables */
|
|
38
|
+
includeConflictWarnings?: boolean;
|
|
39
|
+
/** Whether to validate variable names for common patterns */
|
|
40
|
+
validateVariableNames?: boolean;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../src/types/environment.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,OAAO,GACX,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAa/B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,6DAA6D;IAC7D,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Variable System Types
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive TypeScript types for environment variable validation,
|
|
5
|
+
* merging, and conflict resolution in the Wave Agent SDK.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Type guard to check if a value is a valid environment variables object
|
|
9
|
+
*/
|
|
10
|
+
export function isValidEnvironmentVars(env) {
|
|
11
|
+
if (typeof env !== "object" || env === null) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
// Check if all keys and values are strings
|
|
15
|
+
for (const [key, value] of Object.entries(env)) {
|
|
16
|
+
if (typeof key !== "string" || typeof value !== "string") {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
}
|
package/dist/types/hooks.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* enabling automated actions at specific workflow points.
|
|
6
6
|
*/
|
|
7
7
|
export declare function getSessionFilePath(sessionId: string): string;
|
|
8
|
-
export type HookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop";
|
|
8
|
+
export type HookEvent = "PreToolUse" | "PostToolUse" | "UserPromptSubmit" | "Stop" | "SubagentStop";
|
|
9
9
|
export interface HookCommand {
|
|
10
10
|
type: "command";
|
|
11
11
|
command: string;
|
|
@@ -14,7 +14,11 @@ export interface HookEventConfig {
|
|
|
14
14
|
matcher?: string;
|
|
15
15
|
hooks: HookCommand[];
|
|
16
16
|
}
|
|
17
|
-
export interface
|
|
17
|
+
export interface WaveConfiguration {
|
|
18
|
+
hooks?: Partial<Record<HookEvent, HookEventConfig[]>>;
|
|
19
|
+
env?: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
export interface HookConfiguration extends WaveConfiguration {
|
|
18
22
|
hooks: Partial<Record<HookEvent, HookEventConfig[]>>;
|
|
19
23
|
}
|
|
20
24
|
export type PartialHookConfiguration = Partial<Record<HookEvent, HookEventConfig[]>>;
|
|
@@ -65,6 +69,7 @@ export interface HookJsonInput {
|
|
|
65
69
|
tool_input?: unknown;
|
|
66
70
|
tool_response?: unknown;
|
|
67
71
|
user_prompt?: string;
|
|
72
|
+
subagent_type?: string;
|
|
68
73
|
}
|
|
69
74
|
export interface ExtendedHookExecutionContext extends HookExecutionContext {
|
|
70
75
|
sessionId?: string;
|
|
@@ -73,6 +78,7 @@ export interface ExtendedHookExecutionContext extends HookExecutionContext {
|
|
|
73
78
|
toolInput?: unknown;
|
|
74
79
|
toolResponse?: unknown;
|
|
75
80
|
userPrompt?: string;
|
|
81
|
+
subagentType?: string;
|
|
76
82
|
}
|
|
77
83
|
export interface HookEnvironment {
|
|
78
84
|
WAVE_PROJECT_DIR: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/types/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG5D;AAGD,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/types/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG5D;AAGD,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,cAAc,CAAC;AAGnB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAGD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;IACtD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAGD,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC;CACtD;AAGD,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAC5C,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,CAAC,CACrC,CAAC;AAGF,MAAM,MAAM,uBAAuB,GAAG,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E,OAAO,GACd,MAAM,IAAI,eAAe,CAa3B;AAGD,MAAM,WAAW,aAAa;IAE5B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,SAAS,CAAC;IAG3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB"}
|
package/dist/types/hooks.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { join } from "path";
|
|
8
8
|
import { homedir } from "os";
|
|
9
|
-
// Session path utility (
|
|
9
|
+
// Session path utility (simplified version for hooks)
|
|
10
10
|
export function getSessionFilePath(sessionId) {
|
|
11
11
|
const shortId = sessionId.split("_")[2] || sessionId.slice(-8);
|
|
12
12
|
return join(homedir(), ".wave", "sessions", `session_${shortId}.json`);
|
|
@@ -32,7 +32,13 @@ export class HookConfigurationError extends Error {
|
|
|
32
32
|
}
|
|
33
33
|
// Type guards for runtime validation
|
|
34
34
|
export function isValidHookEvent(event) {
|
|
35
|
-
return [
|
|
35
|
+
return [
|
|
36
|
+
"PreToolUse",
|
|
37
|
+
"PostToolUse",
|
|
38
|
+
"UserPromptSubmit",
|
|
39
|
+
"Stop",
|
|
40
|
+
"SubagentStop",
|
|
41
|
+
].includes(event);
|
|
36
42
|
}
|
|
37
43
|
export function isValidHookCommand(cmd) {
|
|
38
44
|
return (typeof cmd === "object" &&
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,cAAc,WAAW,CAAC;AAG1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,cAAc,WAAW,CAAC;AAG1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory Store Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Provides TypeScript types for in-memory file storage system,
|
|
5
|
+
* enabling optimized access to frequently read files like AGENTS.md.
|
|
6
|
+
*/
|
|
7
|
+
export interface MemoryStore {
|
|
8
|
+
content: string;
|
|
9
|
+
lastModified: number;
|
|
10
|
+
path: string;
|
|
11
|
+
isLoaded: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface MemoryStoreEntry {
|
|
14
|
+
content: string;
|
|
15
|
+
path: string;
|
|
16
|
+
lastModified: number;
|
|
17
|
+
isLoaded: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface MemoryStoreStats {
|
|
20
|
+
contentSize: number;
|
|
21
|
+
lastUpdated: number;
|
|
22
|
+
updateCount: number;
|
|
23
|
+
isLoaded: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface MemoryUpdateEvent {
|
|
26
|
+
path: string;
|
|
27
|
+
reason: "file_change" | "initial_load" | "manual_reload";
|
|
28
|
+
timestamp: number;
|
|
29
|
+
previousSize?: number;
|
|
30
|
+
newSize: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Memory Store Service Interface
|
|
34
|
+
* Maps to FR-006, FR-007: Memory storage and updates
|
|
35
|
+
*/
|
|
36
|
+
export interface MemoryStoreService {
|
|
37
|
+
/**
|
|
38
|
+
* Get content from memory store (loads from file if not loaded)
|
|
39
|
+
* Maps to FR-006: Keep AGENTS.md content in memory to avoid repeated reads
|
|
40
|
+
*/
|
|
41
|
+
getContent(path: string): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Update memory content from file
|
|
44
|
+
* Maps to FR-007: Update memory content when file changes
|
|
45
|
+
*/
|
|
46
|
+
updateContent(path: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Get memory store statistics
|
|
49
|
+
* For monitoring and debugging
|
|
50
|
+
*/
|
|
51
|
+
getStats(path?: string): MemoryStoreStats;
|
|
52
|
+
/**
|
|
53
|
+
* Check if content is loaded in memory
|
|
54
|
+
* For status checking
|
|
55
|
+
*/
|
|
56
|
+
isLoaded(path: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Manually reload content from file
|
|
59
|
+
* For force refresh scenarios
|
|
60
|
+
*/
|
|
61
|
+
reloadContent(path: string): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Remove content from memory store
|
|
64
|
+
* For cleanup when file is deleted
|
|
65
|
+
*/
|
|
66
|
+
removeContent(path: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Clear all content from memory store
|
|
69
|
+
* For cleanup and testing
|
|
70
|
+
*/
|
|
71
|
+
clear(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Get all stored paths
|
|
74
|
+
* For monitoring and debugging
|
|
75
|
+
*/
|
|
76
|
+
getStoredPaths(): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Check if file exists and is accessible
|
|
79
|
+
*/
|
|
80
|
+
fileExists(path: string): Promise<boolean>;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=memoryStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoryStore.d.ts","sourceRoot":"","sources":["../../src/types/memoryStore.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,GAAG,cAAc,GAAG,eAAe,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAE1C;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAEhC;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAErC;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;OAGG;IACH,cAAc,IAAI,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5C"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Dependencies: Core (Usage)
|
|
4
4
|
*/
|
|
5
5
|
import type { Usage } from "./core.js";
|
|
6
|
+
import type { SubagentConfiguration } from "../utils/subagentParser.js";
|
|
6
7
|
export declare enum MessageSource {
|
|
7
8
|
USER = "user",
|
|
8
9
|
HOOK = "hook"
|
|
@@ -11,6 +12,7 @@ export interface Message {
|
|
|
11
12
|
role: "user" | "assistant";
|
|
12
13
|
blocks: MessageBlock[];
|
|
13
14
|
usage?: Usage;
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
14
16
|
}
|
|
15
17
|
export type MessageBlock = TextBlock | ErrorBlock | ToolBlock | ImageBlock | DiffBlock | CommandOutputBlock | CompressBlock | MemoryBlock | SubagentBlock;
|
|
16
18
|
export interface TextBlock {
|
|
@@ -34,10 +36,18 @@ export interface ToolBlock {
|
|
|
34
36
|
}>;
|
|
35
37
|
id?: string;
|
|
36
38
|
name?: string;
|
|
37
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Tool execution stage:
|
|
41
|
+
* - 'start': Tool call initiated (from AI service streaming)
|
|
42
|
+
* - 'streaming': Tool parameters being streamed (from AI service)
|
|
43
|
+
* - 'running': Tool execution in progress (from AI manager)
|
|
44
|
+
* - 'end': Tool execution completed (from AI manager)
|
|
45
|
+
*/
|
|
46
|
+
stage: "start" | "streaming" | "running" | "end";
|
|
38
47
|
success?: boolean;
|
|
39
48
|
error?: string | Error;
|
|
40
49
|
compactParams?: string;
|
|
50
|
+
parametersChunk?: string;
|
|
41
51
|
}
|
|
42
52
|
export interface ImageBlock {
|
|
43
53
|
type: "image";
|
|
@@ -62,6 +72,7 @@ export interface CommandOutputBlock {
|
|
|
62
72
|
export interface CompressBlock {
|
|
63
73
|
type: "compress";
|
|
64
74
|
content: string;
|
|
75
|
+
sessionId: string;
|
|
65
76
|
}
|
|
66
77
|
export interface MemoryBlock {
|
|
67
78
|
type: "memory";
|
|
@@ -75,6 +86,7 @@ export interface SubagentBlock {
|
|
|
75
86
|
subagentId: string;
|
|
76
87
|
subagentName: string;
|
|
77
88
|
status: "active" | "completed" | "error" | "aborted";
|
|
78
|
-
|
|
89
|
+
sessionId: string;
|
|
90
|
+
configuration: SubagentConfiguration;
|
|
79
91
|
}
|
|
80
92
|
//# sourceMappingURL=messaging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/types/messaging.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/types/messaging.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AA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,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,KAAK,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,qBAAqB,CAAC;CACtC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session management types for project-based organization with JSONL format
|
|
3
|
+
* Dependencies: Core messaging types
|
|
4
|
+
*
|
|
5
|
+
* SIMPLIFIED: Removed unused interfaces to focus on core functionality
|
|
6
|
+
*/
|
|
7
|
+
import type { Message } from "./messaging.js";
|
|
8
|
+
export interface SessionMessage extends Message {
|
|
9
|
+
timestamp: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SessionMetadataLine {
|
|
12
|
+
__meta__: true;
|
|
13
|
+
sessionId: string;
|
|
14
|
+
sessionType: "main" | "subagent";
|
|
15
|
+
parentSessionId?: string;
|
|
16
|
+
subagentType?: string;
|
|
17
|
+
workdir: string;
|
|
18
|
+
startedAt: string;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/types/session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,WAAW,cAAe,SAAQ,OAAO;IAC7C,SAAS,EAAE,MAAM,CAAC;CAEnB;AAGD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,IAAI,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,UAAU,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bashHistory.d.ts","sourceRoot":"","sources":["../../src/utils/bashHistory.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"bashHistory.d.ts","sourceRoot":"","sources":["../../src/utils/bashHistory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAkBD;;GAEG;AACH,eAAO,MAAM,eAAe,QAAO,WA+BlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,WAAW,KAAG,IAoBtD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,EACf,SAAS,MAAM,KACd,IA4BF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,MAAM,EACb,OAAO,MAAM,YAAK,EAClB,SAAS,MAAM,KACd,gBAAgB,EAsElB,CAAC;AAwBF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAS,MAAM,EACf,QAAO,MAAW,KACjB,gBAAgB,EAclB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,IAWnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAO;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CAwBpB,CAAC"}
|