@agentpulselabs/agent-studio-client 0.1.0

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.
Files changed (4) hide show
  1. package/README.md +31 -0
  2. package/index.d.ts +55 -0
  3. package/index.js +18 -0
  4. package/package.json +17 -0
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @agentpulselabs/agent-studio-client
2
+
3
+ Typed [AppBridge](https://www.npmjs.com/package/@agentpulselabs/platform-sdk) client for the `agent-studio` app. Bridge-injected — no runtime dependency on `agent-studio` or `@agentpulse/platform`.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm i @agentpulselabs/agent-studio-client
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ import { createClient } from '@agentpulselabs/agent-studio-client';
15
+
16
+ const agent_studio = createClient(Platform.Bridge);
17
+ const result = await agent_studio.agentsGetByKey(payload);
18
+ ```
19
+
20
+ ## Operations (AgentStudio)
21
+
22
+ | Method | Op | Summary |
23
+ | --- | --- | --- |
24
+ | `agentsGetByKey` | `agents:get-by-key` | Resolve a team's agent by stable agent_key (team override wins, else the shipped blueprint). |
25
+ | `conversationsAppend` | `conversations:append` | Append a turn to an existing conversation, or create a new one when no id is given. |
26
+ | `conversationsResume` | `conversations:resume` | The full transcript array for a conversation (RLS-scoped), or [] if none. |
27
+ | `runtimeExecute` | `runtime:execute` | Run one agent turn (skill-aware tool loop). Streaming op — consume via bridge.stream(). |
28
+ | `widgetActive_agents` | `widget:active_agents` | Home-widget stat: the team's enabled purpose agents (team rows + un-overridden blueprints) of the pool total. |
29
+ | `widgetActive_skills` | `widget:active_skills` | Home-widget stat: the team's enabled skills (team rows + un-overridden blueprints) of the pool total. |
30
+ | `widgetRecent_chats` | `widget:recent_chats` | Home-widget list: the team's 5 most recently updated conversations. |
31
+ | `widgetRegistry_tools` | `widget:registry_tools` | Home-widget stat: count of the platform's non-deprecated operation catalog (tools available to agents). |
package/index.d.ts ADDED
@@ -0,0 +1,55 @@
1
+ // GENERATED — DO NOT EDIT BY HAND.
2
+ // Source: Bridge.provide()/bridge.provide() calls in this app (scripts/lib/bridgeProvide.mjs).
3
+ // Regenerate: node scripts/generate-app-client-package.mjs --app-root <this-app>
4
+ // See docs/DESIGN_app-client-packages.md.
5
+
6
+ /** Minimal shape of the injected AppBridge facade this client is built on (Platform.Bridge). */
7
+ export interface Bridge {
8
+ call(req: { targetApp: string; operation: string; payload?: unknown }): Promise<unknown>;
9
+ }
10
+
11
+ export interface AgentsGetByKeyInput {
12
+ agentKey: string;
13
+ }
14
+
15
+ export interface AgentsGetByKeyOutput {
16
+ agent: Record<string, unknown> | null;
17
+ }
18
+
19
+ export interface ConversationsAppendOutput {
20
+ conversationId: string;
21
+ }
22
+
23
+ export interface ConversationsResumeInput {
24
+ conversationId: string;
25
+ }
26
+
27
+ export interface ConversationsResumeOutput {
28
+ transcript: unknown[];
29
+ }
30
+
31
+ export interface WidgetRecent_chatsOutput {
32
+ empty: string;
33
+ items: unknown[];
34
+ }
35
+
36
+ export interface AgentStudioClient {
37
+ /** Resolve a team's agent by stable agent_key (team override wins, else the shipped blueprint). */
38
+ agentsGetByKey(payload: AgentsGetByKeyInput): Promise<AgentsGetByKeyOutput>;
39
+ /** Append a turn to an existing conversation, or create a new one when no id is given. */
40
+ conversationsAppend(payload: Record<string, unknown>): Promise<ConversationsAppendOutput>;
41
+ /** The full transcript array for a conversation (RLS-scoped), or [] if none. */
42
+ conversationsResume(payload: ConversationsResumeInput): Promise<ConversationsResumeOutput>;
43
+ /** Run one agent turn (skill-aware tool loop). Streaming op — consume via bridge.stream(). */
44
+ runtimeExecute(payload: Record<string, unknown>): Promise<unknown>;
45
+ /** Home-widget stat: the team's enabled purpose agents (team rows + un-overridden blueprints) of the pool total. */
46
+ widgetActive_agents(payload: Record<string, unknown>): Promise<unknown>;
47
+ /** Home-widget stat: the team's enabled skills (team rows + un-overridden blueprints) of the pool total. */
48
+ widgetActive_skills(payload: Record<string, unknown>): Promise<unknown>;
49
+ /** Home-widget list: the team's 5 most recently updated conversations. */
50
+ widgetRecent_chats(payload: Record<string, unknown>): Promise<WidgetRecent_chatsOutput>;
51
+ /** Home-widget stat: count of the platform's non-deprecated operation catalog (tools available to agents). */
52
+ widgetRegistry_tools(payload: Record<string, unknown>): Promise<unknown>;
53
+ }
54
+
55
+ export declare function createClient(bridge: Bridge): AgentStudioClient;
package/index.js ADDED
@@ -0,0 +1,18 @@
1
+ // GENERATED — DO NOT EDIT BY HAND.
2
+ // Source: Bridge.provide()/bridge.provide() calls in this app (scripts/lib/bridgeProvide.mjs).
3
+ // Regenerate: node scripts/generate-app-client-package.mjs --app-root <this-app>
4
+ // See docs/DESIGN_app-client-packages.md.
5
+
6
+ export function createClient(bridge) {
7
+ if (!bridge) throw new Error('[agent-studio-client] bridge is required');
8
+ return {
9
+ agentsGetByKey: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'agents:get-by-key', payload }),
10
+ conversationsAppend: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'conversations:append', payload }),
11
+ conversationsResume: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'conversations:resume', payload }),
12
+ runtimeExecute: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'runtime:execute', payload }),
13
+ widgetActive_agents: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'widget:active_agents', payload }),
14
+ widgetActive_skills: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'widget:active_skills', payload }),
15
+ widgetRecent_chats: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'widget:recent_chats', payload }),
16
+ widgetRegistry_tools: (payload) => bridge.call({ targetApp: 'agent-studio', operation: 'widget:registry_tools', payload }),
17
+ };
18
+ }
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@agentpulselabs/agent-studio-client",
3
+ "version": "0.1.0",
4
+ "description": "Typed AppBridge client for the agent-studio app.",
5
+ "type": "module",
6
+ "main": "index.js",
7
+ "types": "index.d.ts",
8
+ "license": "MIT",
9
+ "files": [
10
+ "index.js",
11
+ "index.d.ts",
12
+ "README.md"
13
+ ],
14
+ "publishConfig": {
15
+ "access": "public"
16
+ }
17
+ }