indusagi-coding-agent 0.1.27 → 0.1.29

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.29] - Update Docs & Dependency
4
+
5
+ ### Changed
6
+ - **Indusagi Dependency**: Updated to `^0.12.12` (published npm package)
7
+ - **Docs Link**: Added https://www.indusagi.com to README
8
+ - **Session Management**: SessionManager + message helpers now re-exported from `indusagi/agent`
9
+
10
+ ## [0.1.28] - Use Published Indusagi Package
11
+
12
+ ### Changed
13
+ - **Indusagi Dependency**: Changed from local file path to published npm package
14
+ - Was: `"indusagi": "file:../new_indusagi"`
15
+ - Now: `"indusagi": "^0.12.11"`
16
+ - Uses published package with all latest fixes
17
+
18
+ ---
19
+
3
20
  ## [0.1.27] - Task & Todo Tools from Indusagi
4
21
 
5
22
  ### Changed
package/README.md CHANGED
@@ -12,6 +12,8 @@ If you want the all-in-one bundle (ai + agent + tui + webui + coding agent), use
12
12
 
13
13
  - https://www.npmjs.com/package/indusagi
14
14
 
15
+ Docs: https://www.indusagi.com
16
+
15
17
  ## Install
16
18
 
17
19
  ```bash
@@ -1,77 +1,2 @@
1
- /**
2
- * Custom message types and transformers for the coding agent.
3
- *
4
- * Extends the base AgentMessage type with coding-agent specific message types,
5
- * and provides a transformer to convert them to LLM-compatible messages.
6
- */
7
- import type { AgentMessage } from "indusagi/agent";
8
- import type { ImageContent, Message, TextContent } from "indusagi/ai";
9
- export declare const COMPACTION_SUMMARY_PREFIX = "The conversation history before this point was compacted into the following summary:\n\n<summary>\n";
10
- export declare const COMPACTION_SUMMARY_SUFFIX = "\n</summary>";
11
- export declare const BRANCH_SUMMARY_PREFIX = "The following is a summary of a branch that this conversation came back from:\n\n<summary>\n";
12
- export declare const BRANCH_SUMMARY_SUFFIX = "</summary>";
13
- /**
14
- * Message type for bash executions via the ! command.
15
- */
16
- export interface BashExecutionMessage {
17
- role: "bashExecution";
18
- command: string;
19
- output: string;
20
- exitCode: number | undefined;
21
- cancelled: boolean;
22
- truncated: boolean;
23
- fullOutputPath?: string;
24
- timestamp: number;
25
- /** If true, this message is excluded from LLM context (!! prefix) */
26
- excludeFromContext?: boolean;
27
- }
28
- /**
29
- * Message type for extension-injected messages via sendMessage().
30
- * These are custom messages that extensions can inject into the conversation.
31
- */
32
- export interface CustomMessage<T = unknown> {
33
- role: "custom";
34
- customType: string;
35
- content: string | (TextContent | ImageContent)[];
36
- display: boolean;
37
- details?: T;
38
- timestamp: number;
39
- }
40
- export interface BranchSummaryMessage {
41
- role: "branchSummary";
42
- summary: string;
43
- fromId: string;
44
- timestamp: number;
45
- }
46
- export interface CompactionSummaryMessage {
47
- role: "compactionSummary";
48
- summary: string;
49
- tokensBefore: number;
50
- timestamp: number;
51
- }
52
- declare module "indusagi/agent" {
53
- interface CustomAgentMessages {
54
- bashExecution: BashExecutionMessage;
55
- custom: CustomMessage;
56
- branchSummary: BranchSummaryMessage;
57
- compactionSummary: CompactionSummaryMessage;
58
- }
59
- }
60
- /**
61
- * Convert a BashExecutionMessage to user message text for LLM context.
62
- */
63
- export declare function bashExecutionToText(msg: BashExecutionMessage): string;
64
- export declare function createBranchSummaryMessage(summary: string, fromId: string, timestamp: string): BranchSummaryMessage;
65
- export declare function createCompactionSummaryMessage(summary: string, tokensBefore: number, timestamp: string): CompactionSummaryMessage;
66
- /** Convert CustomMessageEntry to AgentMessage format */
67
- export declare function createCustomMessage(customType: string, content: string | (TextContent | ImageContent)[], display: boolean, details: unknown | undefined, timestamp: string): CustomMessage;
68
- /**
69
- * Transform AgentMessages (including custom types) to LLM-compatible Messages.
70
- *
71
- * This is used by:
72
- * - Agent's transormToLlm option (for prompt calls and queued messages)
73
- * - Compaction's generateSummary (for summarization)
74
- * - Custom extensions and tools
75
- */
76
- export declare function convertToLlm(messages: AgentMessage[]): Message[];
1
+ export * from "indusagi/agent";
77
2
  //# sourceMapping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AW,wBAAwB;IACxC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CAClB;AAGD,OAAO,QAAQ,gBAAgB,CAAC;IAC/B,UAAU,mBAAmB;QAC5B,aAAa,EAAE,oBAAoB,CAAC;QACpC,MAAM,EAAE,aAAa,CAAC;QACtB,aAAa,EAAE,oBAAoB,CAAC;QACpC,iBAAiB,EAAE,wBAAwB,CAAC;KAC5C;CACD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,oBAAoB,GAAG,MAAM,CAgBrE;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,oBAAoB,CAOnH;AAED,wBAAgB,8BAA8B,CAC7C,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GACf,wBAAwB,CAO1B;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAClC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,EAChD,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,SAAS,EAAE,MAAM,GACf,aAAa,CASf;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CA+ChE"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -1,123 +1,2 @@
1
- /**
2
- * Custom message types and transformers for the coding agent.
3
- *
4
- * Extends the base AgentMessage type with coding-agent specific message types,
5
- * and provides a transformer to convert them to LLM-compatible messages.
6
- */
7
- export const COMPACTION_SUMMARY_PREFIX = `The conversation history before this point was compacted into the following summary:
8
-
9
- <summary>
10
- `;
11
- export const COMPACTION_SUMMARY_SUFFIX = `
12
- </summary>`;
13
- export const BRANCH_SUMMARY_PREFIX = `The following is a summary of a branch that this conversation came back from:
14
-
15
- <summary>
16
- `;
17
- export const BRANCH_SUMMARY_SUFFIX = `</summary>`;
18
- /**
19
- * Convert a BashExecutionMessage to user message text for LLM context.
20
- */
21
- export function bashExecutionToText(msg) {
22
- let text = `Ran \`${msg.command}\`\n`;
23
- if (msg.output) {
24
- text += `\`\`\`\n${msg.output}\n\`\`\``;
25
- }
26
- else {
27
- text += "(no output)";
28
- }
29
- if (msg.cancelled) {
30
- text += "\n\n(command cancelled)";
31
- }
32
- else if (msg.exitCode !== null && msg.exitCode !== undefined && msg.exitCode !== 0) {
33
- text += `\n\nCommand exited with code ${msg.exitCode}`;
34
- }
35
- if (msg.truncated && msg.fullOutputPath) {
36
- text += `\n\n[Output truncated. Full output: ${msg.fullOutputPath}]`;
37
- }
38
- return text;
39
- }
40
- export function createBranchSummaryMessage(summary, fromId, timestamp) {
41
- return {
42
- role: "branchSummary",
43
- summary,
44
- fromId,
45
- timestamp: new Date(timestamp).getTime(),
46
- };
47
- }
48
- export function createCompactionSummaryMessage(summary, tokensBefore, timestamp) {
49
- return {
50
- role: "compactionSummary",
51
- summary: summary,
52
- tokensBefore,
53
- timestamp: new Date(timestamp).getTime(),
54
- };
55
- }
56
- /** Convert CustomMessageEntry to AgentMessage format */
57
- export function createCustomMessage(customType, content, display, details, timestamp) {
58
- return {
59
- role: "custom",
60
- customType,
61
- content,
62
- display,
63
- details,
64
- timestamp: new Date(timestamp).getTime(),
65
- };
66
- }
67
- /**
68
- * Transform AgentMessages (including custom types) to LLM-compatible Messages.
69
- *
70
- * This is used by:
71
- * - Agent's transormToLlm option (for prompt calls and queued messages)
72
- * - Compaction's generateSummary (for summarization)
73
- * - Custom extensions and tools
74
- */
75
- export function convertToLlm(messages) {
76
- return messages
77
- .map((m) => {
78
- switch (m.role) {
79
- case "bashExecution":
80
- // Skip messages excluded from context (!! prefix)
81
- if (m.excludeFromContext) {
82
- return undefined;
83
- }
84
- return {
85
- role: "user",
86
- content: [{ type: "text", text: bashExecutionToText(m) }],
87
- timestamp: m.timestamp,
88
- };
89
- case "custom": {
90
- const content = typeof m.content === "string" ? [{ type: "text", text: m.content }] : m.content;
91
- return {
92
- role: "user",
93
- content,
94
- timestamp: m.timestamp,
95
- };
96
- }
97
- case "branchSummary":
98
- return {
99
- role: "user",
100
- content: [{ type: "text", text: BRANCH_SUMMARY_PREFIX + m.summary + BRANCH_SUMMARY_SUFFIX }],
101
- timestamp: m.timestamp,
102
- };
103
- case "compactionSummary":
104
- return {
105
- role: "user",
106
- content: [
107
- { type: "text", text: COMPACTION_SUMMARY_PREFIX + m.summary + COMPACTION_SUMMARY_SUFFIX },
108
- ],
109
- timestamp: m.timestamp,
110
- };
111
- case "user":
112
- case "assistant":
113
- case "toolResult":
114
- return m;
115
- default:
116
- // biome-ignore lint/correctness/noSwitchDeclarations: fine
117
- const _exhaustiveCheck = m;
118
- return undefined;
119
- }
120
- })
121
- .filter((m) => m !== undefined);
122
- }
1
+ export * from "indusagi/agent";
123
2
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/core/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;CAGxC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;WAC9B,CAAC;AAEZ,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;CAGpC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAuDlD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAyB;IAC5D,IAAI,IAAI,GAAG,SAAS,GAAG,CAAC,OAAO,MAAM,CAAC;IACtC,IAAI,GAAG,CAAC,MAAM,EAAE,CA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