@komputer-ai/sdk 0.11.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/.openapi-generator-ignore +31 -0
- package/README.md +147 -0
- package/docs/AgentListResponse.md +34 -0
- package/docs/AgentResponse.md +68 -0
- package/docs/AgentsApi.md +584 -0
- package/docs/ConnectorResponse.md +58 -0
- package/docs/ConnectorsApi.md +366 -0
- package/docs/CreateAgentRequest.md +58 -0
- package/docs/CreateConnectorRequest.md +54 -0
- package/docs/CreateMemoryRequest.md +40 -0
- package/docs/CreateScheduleAgentSpec.md +42 -0
- package/docs/CreateScheduleRequest.md +50 -0
- package/docs/CreateSecretRequest.md +38 -0
- package/docs/CreateSkillRequest.md +40 -0
- package/docs/MemoriesApi.md +368 -0
- package/docs/MemoryResponse.md +46 -0
- package/docs/OfficeListResponse.md +34 -0
- package/docs/OfficeMemberResponse.md +40 -0
- package/docs/OfficeResponse.md +54 -0
- package/docs/OfficesApi.md +300 -0
- package/docs/PatchAgentRequest.md +50 -0
- package/docs/PatchMemoryRequest.md +36 -0
- package/docs/PatchScheduleRequest.md +34 -0
- package/docs/PatchSkillRequest.md +36 -0
- package/docs/ScheduleListResponse.md +34 -0
- package/docs/ScheduleResponse.md +70 -0
- package/docs/SchedulesApi.md +369 -0
- package/docs/SecretListResponse.md +34 -0
- package/docs/SecretResponse.md +48 -0
- package/docs/SecretsApi.md +298 -0
- package/docs/SkillResponse.md +48 -0
- package/docs/SkillsApi.md +368 -0
- package/docs/TemplatesApi.md +138 -0
- package/docs/UpdateSecretRequest.md +36 -0
- package/package.json +27 -0
- package/src/apis/AgentsApi.ts +485 -0
- package/src/apis/ConnectorsApi.ts +301 -0
- package/src/apis/MemoriesApi.ts +315 -0
- package/src/apis/OfficesApi.ts +253 -0
- package/src/apis/SchedulesApi.ts +318 -0
- package/src/apis/SecretsApi.ts +267 -0
- package/src/apis/SkillsApi.ts +315 -0
- package/src/apis/TemplatesApi.ts +109 -0
- package/src/apis/index.ts +10 -0
- package/src/client.test.ts +88 -0
- package/src/client.ts +212 -0
- package/src/index.ts +7 -0
- package/src/models/AgentListResponse.ts +73 -0
- package/src/models/AgentResponse.ts +201 -0
- package/src/models/ConnectorResponse.ts +161 -0
- package/src/models/CreateAgentRequest.ts +163 -0
- package/src/models/CreateConnectorRequest.ts +148 -0
- package/src/models/CreateMemoryRequest.ts +91 -0
- package/src/models/CreateScheduleAgentSpec.ts +97 -0
- package/src/models/CreateScheduleRequest.ts +140 -0
- package/src/models/CreateSecretRequest.ts +83 -0
- package/src/models/CreateSkillRequest.ts +92 -0
- package/src/models/MemoryResponse.ts +113 -0
- package/src/models/OfficeListResponse.ts +73 -0
- package/src/models/OfficeMemberResponse.ts +89 -0
- package/src/models/OfficeResponse.ts +153 -0
- package/src/models/PatchAgentRequest.ts +129 -0
- package/src/models/PatchMemoryRequest.ts +73 -0
- package/src/models/PatchScheduleRequest.ts +65 -0
- package/src/models/PatchSkillRequest.ts +73 -0
- package/src/models/ScheduleListResponse.ts +73 -0
- package/src/models/ScheduleResponse.ts +209 -0
- package/src/models/SecretListResponse.ts +73 -0
- package/src/models/SecretResponse.ts +121 -0
- package/src/models/SkillResponse.ts +121 -0
- package/src/models/UpdateSecretRequest.ts +74 -0
- package/src/models/index.ts +26 -0
- package/src/runtime.ts +450 -0
- package/src/watch.ts +89 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
|
24
|
+
|
|
25
|
+
# Preserve hand-written and customized files
|
|
26
|
+
src/watch.ts
|
|
27
|
+
src/client.ts
|
|
28
|
+
src/**/*.test.ts
|
|
29
|
+
tsconfig.json
|
|
30
|
+
tsconfig.esm.json
|
|
31
|
+
package.json
|
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# komputer-ai TypeScript SDK
|
|
2
|
+
|
|
3
|
+
TypeScript/JavaScript client for the [komputer.ai](https://github.com/kontroloop-ai/komputer-ai) platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @komputer-ai/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or install directly from the repository:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/kontroloop-ai/komputer-ai.git
|
|
15
|
+
cd komputer-ai/komputer-sdk/typescript && npm install && npm run build
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { KomputerClient } from "@komputer-ai/sdk";
|
|
22
|
+
|
|
23
|
+
const client = new KomputerClient("http://localhost:8080");
|
|
24
|
+
|
|
25
|
+
// Create an agent
|
|
26
|
+
const agent = await client.createAgent({
|
|
27
|
+
name: "my-agent",
|
|
28
|
+
instructions: "Summarize the latest Kubernetes release notes",
|
|
29
|
+
model: "claude-sonnet-4-6",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Stream events as the agent works
|
|
33
|
+
for await (const event of client.watchAgent("my-agent")) {
|
|
34
|
+
if (event.type === "text") {
|
|
35
|
+
console.log(event.payload.content);
|
|
36
|
+
} else if (event.type === "task_completed") {
|
|
37
|
+
console.log(`Done — cost: $${event.payload.cost_usd}`);
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
### Agents
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// Create
|
|
49
|
+
await client.createAgent({ name: "researcher", instructions: "Research AI trends", model: "claude-sonnet-4-6" });
|
|
50
|
+
|
|
51
|
+
// List
|
|
52
|
+
const agents = await client.listAgents();
|
|
53
|
+
|
|
54
|
+
// Get
|
|
55
|
+
const agent = await client.getAgent("researcher");
|
|
56
|
+
|
|
57
|
+
// Update
|
|
58
|
+
await client.patchAgent({ name: "researcher", model: "claude-haiku-4-5-20251001", lifecycle: "Sleep" });
|
|
59
|
+
|
|
60
|
+
// Cancel a running task
|
|
61
|
+
await client.cancelAgentTask("researcher");
|
|
62
|
+
|
|
63
|
+
// Delete
|
|
64
|
+
await client.deleteAgent("researcher");
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Memories
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
await client.createMemory({ name: "company-context", content: "We are a B2B SaaS company.", description: "Background" });
|
|
71
|
+
await client.patchAgent({ name: "my-agent", memories: ["company-context"] });
|
|
72
|
+
|
|
73
|
+
const memories = await client.listMemories();
|
|
74
|
+
await client.patchMemory({ name: "company-context", content: "Updated context." });
|
|
75
|
+
await client.deleteMemory("company-context");
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Skills
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
await client.createSkill({ name: "healthcheck", description: "Check service health", content: "curl -s http://api/healthz" });
|
|
82
|
+
await client.patchAgent({ name: "my-agent", skills: ["healthcheck"] });
|
|
83
|
+
|
|
84
|
+
const skills = await client.listSkills();
|
|
85
|
+
await client.deleteSkill("healthcheck");
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Schedules
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
await client.createSchedule({
|
|
92
|
+
name: "daily-report",
|
|
93
|
+
schedule: "0 9 * * *",
|
|
94
|
+
instructions: "Generate a daily status report",
|
|
95
|
+
timezone: "America/New_York",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const schedules = await client.listSchedules();
|
|
99
|
+
await client.patchSchedule({ name: "daily-report", schedule: "0 10 * * *" });
|
|
100
|
+
await client.deleteSchedule("daily-report");
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Secrets
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
await client.createSecret({ name: "api-keys", data: { GITHUB_TOKEN: "ghp_xxx", SLACK_TOKEN: "xoxb-xxx" } });
|
|
107
|
+
await client.patchAgent({ name: "my-agent", secretRefs: ["api-keys"] });
|
|
108
|
+
|
|
109
|
+
const secrets = await client.listSecrets();
|
|
110
|
+
await client.deleteSecret("api-keys");
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Connectors
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
await client.createConnector({ name: "slack", service: "slack", url: "https://mcp.slack.com", authType: "token" });
|
|
117
|
+
await client.patchAgent({ name: "my-agent", connectors: ["slack"] });
|
|
118
|
+
|
|
119
|
+
const connectors = await client.listConnectors();
|
|
120
|
+
await client.deleteConnector("slack");
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Streaming Events
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
for await (const event of client.watchAgent("my-agent")) {
|
|
127
|
+
switch (event.type) {
|
|
128
|
+
case "task_started":
|
|
129
|
+
console.log("Agent started working...");
|
|
130
|
+
break;
|
|
131
|
+
case "text":
|
|
132
|
+
console.log(event.payload.content);
|
|
133
|
+
break;
|
|
134
|
+
case "tool_use":
|
|
135
|
+
console.log(`Using tool: ${event.payload.name}`);
|
|
136
|
+
break;
|
|
137
|
+
case "task_completed":
|
|
138
|
+
console.log(`Done — cost: $${event.payload.cost_usd}`);
|
|
139
|
+
break;
|
|
140
|
+
case "error":
|
|
141
|
+
console.error(event.payload.error);
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Event types: `task_started`, `thinking`, `tool_use`, `tool_result`, `text`, `task_completed`, `task_cancelled`, `error`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# AgentListResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`agents` | [Array<AgentResponse>](AgentResponse.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { AgentListResponse } from 'komputer-ai'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"agents": null,
|
|
19
|
+
} satisfies AgentListResponse
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as AgentListResponse
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
|
|
2
|
+
# AgentResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`connectors` | Array<string>
|
|
10
|
+
`createdAt` | string
|
|
11
|
+
`instructions` | string
|
|
12
|
+
`lastTaskCostUSD` | string
|
|
13
|
+
`lastTaskMessage` | string
|
|
14
|
+
`lifecycle` | string
|
|
15
|
+
`memories` | Array<string>
|
|
16
|
+
`model` | string
|
|
17
|
+
`modelContextWindow` | number
|
|
18
|
+
`name` | string
|
|
19
|
+
`namespace` | string
|
|
20
|
+
`secrets` | Array<string>
|
|
21
|
+
`skills` | Array<string>
|
|
22
|
+
`status` | string
|
|
23
|
+
`systemPrompt` | string
|
|
24
|
+
`taskStatus` | string
|
|
25
|
+
`totalCostUSD` | string
|
|
26
|
+
`totalTokens` | number
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
import type { AgentResponse } from 'komputer-ai'
|
|
32
|
+
|
|
33
|
+
// TODO: Update the object below with actual values
|
|
34
|
+
const example = {
|
|
35
|
+
"connectors": null,
|
|
36
|
+
"createdAt": null,
|
|
37
|
+
"instructions": null,
|
|
38
|
+
"lastTaskCostUSD": null,
|
|
39
|
+
"lastTaskMessage": null,
|
|
40
|
+
"lifecycle": null,
|
|
41
|
+
"memories": null,
|
|
42
|
+
"model": null,
|
|
43
|
+
"modelContextWindow": null,
|
|
44
|
+
"name": null,
|
|
45
|
+
"namespace": null,
|
|
46
|
+
"secrets": null,
|
|
47
|
+
"skills": null,
|
|
48
|
+
"status": null,
|
|
49
|
+
"systemPrompt": null,
|
|
50
|
+
"taskStatus": null,
|
|
51
|
+
"totalCostUSD": null,
|
|
52
|
+
"totalTokens": null,
|
|
53
|
+
} satisfies AgentResponse
|
|
54
|
+
|
|
55
|
+
console.log(example)
|
|
56
|
+
|
|
57
|
+
// Convert the instance to a JSON string
|
|
58
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
59
|
+
console.log(exampleJSON)
|
|
60
|
+
|
|
61
|
+
// Parse the JSON string back to an object
|
|
62
|
+
const exampleParsed = JSON.parse(exampleJSON) as AgentResponse
|
|
63
|
+
console.log(exampleParsed)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
67
|
+
|
|
68
|
+
|