@eldrforge/ai-service 0.1.13 ā 0.1.15
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 +1112 -226
- package/dist/index.js +1325 -108
- package/dist/index.js.map +1 -1
- package/dist/src/agentic/commit.d.ts +6 -0
- package/dist/src/agentic/commit.d.ts.map +1 -1
- package/dist/src/agentic/executor.d.ts +7 -1
- package/dist/src/agentic/executor.d.ts.map +1 -1
- package/dist/src/agentic/publish.d.ts +31 -0
- package/dist/src/agentic/publish.d.ts.map +1 -0
- package/dist/src/agentic/release.d.ts +6 -0
- package/dist/src/agentic/release.d.ts.map +1 -1
- package/dist/src/ai.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/observability/conversation-logger.d.ts +53 -0
- package/dist/src/observability/conversation-logger.d.ts.map +1 -0
- package/dist/src/observability/index.d.ts +15 -0
- package/dist/src/observability/index.d.ts.map +1 -0
- package/dist/src/observability/metrics.d.ts +53 -0
- package/dist/src/observability/metrics.d.ts.map +1 -0
- package/dist/src/observability/reflection.d.ts +36 -0
- package/dist/src/observability/reflection.d.ts.map +1 -0
- package/dist/src/prompts/commit.d.ts.map +1 -1
- package/dist/src/prompts/index.d.ts +1 -0
- package/dist/src/prompts/index.d.ts.map +1 -1
- package/dist/src/prompts/release.d.ts.map +1 -1
- package/dist/src/prompts/review.d.ts.map +1 -1
- package/dist/src/prompts/templates.d.ts +22 -0
- package/dist/src/prompts/templates.d.ts.map +1 -0
- package/dist/src/tools/publish-tools.d.ts +6 -0
- package/dist/src/tools/publish-tools.d.ts.map +1 -0
- package/dist/src/tools/types.d.ts +17 -0
- package/dist/src/tools/types.d.ts.map +1 -1
- package/examples/01-simple-commit.ts +80 -0
- package/examples/02-release-notes.ts +124 -0
- package/examples/03-interactive-commit.ts +150 -0
- package/examples/04-custom-storage.ts +162 -0
- package/examples/05-custom-tools.ts +243 -0
- package/examples/README.md +320 -0
- package/package.json +6 -5
|
@@ -14,6 +14,12 @@ export interface AgenticCommitConfig {
|
|
|
14
14
|
storage?: StorageAdapter;
|
|
15
15
|
logger?: Logger;
|
|
16
16
|
openaiReasoning?: 'low' | 'medium' | 'high';
|
|
17
|
+
tokenBudget?: {
|
|
18
|
+
max: number;
|
|
19
|
+
reserveForResponse?: number;
|
|
20
|
+
strategy?: 'priority-based' | 'fifo' | 'summarize' | 'adaptive';
|
|
21
|
+
onBudgetExceeded?: 'compress' | 'error' | 'warn' | 'truncate';
|
|
22
|
+
};
|
|
17
23
|
}
|
|
18
24
|
export interface AgenticCommitResult {
|
|
19
25
|
commitMessage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/agentic/commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAkC,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/agentic/commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAkC,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,mBAAmB;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC5C,WAAW,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,EAAE,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;QAChE,gBAAgB,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;KACjE,CAAC;CACL;AAED,MAAM,WAAW,mBAAmB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,KAAK,CAAC;QACnB,KAAK,EAAE,MAAM,EAAE,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;IACH,mBAAmB,EAAE,0BAA0B,EAAE,CAAC;IAClD,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAiFhG"}
|
|
@@ -11,6 +11,12 @@ export interface AgenticConfig {
|
|
|
11
11
|
storage?: any;
|
|
12
12
|
logger?: any;
|
|
13
13
|
openaiReasoning?: 'low' | 'medium' | 'high';
|
|
14
|
+
tokenBudget?: {
|
|
15
|
+
max: number;
|
|
16
|
+
reserveForResponse?: number;
|
|
17
|
+
strategy?: 'priority-based' | 'fifo' | 'summarize' | 'adaptive';
|
|
18
|
+
onBudgetExceeded?: 'compress' | 'error' | 'warn' | 'truncate';
|
|
19
|
+
};
|
|
14
20
|
}
|
|
15
21
|
export interface ToolExecutionMetric {
|
|
16
22
|
name: string;
|
|
@@ -35,7 +41,7 @@ export declare class AgenticExecutor {
|
|
|
35
41
|
private toolMetrics;
|
|
36
42
|
constructor(logger?: any);
|
|
37
43
|
/**
|
|
38
|
-
* Run the agentic loop
|
|
44
|
+
* Run the agentic loop with ConversationBuilder
|
|
39
45
|
*/
|
|
40
46
|
run(config: AgenticConfig): Promise<AgenticResult>;
|
|
41
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/agentic/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/agentic/executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,0BAA0B,EAAE,CAAC;IACvC,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,eAAe,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IAE5C,WAAW,CAAC,EAAE;QACV,GAAG,EAAE,MAAM,CAAC;QACZ,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,EAAE,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;QAChE,gBAAgB,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;KACjE,CAAC;CACL;AAED,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,0BAA0B,EAAE,CAAC;IAClD,WAAW,EAAE,mBAAmB,EAAE,CAAC;CACtC;AAED;;GAEG;AACH,qBAAa,eAAe;IACxB,OAAO,CAAC,MAAM,CAAC,CAAM;IACrB,OAAO,CAAC,WAAW,CAA6B;gBAEpC,MAAM,CAAC,EAAE,GAAG;IAIxB;;OAEG;IACG,GAAG,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAkMxD;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAOxB;;OAEG;IACH,OAAO,CAAC,GAAG;CASd;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAG9E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface AgenticPublishConfig {
|
|
2
|
+
targetBranch: string;
|
|
3
|
+
sourceBranch: string;
|
|
4
|
+
issue: 'branch_sync' | 'uncommitted_changes' | 'merge_conflicts' | 'unknown';
|
|
5
|
+
issueDetails?: string;
|
|
6
|
+
workingDirectory?: string;
|
|
7
|
+
model?: string;
|
|
8
|
+
maxIterations?: number;
|
|
9
|
+
debug?: boolean;
|
|
10
|
+
storage?: any;
|
|
11
|
+
logger?: any;
|
|
12
|
+
dryRun?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface AgenticPublishResult {
|
|
15
|
+
success: boolean;
|
|
16
|
+
message: string;
|
|
17
|
+
actionsTaken: string[];
|
|
18
|
+
iterations: number;
|
|
19
|
+
toolCallsExecuted: number;
|
|
20
|
+
requiresManualIntervention: boolean;
|
|
21
|
+
manualSteps?: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Run agentic publish recovery
|
|
25
|
+
*/
|
|
26
|
+
export declare function runAgenticPublish(config: AgenticPublishConfig): Promise<AgenticPublishResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Create a friendly summary of the agentic publish result
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatAgenticPublishResult(result: AgenticPublishResult): string;
|
|
31
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/agentic/publish.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,aAAa,GAAG,qBAAqB,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B,EAAE,OAAO,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAyEnG;AAuJD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAuD/E"}
|
|
@@ -17,6 +17,12 @@ export interface AgenticReleaseConfig {
|
|
|
17
17
|
storage?: StorageAdapter;
|
|
18
18
|
logger?: Logger;
|
|
19
19
|
openaiReasoning?: 'low' | 'medium' | 'high';
|
|
20
|
+
tokenBudget?: {
|
|
21
|
+
max: number;
|
|
22
|
+
reserveForResponse?: number;
|
|
23
|
+
strategy?: 'priority-based' | 'fifo' | 'summarize' | 'adaptive';
|
|
24
|
+
onBudgetExceeded?: 'compress' | 'error' | 'warn' | 'truncate';
|
|
25
|
+
};
|
|
20
26
|
}
|
|
21
27
|
export interface AgenticReleaseResult {
|
|
22
28
|
releaseNotes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/agentic/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAkC,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/agentic/release.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAkC,KAAK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;gBAA3D,OAAO,EAAE,MAAM,EAAkB,iBAAiB,GAAE,OAAe;CAIlF;AAGD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CASrD;AAGD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAkBpD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAClC,QAAQ,EAAE,0BAA0B,EAAE,EACtC,OAAO,GAAE,aAAwC,GAClD,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAkLvB;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC3C,QAAQ,EAAE,0BAA0B,EAAE,EACtC,OAAO,GAAE,aAAwC,EACjD,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,0BAA0B,EAAE,CAAC,GAC3E,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CA4BvB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACjC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,oBAA6C,GACvD,OAAO,CAAC,aAAa,CAAC,CA4GxB"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -13,8 +13,11 @@ export * from './prompts';
|
|
|
13
13
|
export * from './agentic/executor';
|
|
14
14
|
export * from './agentic/commit';
|
|
15
15
|
export * from './agentic/release';
|
|
16
|
+
export * from './agentic/publish';
|
|
16
17
|
export * from './tools/types';
|
|
17
18
|
export * from './tools/registry';
|
|
18
19
|
export * from './tools/commit-tools';
|
|
19
20
|
export * from './tools/release-tools';
|
|
21
|
+
export * from './tools/publish-tools';
|
|
22
|
+
export * from './observability';
|
|
20
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAG1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAG1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ConversationLogger } from '@riotprompt/riotprompt';
|
|
2
|
+
import { Logger, StorageAdapter } from '../types';
|
|
3
|
+
export interface ConversationLoggerConfig {
|
|
4
|
+
outputDir: string;
|
|
5
|
+
format?: 'json' | 'markdown';
|
|
6
|
+
includeMetadata?: boolean;
|
|
7
|
+
storage?: StorageAdapter;
|
|
8
|
+
logger?: Logger;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Create a conversation logger instance
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const logger = createConversationLogger({
|
|
16
|
+
* outputDir: 'output/conversations',
|
|
17
|
+
* storage,
|
|
18
|
+
* logger
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // Log conversation
|
|
22
|
+
* await logger.save(conversationId, messages, metadata);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function createConversationLogger(config: ConversationLoggerConfig): {
|
|
26
|
+
/**
|
|
27
|
+
* Save a conversation to disk
|
|
28
|
+
*/
|
|
29
|
+
save(conversationId: string, messages: any[], metadata?: Record<string, any>): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Load a conversation from disk
|
|
32
|
+
*/
|
|
33
|
+
load(conversationId: string): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* Get conversation summary
|
|
36
|
+
*/
|
|
37
|
+
getSummary(conversationId: string): Promise<{
|
|
38
|
+
id: any;
|
|
39
|
+
timestamp: any;
|
|
40
|
+
messageCount: any;
|
|
41
|
+
metadata: any;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Create riotprompt ConversationLogger instance for advanced usage
|
|
45
|
+
*/
|
|
46
|
+
createRiotLogger(): ConversationLogger;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Helper to generate conversation ID
|
|
50
|
+
*/
|
|
51
|
+
export declare function generateConversationId(command: string): string;
|
|
52
|
+
export type ConversationLoggerInstance = ReturnType<typeof createConversationLogger>;
|
|
53
|
+
//# sourceMappingURL=conversation-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-logger.d.ts","sourceRoot":"","sources":["../../../src/observability/conversation-logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAkB,MAAM,wBAAwB,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAGvD,MAAM,WAAW,wBAAwB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,wBAAwB;IASjE;;OAEG;yBAEiB,MAAM,YACZ,GAAG,EAAE,aACJ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC;IAmClB;;OAEG;yBACwB,MAAM;IAiCjC;;OAEG;+BAC8B,MAAM;;;;;;IAkBvC;;OAEG;wBACiB,kBAAkB;EAW7C;AAmCD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observability module for agentic workflows
|
|
3
|
+
*
|
|
4
|
+
* Provides wrappers around riotprompt's observability features:
|
|
5
|
+
* - ConversationLogger: Log and replay conversations
|
|
6
|
+
* - MetricsCollector: Track tool usage and performance
|
|
7
|
+
* - ReflectionReportGenerator: Generate self-reflection reports
|
|
8
|
+
*/
|
|
9
|
+
export * from './conversation-logger';
|
|
10
|
+
export * from './reflection';
|
|
11
|
+
export { createMetricsCollector, type MetricsCollectorInstance, type MetricsConfig } from './metrics';
|
|
12
|
+
export type { ToolExecutionMetric as ObservabilityToolMetric } from './metrics';
|
|
13
|
+
export type { ConversationLoggerInstance, ConversationLoggerConfig } from './conversation-logger';
|
|
14
|
+
export type { ReflectionOptions } from './reflection';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/observability/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,sBAAsB,EAAE,KAAK,wBAAwB,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AACtG,YAAY,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAGhF,YAAY,EACR,0BAA0B,EAC1B,wBAAwB,EAC3B,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACR,iBAAiB,EACpB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AgenticExecutionMetrics } from '@riotprompt/riotprompt';
|
|
2
|
+
import { Logger } from '../types';
|
|
3
|
+
export interface ToolExecutionMetric {
|
|
4
|
+
name: string;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
duration: number;
|
|
7
|
+
success: boolean;
|
|
8
|
+
iteration: number;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface MetricsConfig {
|
|
12
|
+
logger?: Logger;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create a metrics collector for agentic workflows
|
|
16
|
+
*
|
|
17
|
+
* This wraps riotprompt's MetricsCollector and provides compatibility
|
|
18
|
+
* with existing tool metrics format.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createMetricsCollector(config?: MetricsConfig): {
|
|
21
|
+
/**
|
|
22
|
+
* Record a tool execution
|
|
23
|
+
*/
|
|
24
|
+
recordToolExecution(metric: ToolExecutionMetric): void;
|
|
25
|
+
/**
|
|
26
|
+
* Record an iteration
|
|
27
|
+
*/
|
|
28
|
+
recordIteration(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get tool metrics in legacy format (for backward compatibility)
|
|
31
|
+
*/
|
|
32
|
+
getToolMetrics(): ToolExecutionMetric[];
|
|
33
|
+
/**
|
|
34
|
+
* Generate execution metrics report
|
|
35
|
+
*/
|
|
36
|
+
generateReport(): AgenticExecutionMetrics;
|
|
37
|
+
/**
|
|
38
|
+
* Get summary statistics
|
|
39
|
+
*/
|
|
40
|
+
getSummary(): {
|
|
41
|
+
totalIterations: number;
|
|
42
|
+
totalToolCalls: number;
|
|
43
|
+
totalDuration: number;
|
|
44
|
+
toolMetrics: import('@riotprompt/riotprompt').ToolExecutionMetric[];
|
|
45
|
+
toolStats: Map<string, import('@riotprompt/riotprompt').ToolStats>;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Reset all metrics
|
|
49
|
+
*/
|
|
50
|
+
reset(): void;
|
|
51
|
+
};
|
|
52
|
+
export type MetricsCollectorInstance = ReturnType<typeof createMetricsCollector>;
|
|
53
|
+
//# sourceMappingURL=metrics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/observability/metrics.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,GAAE,aAAkB;IAMzD;;OAEG;gCACyB,mBAAmB;IAkB/C;;OAEG;;IASH;;OAEG;sBACe,mBAAmB,EAAE;IAIvC;;OAEG;sBACe,uBAAuB;IAIzC;;OAEG;;;;;;;;IAYH;;OAEG;;EAMV;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Logger, StorageAdapter } from '../types';
|
|
2
|
+
import { ToolExecutionMetric } from '../agentic/executor';
|
|
3
|
+
export interface ReflectionOptions {
|
|
4
|
+
iterations: number;
|
|
5
|
+
toolCallsExecuted: number;
|
|
6
|
+
maxIterations: number;
|
|
7
|
+
toolMetrics: ToolExecutionMetric[];
|
|
8
|
+
conversationHistory?: any[];
|
|
9
|
+
commitMessage?: string;
|
|
10
|
+
suggestedSplits?: any[];
|
|
11
|
+
releaseNotes?: any;
|
|
12
|
+
logger?: Logger;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Generate a comprehensive self-reflection report
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const report = await generateReflectionReport({
|
|
20
|
+
* iterations: result.iterations,
|
|
21
|
+
* toolCallsExecuted: result.toolCallsExecuted,
|
|
22
|
+
* maxIterations: 10,
|
|
23
|
+
* toolMetrics: result.toolMetrics,
|
|
24
|
+
* commitMessage: result.commitMessage,
|
|
25
|
+
* logger
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* await saveReflectionReport(report, 'output/reflection.md', storage);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function generateReflectionReport(options: ReflectionOptions): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Save reflection report to file
|
|
34
|
+
*/
|
|
35
|
+
export declare function saveReflectionReport(report: string, outputPath: string, storage?: StorageAdapter): Promise<void>;
|
|
36
|
+
//# sourceMappingURL=reflection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflection.d.ts","sourceRoot":"","sources":["../../../src/observability/reflection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACnC,mBAAmB,CAAC,EAAE,GAAG,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CA0L1F;AAmED;;GAEG;AACH,wBAAsB,oBAAoB,CACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CAAC,IAAI,CAAC,CAQf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/prompts/commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../../src/prompts/commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,wBAAwB,CAAC;AASxE,MAAM,MAAM,aAAa,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAC3B,0DAA0D,YAAY,EACtE,oEAAoE,aAAa,EACjF,uCAAsC,aAAkB,KACzD,OAAO,CAAC,MAAM,CA2ChB,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export * from './commit';
|
|
5
5
|
export * from './release';
|
|
6
6
|
export * from './review';
|
|
7
|
+
export * from './templates';
|
|
7
8
|
export type { CommitContent, CommitContext, CommitConfig, } from './commit';
|
|
8
9
|
export type { ReleaseContent, ReleaseContext, ReleaseConfig, ReleasePromptResult, } from './release';
|
|
9
10
|
export type { ReviewContent, ReviewContext, ReviewConfig, } from './review';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAG5B,YAAY,EACR,aAAa,EACb,aAAa,EACb,YAAY,GACf,MAAM,UAAU,CAAC;AAElB,YAAY,EACR,cAAc,EACd,cAAc,EACd,aAAa,EACb,mBAAmB,GACtB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACR,aAAa,EACb,aAAa,EACb,YAAY,GACf,MAAM,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/prompts/release.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/prompts/release.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,wBAAwB,CAAC;AASxE,MAAM,MAAM,aAAa,GAAG;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CAC3B,CAAC;AA4BF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC5B,0DAA0D,aAAa,EACvE,4DAA4D,cAAc,EAC1E,2BAA0B,cAAmB,KAC9C,OAAO,CAAC,mBAAmB,CAqD7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/prompts/review.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../src/prompts/review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,wBAAwB,CAAC;AAQxE,MAAM,MAAM,YAAY,GAAG;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC3B,0DAA0D,YAAY,EACtE,WAAW,aAAa,EACxB,wFAAuF,aAAkB,KAC1G,OAAO,CAAC,MAAM,CAuChB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RiotPrompt Template Registry
|
|
3
|
+
*
|
|
4
|
+
* This module registers reusable prompt templates that can be used
|
|
5
|
+
* across different prompt builders. Templates define common patterns
|
|
6
|
+
* for personas, instructions, and structure.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Initialize and register all prompt templates.
|
|
10
|
+
* This should be called once during application initialization.
|
|
11
|
+
*/
|
|
12
|
+
export declare const initializeTemplates: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Template names for type-safe template references
|
|
15
|
+
*/
|
|
16
|
+
export declare const TemplateNames: {
|
|
17
|
+
readonly COMMIT: "commit";
|
|
18
|
+
readonly RELEASE: "release";
|
|
19
|
+
readonly REVIEW: "review";
|
|
20
|
+
};
|
|
21
|
+
export type TemplateName = typeof TemplateNames[keyof typeof TemplateNames];
|
|
22
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/prompts/templates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,IAsBtC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-tools.d.ts","sourceRoot":"","sources":["../../../src/tools/publish-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,SAAS,CAAC;AAGjD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,EAAE,CAY3C"}
|
|
@@ -19,6 +19,20 @@ export interface ToolDefinition {
|
|
|
19
19
|
required?: string[];
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Tool example showing when and how to use the tool
|
|
24
|
+
* Matches riotprompt's ToolExample interface
|
|
25
|
+
*/
|
|
26
|
+
export interface ToolExample {
|
|
27
|
+
scenario: string;
|
|
28
|
+
params: any;
|
|
29
|
+
expectedResult: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Tool cost indicator for guidance
|
|
33
|
+
* Using riotprompt's cost levels
|
|
34
|
+
*/
|
|
35
|
+
export type ToolCost = 'cheap' | 'moderate' | 'expensive';
|
|
22
36
|
export interface Tool {
|
|
23
37
|
name: string;
|
|
24
38
|
description: string;
|
|
@@ -28,6 +42,9 @@ export interface Tool {
|
|
|
28
42
|
required?: string[];
|
|
29
43
|
};
|
|
30
44
|
execute: (params: any, context?: ToolContext) => Promise<any>;
|
|
45
|
+
category?: string;
|
|
46
|
+
cost?: ToolCost;
|
|
47
|
+
examples?: ToolExample[];
|
|
31
48
|
}
|
|
32
49
|
export interface ToolContext {
|
|
33
50
|
workingDirectory?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tools/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH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GAAG,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,GAAG,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAGD,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE;YACR,IAAI,EAAE,QAAQ,CAAC;YACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;SACvB,CAAC;KACL,CAAC;CACL"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Example 1: Simple Commit Message Generation
|
|
4
|
+
*
|
|
5
|
+
* This example shows the most basic usage of the library to generate
|
|
6
|
+
* a commit message from staged git changes.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* 1. Stage some changes: git add .
|
|
10
|
+
* 2. Run: npx tsx examples/01-simple-commit.ts
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* eslint-disable no-console */
|
|
14
|
+
|
|
15
|
+
import { runAgenticCommit } from '@eldrforge/ai-service';
|
|
16
|
+
import { execSync } from 'child_process';
|
|
17
|
+
|
|
18
|
+
async function main() {
|
|
19
|
+
try {
|
|
20
|
+
console.log('š Checking for staged changes...\n');
|
|
21
|
+
|
|
22
|
+
// Get the diff of staged changes
|
|
23
|
+
const diffContent = execSync('git diff --staged', { encoding: 'utf8' });
|
|
24
|
+
|
|
25
|
+
if (!diffContent.trim()) {
|
|
26
|
+
console.log('ā No staged changes found.');
|
|
27
|
+
console.log(' Stage some changes first with: git add <files>');
|
|
28
|
+
process.exit(1);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Get list of changed files
|
|
32
|
+
const statusOutput = execSync('git status --porcelain', { encoding: 'utf8' });
|
|
33
|
+
const changedFiles = statusOutput
|
|
34
|
+
.split('\n')
|
|
35
|
+
.filter(line => line.trim())
|
|
36
|
+
.map(line => line.substring(3));
|
|
37
|
+
|
|
38
|
+
console.log('š Files changed:', changedFiles.length);
|
|
39
|
+
changedFiles.forEach(file => console.log(` - ${file}`));
|
|
40
|
+
console.log('');
|
|
41
|
+
|
|
42
|
+
console.log('š¤ Generating commit message...\n');
|
|
43
|
+
|
|
44
|
+
// Generate commit message using agentic mode
|
|
45
|
+
const result = await runAgenticCommit({
|
|
46
|
+
changedFiles,
|
|
47
|
+
diffContent,
|
|
48
|
+
model: 'gpt-4o-mini', // Using mini for faster/cheaper generation
|
|
49
|
+
maxIterations: 10,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
console.log('⨠Generated Commit Message:\n');
|
|
53
|
+
console.log('ā'.repeat(60));
|
|
54
|
+
console.log(result.commitMessage);
|
|
55
|
+
console.log('ā'.repeat(60));
|
|
56
|
+
console.log('');
|
|
57
|
+
console.log(`š Stats: ${result.toolCallsExecuted} tool calls, ${result.iterations} iterations`);
|
|
58
|
+
|
|
59
|
+
// Show suggested splits if any
|
|
60
|
+
if (result.suggestedSplits.length > 0) {
|
|
61
|
+
console.log('\nš” Suggested Commit Splits:');
|
|
62
|
+
console.log(' The AI recommends splitting this into multiple commits:\n');
|
|
63
|
+
|
|
64
|
+
result.suggestedSplits.forEach((split, idx) => {
|
|
65
|
+
console.log(` Split ${idx + 1}:`);
|
|
66
|
+
console.log(` Files: ${split.files.join(', ')}`);
|
|
67
|
+
console.log(` Rationale: ${split.rationale}`);
|
|
68
|
+
console.log(` Message: ${split.message}`);
|
|
69
|
+
console.log('');
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error('ā Error:', error instanceof Error ? error.message : String(error));
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
main();
|
|
80
|
+
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Example 2: Generate Release Notes
|
|
4
|
+
*
|
|
5
|
+
* This example generates comprehensive release notes between two git refs.
|
|
6
|
+
* The AI will use multiple tools to analyze the changes and create
|
|
7
|
+
* detailed, context-aware release notes.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* npx tsx examples/02-release-notes.ts v1.0.0 v1.1.0
|
|
11
|
+
* npx tsx examples/02-release-notes.ts v1.0.0 HEAD
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/* eslint-disable no-console */
|
|
15
|
+
|
|
16
|
+
import { runAgenticRelease } from '@eldrforge/ai-service';
|
|
17
|
+
import { execSync } from 'child_process';
|
|
18
|
+
import * as fs from 'fs/promises';
|
|
19
|
+
import * as path from 'path';
|
|
20
|
+
|
|
21
|
+
async function main() {
|
|
22
|
+
const args = process.argv.slice(2);
|
|
23
|
+
|
|
24
|
+
if (args.length < 2) {
|
|
25
|
+
console.log('Usage: npx tsx 02-release-notes.ts <from-ref> <to-ref>');
|
|
26
|
+
console.log('Example: npx tsx 02-release-notes.ts v1.0.0 v1.1.0');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const [fromRef, toRef] = args;
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
console.log(`š Generating release notes from ${fromRef} to ${toRef}...\n`);
|
|
34
|
+
|
|
35
|
+
// Verify refs exist
|
|
36
|
+
try {
|
|
37
|
+
execSync(`git rev-parse ${fromRef}`, { stdio: 'ignore' });
|
|
38
|
+
execSync(`git rev-parse ${toRef}`, { stdio: 'ignore' });
|
|
39
|
+
} catch {
|
|
40
|
+
console.error(`ā Invalid git reference: ${fromRef} or ${toRef}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Get commit log
|
|
45
|
+
console.log('š Fetching commit history...');
|
|
46
|
+
const logContent = execSync(
|
|
47
|
+
`git log ${fromRef}..${toRef} --pretty=format:"%h %s (%an)" --abbrev-commit`,
|
|
48
|
+
{ encoding: 'utf8' }
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Get diff stats
|
|
52
|
+
console.log('š Analyzing changes...');
|
|
53
|
+
const diffContent = execSync(
|
|
54
|
+
`git diff ${fromRef}..${toRef} --stat`,
|
|
55
|
+
{ encoding: 'utf8' }
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// Count commits
|
|
59
|
+
const commitCount = logContent.split('\n').filter(line => line.trim()).length;
|
|
60
|
+
console.log(` Found ${commitCount} commits\n`);
|
|
61
|
+
|
|
62
|
+
// Run agentic release notes generation
|
|
63
|
+
console.log('š¤ AI is analyzing the release...');
|
|
64
|
+
console.log(' (This may take 1-3 minutes for thorough analysis)\n');
|
|
65
|
+
|
|
66
|
+
const result = await runAgenticRelease({
|
|
67
|
+
fromRef,
|
|
68
|
+
toRef,
|
|
69
|
+
logContent,
|
|
70
|
+
diffContent,
|
|
71
|
+
model: 'gpt-4o',
|
|
72
|
+
maxIterations: 30,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
console.log('ā
Release notes generated!\n');
|
|
76
|
+
console.log('ā'.repeat(70));
|
|
77
|
+
console.log(`TITLE: ${result.releaseNotes.title}`);
|
|
78
|
+
console.log('ā'.repeat(70));
|
|
79
|
+
console.log('');
|
|
80
|
+
console.log(result.releaseNotes.body);
|
|
81
|
+
console.log('');
|
|
82
|
+
console.log('ā'.repeat(70));
|
|
83
|
+
console.log('');
|
|
84
|
+
console.log(`š Metrics:`);
|
|
85
|
+
console.log(` - Iterations: ${result.iterations}`);
|
|
86
|
+
console.log(` - Tool calls: ${result.toolCallsExecuted}`);
|
|
87
|
+
console.log('');
|
|
88
|
+
|
|
89
|
+
// Show which tools were used
|
|
90
|
+
const toolUsage: Record<string, number> = {};
|
|
91
|
+
result.toolMetrics.forEach(metric => {
|
|
92
|
+
toolUsage[metric.name] = (toolUsage[metric.name] || 0) + 1;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
console.log('š§ Tools used:');
|
|
96
|
+
Object.entries(toolUsage)
|
|
97
|
+
.sort((a, b) => b[1] - a[1])
|
|
98
|
+
.forEach(([tool, count]) => {
|
|
99
|
+
console.log(` - ${tool}: ${count}x`);
|
|
100
|
+
});
|
|
101
|
+
console.log('');
|
|
102
|
+
|
|
103
|
+
// Save to file
|
|
104
|
+
const outputDir = path.join(process.cwd(), 'output');
|
|
105
|
+
await fs.mkdir(outputDir, { recursive: true });
|
|
106
|
+
|
|
107
|
+
const releaseFile = path.join(outputDir, 'RELEASE_NOTES.md');
|
|
108
|
+
await fs.writeFile(releaseFile, result.releaseNotes.body, 'utf8');
|
|
109
|
+
|
|
110
|
+
const titleFile = path.join(outputDir, 'RELEASE_TITLE.txt');
|
|
111
|
+
await fs.writeFile(titleFile, result.releaseNotes.title, 'utf8');
|
|
112
|
+
|
|
113
|
+
console.log('š¾ Saved to:');
|
|
114
|
+
console.log(` - ${releaseFile}`);
|
|
115
|
+
console.log(` - ${titleFile}`);
|
|
116
|
+
|
|
117
|
+
} catch (error) {
|
|
118
|
+
console.error('ā Error:', error instanceof Error ? error.message : String(error));
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
main();
|
|
124
|
+
|