@ampcode/sdk 0.0.0-placeholder → 0.1.0-20260513070248-g548495c

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/bin/amp-sdk.js ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runInstallCommand } from '../dist/install.js'
4
+
5
+ runInstallCommand(process.argv.slice(2))
6
+ .then((exitCode) => {
7
+ process.exit(exitCode)
8
+ })
9
+ .catch((error) => {
10
+ const message = error instanceof Error ? error.message : String(error)
11
+ console.error(message)
12
+ process.exit(1)
13
+ })
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Amp TypeScript SDK
3
+ *
4
+ * This SDK provides a TypeScript interface to the Amp CLI, allowing you to
5
+ * run Amp programmatically in Node.js applications. It wraps the Amp CLI
6
+ * with the --stream-json flag to provide structured output.
7
+ */
8
+ import { type ExecuteOptions, type Permission, type PermissionMatchCondition, type StreamMessage, type ThreadsMarkdownOptions, type ThreadsNewOptions, type UserInputMessage } from './types.js';
9
+ /** Execute a command with Amp CLI and return an async iterator of messages */
10
+ export declare function execute(options: ExecuteOptions): AsyncIterable<StreamMessage>;
11
+ /** Create a new empty thread and return its ID */
12
+ declare function newThread(options?: ThreadsNewOptions): Promise<string>;
13
+ /** Get a thread rendered as markdown */
14
+ declare function getThreadMarkdown(options: ThreadsMarkdownOptions): Promise<string>;
15
+ /** Thread commands */
16
+ export declare const threads: {
17
+ new: typeof newThread;
18
+ markdown: typeof getThreadMarkdown;
19
+ };
20
+ /** Create a user input message for streaming conversations */
21
+ export declare function createUserMessage(text: string): UserInputMessage;
22
+ /** Create a permission object for controlling tool usage */
23
+ export declare function createPermission(tool: string, action: 'allow' | 'reject' | 'ask' | 'delegate', options?: {
24
+ matches?: Record<string, PermissionMatchCondition>;
25
+ context?: 'thread' | 'subagent';
26
+ to?: string;
27
+ }): Permission;
28
+ export * from './types.js';
29
+ //# sourceMappingURL=index.d.ts.map