diff --git a/src/pages/sdk/agent-anthropic/README.mdx b/src/pages/sdk/agent-anthropic/README.mdx index e80804c..da19a47 100644 --- a/src/pages/sdk/agent-anthropic/README.mdx +++ b/src/pages/sdk/agent-anthropic/README.mdx @@ -12,20 +12,14 @@ export const metadata = { ## Interfaces - [AnthropicToolUse](interfaces/AnthropicToolUse.mdx) -- [FleetClient](interfaces/FleetClient.mdx) -- [InvokeWithStampAndPostInput](interfaces/InvokeWithStampAndPostInput.mdx) -- [InvokeWithStampAndPostResult](interfaces/InvokeWithStampAndPostResult.mdx) - [InvokeWithStampInput](interfaces/InvokeWithStampInput.mdx) - [InvokeWithStampResult](interfaces/InvokeWithStampResult.mdx) -- [PostActionResult](interfaces/PostActionResult.mdx) - [StampToolUseInput](interfaces/StampToolUseInput.mdx) ## Functions - [canonicalizeToolUse](functions/canonicalizeToolUse.mdx) - [invokeWithStamp](functions/invokeWithStamp.mdx) -- [invokeWithStampAndPost](functions/invokeWithStampAndPost.mdx) -- [postActionToFleet](functions/postActionToFleet.mdx) - [stampToolUse](functions/stampToolUse.mdx) - [toolUseHash](functions/toolUseHash.mdx) - [toolUseId](functions/toolUseId.mdx) diff --git a/src/pages/sdk/agent-anthropic/functions/invokeWithStampAndPost.mdx b/src/pages/sdk/agent-anthropic/functions/invokeWithStampAndPost.mdx deleted file mode 100644 index 8656d7c..0000000 --- a/src/pages/sdk/agent-anthropic/functions/invokeWithStampAndPost.mdx +++ /dev/null @@ -1,43 +0,0 @@ -export const metadata = { - title: "Function: invokeWithStampAndPost()", - description: "Auto-generated API reference for Function: invokeWithStampAndPost(). Source: TypeScript types in oc-packages.", -}; - -[**@orangecheck/agent-anthropic**](../README.mdx) - -*** - -[@orangecheck/agent-anthropic](../README.mdx) / invokeWithStampAndPost - -# Function: invokeWithStampAndPost() - -```ts -function invokeWithStampAndPost(input: InvokeWithStampAndPostInput): Promise>; -``` - -Defined in: [index.ts:236](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L236) - -Convenience: stamp the tool_use, execute the handler, AND post the -stamped envelope to fleet. Three roundtrips → one call. If `fleet` -is omitted, this is identical to invokeWithStamp + posted=null. - -The post happens AFTER the call so a failing post doesn't prevent the -tool from running. If you need pre-authorization (the post must -succeed before the call runs), use stampToolUse + postActionToFleet -+ your call() in that order. - -## Type Parameters - -| Type Parameter | -| ------ | -| `T` | - -## Parameters - -| Parameter | Type | -| ------ | ------ | -| `input` | [`InvokeWithStampAndPostInput`](../interfaces/InvokeWithStampAndPostInput.mdx)\<`T`\> | - -## Returns - -`Promise`\<[`InvokeWithStampAndPostResult`](../interfaces/InvokeWithStampAndPostResult.mdx)\<`T`\>\> diff --git a/src/pages/sdk/agent-anthropic/functions/postActionToFleet.mdx b/src/pages/sdk/agent-anthropic/functions/postActionToFleet.mdx deleted file mode 100644 index 02119b9..0000000 --- a/src/pages/sdk/agent-anthropic/functions/postActionToFleet.mdx +++ /dev/null @@ -1,41 +0,0 @@ -export const metadata = { - title: "Function: postActionToFleet()", - description: "Auto-generated API reference for Function: postActionToFleet(). Source: TypeScript types in oc-packages.", -}; - -[**@orangecheck/agent-anthropic**](../README.mdx) - -*** - -[@orangecheck/agent-anthropic](../README.mdx) / postActionToFleet - -# Function: postActionToFleet() - -```ts -function postActionToFleet(action: ActionEnvelope, client: FleetClient): Promise; -``` - -Defined in: [index.ts:176](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L176) - -POST a stamped action envelope to fleet.ochk.io's /api/actions -registry. The fleet: - - re-derives the action id from canonical inputs and rejects on - mismatch (tamper defense) - - validates that the agent address matches the parent delegation's - agent (forgery defense) - - persists, fans out to Nostr (kind 30084), submits to OC Stamp, - and triggers any subscribed webhooks (action.registered) - -Returns the registered action's id + project_id + delegation_id. -Throws on non-2xx with the server's reason string. - -## Parameters - -| Parameter | Type | -| ------ | ------ | -| `action` | `ActionEnvelope` | -| `client` | [`FleetClient`](../interfaces/FleetClient.mdx) | - -## Returns - -`Promise`\<[`PostActionResult`](../interfaces/PostActionResult.mdx)\> diff --git a/src/pages/sdk/agent-anthropic/interfaces/FleetClient.mdx b/src/pages/sdk/agent-anthropic/interfaces/FleetClient.mdx deleted file mode 100644 index 4bc7dfb..0000000 --- a/src/pages/sdk/agent-anthropic/interfaces/FleetClient.mdx +++ /dev/null @@ -1,23 +0,0 @@ -export const metadata = { - title: "Interface: FleetClient", - description: "Auto-generated API reference for Interface: FleetClient. Source: TypeScript types in oc-packages.", -}; - -[**@orangecheck/agent-anthropic**](../README.mdx) - -*** - -[@orangecheck/agent-anthropic](../README.mdx) / FleetClient - -# Interface: FleetClient - -Defined in: [index.ts:146](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L146) - -## Properties - -| Property | Type | Description | Defined in | -| ------ | ------ | ------ | ------ | -| <a id="property-apitoken"></a> `apiToken` | `string` | Bearer token from /settings § 03 (`ock_`). | [index.ts:150](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L150) | -| <a id="property-baseurl"></a> `baseUrl?` | `string` | Defaults to https://fleet.ochk.io. | [index.ts:148](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L148) | -| <a id="property-fetch"></a> `fetch?` | (`input`: `RequestInfo` \| `URL`, `init?`: `RequestInit`) => `Promise`\<`Response`\> | Optional fetch override for runtimes that need it (Node 18 LTS w/o global fetch, etc). | [index.ts:154](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L154) | -| <a id="property-projectid"></a> `projectId` | `string` | Project the action belongs to (proj_*). | [index.ts:152](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L152) | diff --git a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampAndPostInput.mdx b/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampAndPostInput.mdx deleted file mode 100644 index 663649a..0000000 --- a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampAndPostInput.mdx +++ /dev/null @@ -1,36 +0,0 @@ -export const metadata = { - title: "Interface: InvokeWithStampAndPostInput", - description: "Auto-generated API reference for Interface: InvokeWithStampAndPostInput. Source: TypeScript types in oc-packages.", -}; - -[**@orangecheck/agent-anthropic**](../README.mdx) - -*** - -[@orangecheck/agent-anthropic](../README.mdx) / InvokeWithStampAndPostInput - -# Interface: InvokeWithStampAndPostInput\<T\> - -Defined in: [index.ts:216](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L216) - -## Extends - -- [`InvokeWithStampInput`](InvokeWithStampInput.mdx)\<`T`\> - -## Type Parameters - -| Type Parameter | -| ------ | -| `T` | - -## Properties - -| Property | Type | Description | Inherited from | Defined in | -| ------ | ------ | ------ | ------ | ------ | -| <a id="property-agent"></a> `agent` | `SignerRef` | - | [`InvokeWithStampInput`](InvokeWithStampInput.mdx).[`agent`](InvokeWithStampInput.mdx#property-agent) | [index.ts:85](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L85) | -| <a id="property-call"></a> `call` | (`toolUse`: [`AnthropicToolUse`](AnthropicToolUse.mdx)) => `Promise`\<`T`\> | Your handler that actually runs the tool. Returns whatever the tool returns. | [`InvokeWithStampInput`](InvokeWithStampInput.mdx).[`call`](InvokeWithStampInput.mdx#property-call) | [index.ts:120](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L120) | -| <a id="property-delegation"></a> `delegation` | `DelegationEnvelope` | - | [`InvokeWithStampInput`](InvokeWithStampInput.mdx).[`delegation`](InvokeWithStampInput.mdx#property-delegation) | [index.ts:86](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L86) | -| <a id="property-fleet"></a> `fleet?` | [`FleetClient`](FleetClient.mdx) | Fleet credentials. If absent, behaves like invokeWithStamp (no posting). | - | [index.ts:218](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L218) | -| <a id="property-scopeexercised"></a> `scopeExercised?` | `string` | Defaults to `anthropic:tool(name=)` — the tightest admissible sub-scope. | [`InvokeWithStampInput`](InvokeWithStampInput.mdx).[`scopeExercised`](InvokeWithStampInput.mdx#property-scopeexercised) | [index.ts:89](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L89) | -| <a id="property-signedat"></a> `signedAt?` | `Date` | - | [`InvokeWithStampInput`](InvokeWithStampInput.mdx).[`signedAt`](InvokeWithStampInput.mdx#property-signedat) | [index.ts:90](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L90) | -| <a id="property-tooluse"></a> `toolUse` | [`AnthropicToolUse`](AnthropicToolUse.mdx) | - | [`InvokeWithStampInput`](InvokeWithStampInput.mdx).[`toolUse`](InvokeWithStampInput.mdx#property-tooluse) | [index.ts:87](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L87) | diff --git a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampAndPostResult.mdx b/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampAndPostResult.mdx deleted file mode 100644 index 27a8004..0000000 --- a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampAndPostResult.mdx +++ /dev/null @@ -1,32 +0,0 @@ -export const metadata = { - title: "Interface: InvokeWithStampAndPostResult", - description: "Auto-generated API reference for Interface: InvokeWithStampAndPostResult. Source: TypeScript types in oc-packages.", -}; - -[**@orangecheck/agent-anthropic**](../README.mdx) - -*** - -[@orangecheck/agent-anthropic](../README.mdx) / InvokeWithStampAndPostResult - -# Interface: InvokeWithStampAndPostResult\<T\> - -Defined in: [index.ts:221](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L221) - -## Extends - -- [`InvokeWithStampResult`](InvokeWithStampResult.mdx)\<`T`\> - -## Type Parameters - -| Type Parameter | -| ------ | -| `T` | - -## Properties - -| Property | Type | Description | Inherited from | Defined in | -| ------ | ------ | ------ | ------ | ------ | -| <a id="property-action"></a> `action` | `ActionEnvelope` | - | [`InvokeWithStampResult`](InvokeWithStampResult.mdx).[`action`](InvokeWithStampResult.mdx#property-action) | [index.ts:125](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L125) | -| <a id="property-posted"></a> `posted` | [`PostActionResult`](PostActionResult.mdx) \| `null` | Set when fleet is configured AND the POST succeeded. null otherwise. | - | [index.ts:223](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L223) | -| <a id="property-result"></a> `result` | `T` | - | [`InvokeWithStampResult`](InvokeWithStampResult.mdx).[`result`](InvokeWithStampResult.mdx#property-result) | [index.ts:124](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L124) | diff --git a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampInput.mdx b/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampInput.mdx index ac5bcd0..ce96fd9 100644 --- a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampInput.mdx +++ b/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampInput.mdx @@ -17,10 +17,6 @@ Defined in: [index.ts:118](https://github.com/orangecheck/oc-packages/blob/main/ - [`StampToolUseInput`](StampToolUseInput.mdx) -## Extended by - -- [`InvokeWithStampAndPostInput`](InvokeWithStampAndPostInput.mdx) - ## Type Parameters | Type Parameter | diff --git a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampResult.mdx b/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampResult.mdx index 9ed499e..4db02c7 100644 --- a/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampResult.mdx +++ b/src/pages/sdk/agent-anthropic/interfaces/InvokeWithStampResult.mdx @@ -13,10 +13,6 @@ export const metadata = { Defined in: [index.ts:123](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L123) -## Extended by - -- [`InvokeWithStampAndPostResult`](InvokeWithStampAndPostResult.mdx) - ## Type Parameters | Type Parameter | diff --git a/src/pages/sdk/agent-anthropic/interfaces/PostActionResult.mdx b/src/pages/sdk/agent-anthropic/interfaces/PostActionResult.mdx deleted file mode 100644 index 14ac976..0000000 --- a/src/pages/sdk/agent-anthropic/interfaces/PostActionResult.mdx +++ /dev/null @@ -1,22 +0,0 @@ -export const metadata = { - title: "Interface: PostActionResult", - description: "Auto-generated API reference for Interface: PostActionResult. Source: TypeScript types in oc-packages.", -}; - -[**@orangecheck/agent-anthropic**](../README.mdx) - -*** - -[@orangecheck/agent-anthropic](../README.mdx) / PostActionResult - -# Interface: PostActionResult - -Defined in: [index.ts:157](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L157) - -## Properties - -| Property | Type | Defined in | -| ------ | ------ | ------ | -| <a id="property-delegation_id"></a> `delegation_id` | `string` | [index.ts:160](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L160) | -| <a id="property-id"></a> `id` | `string` | [index.ts:158](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L158) | -| <a id="property-project_id"></a> `project_id` | `string` | [index.ts:159](https://github.com/orangecheck/oc-packages/blob/main/agent-anthropic/src/index.ts#L159) |