@poncho-ai/cli 0.32.3 → 0.32.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +14 -0
- package/dist/{chunk-TQRPRFR3.js → chunk-LVWNWMNE.js} +729 -455
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +81 -3
- package/dist/index.js +3 -1
- package/dist/{run-interactive-ink-GD3IRICQ.js → run-interactive-ink-VGKSZJDO.js} +1 -1
- package/package.json +1 -1
- package/src/index.ts +768 -440
- package/src/web-ui-client.ts +70 -8
- package/test/run-orchestration.test.ts +171 -0
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IncomingMessage, ServerResponse, Server } from 'node:http';
|
|
2
|
-
import { AgentHarness, CronJobConfig, ConversationStore } from '@poncho-ai/harness';
|
|
3
|
-
import { AgentEvent } from '@poncho-ai/sdk';
|
|
2
|
+
import { AgentHarness, CronJobConfig, ConversationStore, Conversation } from '@poncho-ai/harness';
|
|
3
|
+
import { AgentEvent, Message } from '@poncho-ai/sdk';
|
|
4
4
|
import { MessagingAdapter } from '@poncho-ai/messaging';
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
|
|
@@ -14,6 +14,84 @@ type InitOnboardingOptions = {
|
|
|
14
14
|
* Priority: PONCHO_ENV > platform detection (Vercel, Railway, etc.) > NODE_ENV > "development"
|
|
15
15
|
*/
|
|
16
16
|
declare const resolveHarnessEnvironment: () => "development" | "staging" | "production";
|
|
17
|
+
type HistorySource = "harness" | "continuation" | "messages";
|
|
18
|
+
type StoredApproval = NonNullable<Conversation["pendingApprovals"]>[number];
|
|
19
|
+
type PendingToolCall = {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
input: Record<string, unknown>;
|
|
23
|
+
};
|
|
24
|
+
type ApprovalEventItem = {
|
|
25
|
+
approvalId: string;
|
|
26
|
+
tool: string;
|
|
27
|
+
toolCallId?: string;
|
|
28
|
+
input: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
type RunRequest = {
|
|
31
|
+
conversationId: string;
|
|
32
|
+
messages: Message[];
|
|
33
|
+
preferContinuation?: boolean;
|
|
34
|
+
};
|
|
35
|
+
type RunOutcome = {
|
|
36
|
+
source: HistorySource;
|
|
37
|
+
shouldRebuildCanonical: boolean;
|
|
38
|
+
messages: Message[];
|
|
39
|
+
};
|
|
40
|
+
type TurnSection = {
|
|
41
|
+
type: "text" | "tools";
|
|
42
|
+
content: string | string[];
|
|
43
|
+
};
|
|
44
|
+
type TurnDraftState = {
|
|
45
|
+
assistantResponse: string;
|
|
46
|
+
toolTimeline: string[];
|
|
47
|
+
sections: TurnSection[];
|
|
48
|
+
currentTools: string[];
|
|
49
|
+
currentText: string;
|
|
50
|
+
};
|
|
51
|
+
type ExecuteTurnResult = {
|
|
52
|
+
latestRunId: string;
|
|
53
|
+
runCancelled: boolean;
|
|
54
|
+
runContinuation: boolean;
|
|
55
|
+
runContinuationMessages?: Message[];
|
|
56
|
+
runHarnessMessages?: Message[];
|
|
57
|
+
runContextTokens: number;
|
|
58
|
+
runContextWindow: number;
|
|
59
|
+
runSteps: number;
|
|
60
|
+
runMaxSteps?: number;
|
|
61
|
+
draft: TurnDraftState;
|
|
62
|
+
};
|
|
63
|
+
declare const __internalRunOrchestration: {
|
|
64
|
+
isMessageArray: (value: unknown) => value is Message[];
|
|
65
|
+
loadCanonicalHistory: (conversation: Conversation) => {
|
|
66
|
+
messages: Message[];
|
|
67
|
+
source: HistorySource;
|
|
68
|
+
};
|
|
69
|
+
loadRunHistory: (conversation: Conversation, options?: {
|
|
70
|
+
preferContinuation?: boolean;
|
|
71
|
+
}) => {
|
|
72
|
+
messages: Message[];
|
|
73
|
+
source: HistorySource;
|
|
74
|
+
shouldRebuildCanonical: boolean;
|
|
75
|
+
};
|
|
76
|
+
normalizeApprovalCheckpoint: (approval: StoredApproval, fallbackMessages: Message[]) => StoredApproval;
|
|
77
|
+
buildApprovalCheckpoints: ({ approvals, runId, checkpointMessages, baseMessageCount, pendingToolCalls, }: {
|
|
78
|
+
approvals: ApprovalEventItem[];
|
|
79
|
+
runId: string;
|
|
80
|
+
checkpointMessages: Message[];
|
|
81
|
+
baseMessageCount: number;
|
|
82
|
+
pendingToolCalls: PendingToolCall[];
|
|
83
|
+
}) => NonNullable<Conversation["pendingApprovals"]>;
|
|
84
|
+
resolveRunRequest: (conversation: Conversation, request: RunRequest) => RunOutcome;
|
|
85
|
+
createTurnDraftState: () => TurnDraftState;
|
|
86
|
+
recordStandardTurnEvent: (draft: TurnDraftState, event: AgentEvent) => void;
|
|
87
|
+
executeConversationTurn: ({ harness, runInput, initialContextTokens, initialContextWindow, onEvent, }: {
|
|
88
|
+
harness: AgentHarness;
|
|
89
|
+
runInput: Parameters<AgentHarness["runWithTelemetry"]>[0];
|
|
90
|
+
initialContextTokens?: number;
|
|
91
|
+
initialContextWindow?: number;
|
|
92
|
+
onEvent?: (event: AgentEvent, draft: TurnDraftState) => void | Promise<void>;
|
|
93
|
+
}) => Promise<ExecuteTurnResult>;
|
|
94
|
+
};
|
|
17
95
|
declare const initProject: (projectName: string, options?: {
|
|
18
96
|
workingDir?: string;
|
|
19
97
|
onboarding?: InitOnboardingOptions;
|
|
@@ -91,4 +169,4 @@ declare const buildCli: () => Command;
|
|
|
91
169
|
declare const main: (argv?: string[]) => Promise<void>;
|
|
92
170
|
declare const packageRoot: string;
|
|
93
171
|
|
|
94
|
-
export { type RequestHandler, addSkill, buildCli, buildTarget, copySkillsFromPackage, createRequestHandler, initProject, listInstalledSkills, listSkills, listTools, main, mcpAdd, mcpList, mcpRemove, mcpToolsList, mcpToolsSelect, packageRoot, removeSkillPackage, removeSkillsFromPackage, resolveHarnessEnvironment, runInteractive, runOnce, runTests, startDevServer, updateAgentGuidance };
|
|
172
|
+
export { type RequestHandler, __internalRunOrchestration, addSkill, buildCli, buildTarget, copySkillsFromPackage, createRequestHandler, initProject, listInstalledSkills, listSkills, listTools, main, mcpAdd, mcpList, mcpRemove, mcpToolsList, mcpToolsSelect, packageRoot, removeSkillPackage, removeSkillsFromPackage, resolveHarnessEnvironment, runInteractive, runOnce, runTests, startDevServer, updateAgentGuidance };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
__internalRunOrchestration,
|
|
2
3
|
addSkill,
|
|
3
4
|
buildCli,
|
|
4
5
|
buildTarget,
|
|
@@ -23,8 +24,9 @@ import {
|
|
|
23
24
|
runTests,
|
|
24
25
|
startDevServer,
|
|
25
26
|
updateAgentGuidance
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LVWNWMNE.js";
|
|
27
28
|
export {
|
|
29
|
+
__internalRunOrchestration,
|
|
28
30
|
addSkill,
|
|
29
31
|
buildCli,
|
|
30
32
|
buildTarget,
|