@poncho-ai/sdk 1.8.0 → 1.8.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/.turbo/turbo-build.log +11 -11
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +25 -1
- package/package.json +1 -1
- package/src/index.ts +21 -1
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-test.log +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/sdk@1.
|
|
2
|
+
> @poncho-ai/sdk@1.8.1 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.1
|
|
8
|
+
[34mCLI[39m Target: es2022
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m12.46 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 16ms
|
|
12
|
+
[34mDTS[39m Build start
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 1193ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m24.92 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -570,6 +570,27 @@ interface Message {
|
|
|
570
570
|
}
|
|
571
571
|
/** Extract the text content from a message, regardless of content format. */
|
|
572
572
|
declare const getTextContent: (message: Message) => string;
|
|
573
|
+
/** Virtual filesystem scoped to the current tenant. Available when VFS is enabled. */
|
|
574
|
+
interface VfsAccess {
|
|
575
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
576
|
+
readText(path: string): Promise<string>;
|
|
577
|
+
writeFile(path: string, content: Uint8Array, mimeType?: string): Promise<void>;
|
|
578
|
+
writeText(path: string, content: string): Promise<void>;
|
|
579
|
+
exists(path: string): Promise<boolean>;
|
|
580
|
+
stat(path: string): Promise<{
|
|
581
|
+
size: number;
|
|
582
|
+
isDirectory: boolean;
|
|
583
|
+
mimeType?: string;
|
|
584
|
+
updatedAt: number;
|
|
585
|
+
}>;
|
|
586
|
+
readdir(path: string): Promise<string[]>;
|
|
587
|
+
mkdir(path: string, options?: {
|
|
588
|
+
recursive?: boolean;
|
|
589
|
+
}): Promise<void>;
|
|
590
|
+
rm(path: string, options?: {
|
|
591
|
+
recursive?: boolean;
|
|
592
|
+
}): Promise<void>;
|
|
593
|
+
}
|
|
573
594
|
interface ToolContext {
|
|
574
595
|
runId: string;
|
|
575
596
|
agentId: string;
|
|
@@ -580,6 +601,8 @@ interface ToolContext {
|
|
|
580
601
|
conversationId?: string;
|
|
581
602
|
/** The tenant ID when running in multi-tenant mode. */
|
|
582
603
|
tenantId?: string;
|
|
604
|
+
/** Virtual filesystem scoped to the current tenant. Available when VFS is enabled. */
|
|
605
|
+
vfs?: VfsAccess;
|
|
583
606
|
}
|
|
584
607
|
type ToolHandler<TInput extends Record<string, unknown>, TOutput> = (input: TInput, context: ToolContext) => Promise<TOutput> | TOutput;
|
|
585
608
|
interface ToolDefinition<TInput extends Record<string, unknown> = Record<string, unknown>, TOutput = unknown> {
|
|
@@ -685,6 +708,7 @@ type AgentEvent = {
|
|
|
685
708
|
} | {
|
|
686
709
|
type: "tool:completed";
|
|
687
710
|
tool: string;
|
|
711
|
+
input?: unknown;
|
|
688
712
|
output: unknown;
|
|
689
713
|
duration: number;
|
|
690
714
|
outputTokenEstimate?: number;
|
|
@@ -771,4 +795,4 @@ type AgentEvent = {
|
|
|
771
795
|
reason: string;
|
|
772
796
|
};
|
|
773
797
|
|
|
774
|
-
export { type AgentEvent, type AgentFailure, type ContentPart, FEATURE_DOMAIN_ORDER, type FeatureDomain, type FileContentPart, type FileInput, type JsonSchema, type Message, ONBOARDING_FIELDS, type OnboardingField, type OnboardingFieldCondition, type OnboardingFieldKind, type OnboardingFieldTarget, type OnboardingOption, type OnboardingScope, type Role, type RunInput, type RunResult, type TextContentPart, type TokenUsage, type ToolContext, type ToolDefinition, type ToolHandler, defineTool, fieldsForScope, getTextContent };
|
|
798
|
+
export { type AgentEvent, type AgentFailure, type ContentPart, FEATURE_DOMAIN_ORDER, type FeatureDomain, type FileContentPart, type FileInput, type JsonSchema, type Message, ONBOARDING_FIELDS, type OnboardingField, type OnboardingFieldCondition, type OnboardingFieldKind, type OnboardingFieldTarget, type OnboardingOption, type OnboardingScope, type Role, type RunInput, type RunResult, type TextContentPart, type TokenUsage, type ToolContext, type ToolDefinition, type ToolHandler, type VfsAccess, defineTool, fieldsForScope, getTextContent };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -50,6 +50,24 @@ export const getTextContent = (message: Message): string => {
|
|
|
50
50
|
.join("");
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
+
/** Virtual filesystem scoped to the current tenant. Available when VFS is enabled. */
|
|
54
|
+
export interface VfsAccess {
|
|
55
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
56
|
+
readText(path: string): Promise<string>;
|
|
57
|
+
writeFile(path: string, content: Uint8Array, mimeType?: string): Promise<void>;
|
|
58
|
+
writeText(path: string, content: string): Promise<void>;
|
|
59
|
+
exists(path: string): Promise<boolean>;
|
|
60
|
+
stat(path: string): Promise<{
|
|
61
|
+
size: number;
|
|
62
|
+
isDirectory: boolean;
|
|
63
|
+
mimeType?: string;
|
|
64
|
+
updatedAt: number;
|
|
65
|
+
}>;
|
|
66
|
+
readdir(path: string): Promise<string[]>;
|
|
67
|
+
mkdir(path: string, options?: { recursive?: boolean }): Promise<void>;
|
|
68
|
+
rm(path: string, options?: { recursive?: boolean }): Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
|
|
53
71
|
export interface ToolContext {
|
|
54
72
|
runId: string;
|
|
55
73
|
agentId: string;
|
|
@@ -60,6 +78,8 @@ export interface ToolContext {
|
|
|
60
78
|
conversationId?: string;
|
|
61
79
|
/** The tenant ID when running in multi-tenant mode. */
|
|
62
80
|
tenantId?: string;
|
|
81
|
+
/** Virtual filesystem scoped to the current tenant. Available when VFS is enabled. */
|
|
82
|
+
vfs?: VfsAccess;
|
|
63
83
|
}
|
|
64
84
|
|
|
65
85
|
export type ToolHandler<TInput extends Record<string, unknown>, TOutput> = (
|
|
@@ -154,7 +174,7 @@ export type AgentEvent =
|
|
|
154
174
|
| { type: "model:response"; usage: TokenUsage }
|
|
155
175
|
| { type: "tool:generating"; tool: string; toolCallId: string }
|
|
156
176
|
| { type: "tool:started"; tool: string; input: unknown }
|
|
157
|
-
| { type: "tool:completed"; tool: string; output: unknown; duration: number; outputTokenEstimate?: number }
|
|
177
|
+
| { type: "tool:completed"; tool: string; input?: unknown; output: unknown; duration: number; outputTokenEstimate?: number }
|
|
158
178
|
| { type: "tool:error"; tool: string; error: string; recoverable: boolean }
|
|
159
179
|
| {
|
|
160
180
|
type: "tool:approval:required";
|
package/.turbo/turbo-lint.log
DELETED
package/.turbo/turbo-test.log
DELETED
|
File without changes
|