typeclaw 0.42.0 → 0.43.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.
- package/auth.schema.json +16 -0
- package/package.json +3 -3
- package/secrets.schema.json +16 -0
- package/src/agent/adaptive-thinking-compat.ts +79 -0
- package/src/agent/index.ts +79 -101
- package/src/agent/live-subagents.ts +4 -4
- package/src/agent/plugin-tools.ts +85 -132
- package/src/agent/provider-error.ts +37 -0
- package/src/agent/reload-tool.ts +1 -1
- package/src/agent/session-origin.ts +6 -3
- package/src/agent/subagents.ts +2 -2
- package/src/agent/system-prompt.ts +24 -8
- package/src/agent/tool-result-budget.ts +1 -1
- package/src/agent/tools/channel-react.ts +5 -4
- package/src/agent/tools/spawn-subagent.ts +80 -24
- package/src/agent/tools/stream-snapshot.ts +8 -3
- package/src/bundled-plugins/agent-browser/index.ts +18 -8
- package/src/bundled-plugins/memory/README.md +4 -1
- package/src/bundled-plugins/memory/belief-sentence.ts +50 -0
- package/src/bundled-plugins/memory/dreaming.ts +13 -6
- package/src/bundled-plugins/memory/load-memory.ts +22 -2
- package/src/bundled-plugins/memory/memory-logger.ts +1 -1
- package/src/bundled-plugins/planner/planner.ts +1 -1
- package/src/bundled-plugins/researcher/researcher.ts +2 -2
- package/src/bundled-plugins/reviewer/reviewer.ts +1 -1
- package/src/capabilities/control-plane.ts +24 -0
- package/src/capabilities/index.ts +2 -0
- package/src/capabilities/runtime.ts +30 -0
- package/src/channels/adapters/discord-bot-thread-room.ts +73 -0
- package/src/channels/adapters/discord-bot.ts +9 -1
- package/src/channels/adapters/slack-bot-classify.ts +1 -0
- package/src/channels/adapters/slack-classify.ts +1 -0
- package/src/channels/engagement.ts +33 -0
- package/src/channels/manager.ts +41 -47
- package/src/channels/router.ts +150 -21
- package/src/channels/types.ts +10 -0
- package/src/cli/channel.ts +49 -12
- package/src/cli/command-meta.ts +2 -0
- package/src/cli/hostd.ts +4 -3
- package/src/cli/index.ts +1 -0
- package/src/cli/logs.ts +2 -2
- package/src/cli/mcp.ts +233 -0
- package/src/cli/restart.ts +5 -3
- package/src/cli/shell.ts +2 -2
- package/src/cli/start.ts +2 -2
- package/src/cli/status.ts +2 -2
- package/src/cli/stop.ts +2 -2
- package/src/compose/restart.ts +4 -3
- package/src/compose/start.ts +2 -2
- package/src/compose/stop.ts +2 -2
- package/src/config/config.ts +10 -1
- package/src/config/providers.ts +61 -9
- package/src/container/controller.ts +104 -0
- package/src/container/index.ts +9 -0
- package/src/hostd/daemon.ts +28 -9
- package/src/hostd/protocol.ts +12 -9
- package/src/init/index.ts +1 -1
- package/src/init/instagram-auth.ts +189 -34
- package/src/inspect/logs-item.ts +2 -2
- package/src/mcp/client.ts +16 -6
- package/src/mcp/index.ts +12 -0
- package/src/mcp/manager.ts +9 -4
- package/src/mcp/oauth.ts +212 -0
- package/src/run/index.ts +36 -11
- package/src/run/{codex-fetch-observer.ts → llm-fetch-observer.ts} +182 -82
- package/src/sandbox/availability.ts +2 -2
- package/src/sandbox/build.ts +1 -1
- package/src/sandbox/hidden-paths.ts +59 -0
- package/src/sandbox/index.ts +1 -1
- package/src/sandbox/policy.ts +2 -2
- package/src/secrets/discord-store.ts +4 -13
- package/src/secrets/index.ts +1 -1
- package/src/secrets/instagram-store.ts +4 -13
- package/src/secrets/kakao-store.ts +4 -13
- package/src/secrets/line-store.ts +4 -13
- package/src/secrets/schema.ts +13 -0
- package/src/secrets/secrets-provider.ts +86 -0
- package/src/secrets/slack-store.ts +4 -13
- package/src/secrets/storage.ts +108 -1
- package/src/secrets/webex-store.ts +4 -13
- package/src/server/index.ts +2 -2
- package/src/skills/typeclaw-channel-github/SKILL.md +2 -2
- package/src/skills/typeclaw-channel-instagram/SKILL.md +1 -1
- package/src/skills/typeclaw-config/SKILL.md +5 -3
- package/src/skills/typeclaw-plugins/SKILL.md +1 -1
- package/src/skills/typeclaw-troubleshooting/SKILL.md +1 -1
- package/src/stream/broker.ts +4 -3
- package/src/stream/types.ts +1 -0
- package/typeclaw.schema.json +14 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { KakaoAccountCredentials, KakaoConfig } from 'agent-messenger/kakaotalk'
|
|
2
2
|
import type { PendingLoginState } from 'agent-messenger/kakaotalk'
|
|
3
3
|
|
|
4
|
-
import { sendHttp } from '@/hostd/client'
|
|
5
|
-
|
|
6
4
|
import { type KakaoChannelBlock, type KakaoEncryptedPassword, kakaoChannelBlockSchema } from './schema'
|
|
5
|
+
import type { RuntimeSecretsProvider } from './secrets-provider'
|
|
7
6
|
import { SecretsBackend } from './storage'
|
|
8
7
|
|
|
9
8
|
// Account shape accepted by setAccount(). Extends the upstream
|
|
@@ -18,7 +17,7 @@ export type SetKakaoAccountInput = KakaoAccountCredentials & {
|
|
|
18
17
|
|
|
19
18
|
export type SecretsKakaoCredentialStoreOptions =
|
|
20
19
|
| { mode: 'host'; secretsPath: string }
|
|
21
|
-
| { mode: 'container'; secretsPath: string;
|
|
20
|
+
| { mode: 'container'; secretsPath: string; hostProvider: RuntimeSecretsProvider }
|
|
22
21
|
|
|
23
22
|
const EMPTY_BLOCK: KakaoChannelBlock = { currentAccount: null, accounts: {} }
|
|
24
23
|
|
|
@@ -102,7 +101,7 @@ export class SecretsKakaoCredentialStore {
|
|
|
102
101
|
|
|
103
102
|
private readBlock(): KakaoChannelBlock {
|
|
104
103
|
const channels =
|
|
105
|
-
this.options.mode === 'container' ? this.
|
|
104
|
+
this.options.mode === 'container' ? this.options.hostProvider.readChannels() : this.backend.readChannelsSync()
|
|
106
105
|
const raw = channels?.kakaotalk
|
|
107
106
|
return parseBlock(raw)
|
|
108
107
|
}
|
|
@@ -111,15 +110,7 @@ export class SecretsKakaoCredentialStore {
|
|
|
111
110
|
return this.enqueueWrite(async () => {
|
|
112
111
|
if (this.options.mode === 'container') {
|
|
113
112
|
const next = update(this.readBlock())
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
kind: 'secrets-patch',
|
|
117
|
-
containerName: this.options.containerName,
|
|
118
|
-
patch: { channels: { kakaotalk: next } },
|
|
119
|
-
},
|
|
120
|
-
{ url: this.options.hostdUrl, token: this.options.restartToken },
|
|
121
|
-
)
|
|
122
|
-
if (!response.ok) throw new Error(`secrets-patch failed: ${response.reason}`)
|
|
113
|
+
await this.options.hostProvider.writeBackChannelBlock({ kakaotalk: next })
|
|
123
114
|
return
|
|
124
115
|
}
|
|
125
116
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { LineAccountCredentials, LineConfig } from 'agent-messenger/line'
|
|
2
2
|
|
|
3
|
-
import { sendHttp } from '@/hostd/client'
|
|
4
|
-
|
|
5
3
|
import { type LineChannelBlock, lineChannelBlockSchema } from './schema'
|
|
4
|
+
import type { RuntimeSecretsProvider } from './secrets-provider'
|
|
6
5
|
import { SecretsBackend } from './storage'
|
|
7
6
|
|
|
8
7
|
export type SecretsLineCredentialStoreOptions =
|
|
9
8
|
| { mode: 'host'; secretsPath: string }
|
|
10
|
-
| { mode: 'container'; secretsPath: string;
|
|
9
|
+
| { mode: 'container'; secretsPath: string; hostProvider: RuntimeSecretsProvider }
|
|
11
10
|
|
|
12
11
|
const EMPTY_BLOCK: LineChannelBlock = { currentAccount: null, accounts: {} }
|
|
13
12
|
|
|
@@ -64,7 +63,7 @@ export class SecretsLineCredentialStore {
|
|
|
64
63
|
|
|
65
64
|
private readBlock(): LineChannelBlock {
|
|
66
65
|
const channels =
|
|
67
|
-
this.options.mode === 'container' ? this.
|
|
66
|
+
this.options.mode === 'container' ? this.options.hostProvider.readChannels() : this.backend.readChannelsSync()
|
|
68
67
|
return parseBlock(channels?.line)
|
|
69
68
|
}
|
|
70
69
|
|
|
@@ -72,15 +71,7 @@ export class SecretsLineCredentialStore {
|
|
|
72
71
|
return this.enqueueWrite(async () => {
|
|
73
72
|
if (this.options.mode === 'container') {
|
|
74
73
|
const next = update(this.readBlock())
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
kind: 'secrets-patch',
|
|
78
|
-
containerName: this.options.containerName,
|
|
79
|
-
patch: { channels: { line: next } },
|
|
80
|
-
},
|
|
81
|
-
{ url: this.options.hostdUrl, token: this.options.restartToken },
|
|
82
|
-
)
|
|
83
|
-
if (!response.ok) throw new Error(`secrets-patch failed: ${response.reason}`)
|
|
74
|
+
await this.options.hostProvider.writeBackChannelBlock({ line: next })
|
|
84
75
|
return
|
|
85
76
|
}
|
|
86
77
|
|
package/src/secrets/schema.ts
CHANGED
|
@@ -22,6 +22,16 @@ export const providerCredentialSchema = z.discriminatedUnion('type', [apiKeyProv
|
|
|
22
22
|
|
|
23
23
|
export const providersSchema = z.record(z.string(), providerCredentialSchema)
|
|
24
24
|
|
|
25
|
+
export const mcpCredentialSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
client: z.unknown().optional(),
|
|
28
|
+
tokens: z.unknown().optional(),
|
|
29
|
+
discovery: z.unknown().optional(),
|
|
30
|
+
})
|
|
31
|
+
.catchall(z.unknown())
|
|
32
|
+
|
|
33
|
+
export const mcpSliceSchema = z.record(z.string(), mcpCredentialSchema)
|
|
34
|
+
|
|
25
35
|
// Per-adapter channel slots use named fields (`botToken`, `appToken`, `token`)
|
|
26
36
|
// instead of env-var-name keys. The Secret union per field carries the env-var
|
|
27
37
|
// override. Unknown adapter ids pass through via catchall so a future
|
|
@@ -224,10 +234,13 @@ export const secretsFileSchema = z.object({
|
|
|
224
234
|
version: z.literal(SECRETS_FILE_VERSION),
|
|
225
235
|
providers: providersSchema.default({}),
|
|
226
236
|
channels: channelsSchema.default({}),
|
|
237
|
+
mcp: mcpSliceSchema.default({}),
|
|
227
238
|
})
|
|
228
239
|
|
|
229
240
|
export type ProviderCredential = z.infer<typeof providerCredentialSchema>
|
|
230
241
|
export type Providers = z.infer<typeof providersSchema>
|
|
242
|
+
export type McpCredential = z.infer<typeof mcpCredentialSchema>
|
|
243
|
+
export type McpSlice = z.infer<typeof mcpSliceSchema>
|
|
231
244
|
export type Channels = z.infer<typeof channelsSchema>
|
|
232
245
|
export type GithubPatAuthBlock = z.infer<typeof githubPatAuthSchema>
|
|
233
246
|
export type GithubAppAuthBlock = z.infer<typeof githubAppAuthSchema>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { sendHttp } from '@/hostd/client'
|
|
2
|
+
import type { SecretsPatchChannels } from '@/hostd/protocol'
|
|
3
|
+
|
|
4
|
+
import type { Channels } from './schema'
|
|
5
|
+
import { SecretsBackend } from './storage'
|
|
6
|
+
|
|
7
|
+
// The channel-block payload a container-mode store hands off to be persisted.
|
|
8
|
+
// Identical to the `secrets-patch` RPC's `patch.channels` union so the hostd
|
|
9
|
+
// implementation forwards it verbatim — the on-the-wire contract is unchanged
|
|
10
|
+
// by this abstraction.
|
|
11
|
+
export type ChannelBlockPatch = SecretsPatchChannels
|
|
12
|
+
|
|
13
|
+
// The container-stage secrets seam. Named for what the runtime NEEDS, not the
|
|
14
|
+
// transport that serves it. Two halves:
|
|
15
|
+
// read — the whole channels slice (callers extract their own adapter block).
|
|
16
|
+
// Returns null when secrets.json is absent, so callers degrade rather
|
|
17
|
+
// than crash. File-based today (a mounted secrets.json); a managed
|
|
18
|
+
// impl (volume / secret store) slots in behind the same method.
|
|
19
|
+
// write — persist one adapter's block. The container cannot write the
|
|
20
|
+
// host-owned file directly under hostd, so this may cross a transport
|
|
21
|
+
// (secrets-patch RPC); under a volume it's a direct file write.
|
|
22
|
+
export interface RuntimeSecretsProvider {
|
|
23
|
+
readChannels(): Channels | null
|
|
24
|
+
writeBackChannelBlock(channels: ChannelBlockPatch): Promise<void>
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type HostdSecretsProviderOptions = {
|
|
28
|
+
hostdUrl: string
|
|
29
|
+
restartToken: string
|
|
30
|
+
containerName: string
|
|
31
|
+
// The mounted secrets.json the container READS from. Writes go through hostd
|
|
32
|
+
// (secrets-patch RPC) to avoid concurrent-writer corruption; reads are the
|
|
33
|
+
// live bind-mounted file, so this path is needed here.
|
|
34
|
+
secretsPath: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// The container-under-hostd provider: reads the mounted secrets.json directly,
|
|
38
|
+
// writes back via a `secrets-patch` RPC over HTTP to hostd (host.docker.internal),
|
|
39
|
+
// Bearer-authed by the per-container restart token.
|
|
40
|
+
export function createHostdSecretsProvider(options: HostdSecretsProviderOptions): RuntimeSecretsProvider {
|
|
41
|
+
const backend = new SecretsBackend(options.secretsPath)
|
|
42
|
+
return {
|
|
43
|
+
readChannels(): Channels | null {
|
|
44
|
+
return backend.tryReadChannelsSync()
|
|
45
|
+
},
|
|
46
|
+
async writeBackChannelBlock(channels: ChannelBlockPatch): Promise<void> {
|
|
47
|
+
const response = await sendHttp(
|
|
48
|
+
{ kind: 'secrets-patch', containerName: options.containerName, patch: { channels } },
|
|
49
|
+
{ url: options.hostdUrl, token: options.restartToken },
|
|
50
|
+
)
|
|
51
|
+
if (!response.ok) throw new Error(`secrets-patch failed: ${response.reason}`)
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// The file-backed provider: both halves hit the secrets.json on disk directly.
|
|
57
|
+
// Used where the runtime owns the file (a mounted volume in a future managed
|
|
58
|
+
// profile, or host-stage). No transport — writes merge the block into the file
|
|
59
|
+
// under the same lock the reads use.
|
|
60
|
+
export function createFileSecretsProvider(secretsPath: string): RuntimeSecretsProvider {
|
|
61
|
+
const backend = new SecretsBackend(secretsPath)
|
|
62
|
+
return {
|
|
63
|
+
readChannels(): Channels | null {
|
|
64
|
+
return backend.tryReadChannelsSync()
|
|
65
|
+
},
|
|
66
|
+
async writeBackChannelBlock(patch: ChannelBlockPatch): Promise<void> {
|
|
67
|
+
await backend.updateChannelsAsync(async (channels) => ({ result: undefined, next: { ...channels, ...patch } }))
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Resolves the container-stage secrets provider from the environment. Returns
|
|
73
|
+
// null when the hostd triple is absent (daemon unreachable at launch, or a
|
|
74
|
+
// managed profile with no write-back wired yet) — callers degrade gracefully
|
|
75
|
+
// rather than crash. Today only the hostd-backed provider exists; a managed
|
|
76
|
+
// impl (volume / secret store) is selected here when it lands.
|
|
77
|
+
export function resolveRuntimeSecretsProvider(
|
|
78
|
+
env: NodeJS.ProcessEnv,
|
|
79
|
+
secretsPath: string,
|
|
80
|
+
): RuntimeSecretsProvider | null {
|
|
81
|
+
const hostdUrl = env.TYPECLAW_HOSTD_URL
|
|
82
|
+
const restartToken = env.TYPECLAW_HOSTD_TOKEN
|
|
83
|
+
const containerName = env.TYPECLAW_CONTAINER_NAME
|
|
84
|
+
if (!hostdUrl || !restartToken || !containerName) return null
|
|
85
|
+
return createHostdSecretsProvider({ hostdUrl, restartToken, containerName, secretsPath })
|
|
86
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { sendHttp } from '@/hostd/client'
|
|
2
|
-
|
|
3
1
|
import { type SlackAccountRecord, type SlackChannelBlock, slackChannelBlockSchema } from './schema'
|
|
2
|
+
import type { RuntimeSecretsProvider } from './secrets-provider'
|
|
4
3
|
import { SecretsBackend } from './storage'
|
|
5
4
|
|
|
6
5
|
export type SetSlackAccountInput = SlackAccountRecord
|
|
7
6
|
|
|
8
7
|
export type SecretsSlackCredentialStoreOptions =
|
|
9
8
|
| { mode: 'host'; secretsPath: string }
|
|
10
|
-
| { mode: 'container'; secretsPath: string;
|
|
9
|
+
| { mode: 'container'; secretsPath: string; hostProvider: RuntimeSecretsProvider }
|
|
11
10
|
|
|
12
11
|
const EMPTY_BLOCK: SlackChannelBlock = { currentAccount: null, accounts: {} }
|
|
13
12
|
|
|
@@ -56,7 +55,7 @@ export class SecretsSlackCredentialStore {
|
|
|
56
55
|
|
|
57
56
|
private readBlock(): SlackChannelBlock {
|
|
58
57
|
const channels =
|
|
59
|
-
this.options.mode === 'container' ? this.
|
|
58
|
+
this.options.mode === 'container' ? this.options.hostProvider.readChannels() : this.backend.readChannelsSync()
|
|
60
59
|
return parseBlock(channels?.slack)
|
|
61
60
|
}
|
|
62
61
|
|
|
@@ -64,15 +63,7 @@ export class SecretsSlackCredentialStore {
|
|
|
64
63
|
return this.enqueueWrite(async () => {
|
|
65
64
|
if (this.options.mode === 'container') {
|
|
66
65
|
const next = update(this.readBlock())
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
kind: 'secrets-patch',
|
|
70
|
-
containerName: this.options.containerName,
|
|
71
|
-
patch: { channels: { slack: next } },
|
|
72
|
-
},
|
|
73
|
-
{ url: this.options.hostdUrl, token: this.options.restartToken },
|
|
74
|
-
)
|
|
75
|
-
if (!response.ok) throw new Error(`secrets-patch failed: ${response.reason}`)
|
|
66
|
+
await this.options.hostProvider.writeBackChannelBlock({ slack: next })
|
|
76
67
|
return
|
|
77
68
|
}
|
|
78
69
|
|
package/src/secrets/storage.ts
CHANGED
|
@@ -13,6 +13,8 @@ import { registerXaiOAuthProvider } from './oauth-xai'
|
|
|
13
13
|
import { resolveSecret, type Secret } from './resolve'
|
|
14
14
|
import {
|
|
15
15
|
type Channels,
|
|
16
|
+
type McpCredential,
|
|
17
|
+
type McpSlice,
|
|
16
18
|
type ProviderCredential,
|
|
17
19
|
type Providers,
|
|
18
20
|
type SecretsFile,
|
|
@@ -191,6 +193,111 @@ export class SecretsBackend implements AuthStorageBackend {
|
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
195
|
|
|
196
|
+
tryReadMcpSync(): McpSlice {
|
|
197
|
+
if (!existsSync(this.secretsPath)) return {}
|
|
198
|
+
let release: (() => void) | undefined
|
|
199
|
+
try {
|
|
200
|
+
release = this.acquireSyncLockWithRetry()
|
|
201
|
+
return { ...this.readEnvelope().mcp }
|
|
202
|
+
} finally {
|
|
203
|
+
release?.()
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
readMcpCredentialSync(serverName: string): McpCredential | undefined {
|
|
208
|
+
if (!existsSync(this.secretsPath)) return undefined
|
|
209
|
+
let release: (() => void) | undefined
|
|
210
|
+
try {
|
|
211
|
+
release = this.acquireSyncLockWithRetry()
|
|
212
|
+
return this.readEnvelope().mcp[serverName]
|
|
213
|
+
} finally {
|
|
214
|
+
release?.()
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
writeMcpCredentialSync(serverName: string, credential: McpCredential): void {
|
|
219
|
+
this.ensureParentDir()
|
|
220
|
+
this.ensureFileExists()
|
|
221
|
+
let release: (() => void) | undefined
|
|
222
|
+
try {
|
|
223
|
+
release = this.acquireSyncLockWithRetry()
|
|
224
|
+
const envelope = this.readEnvelope()
|
|
225
|
+
const next: SecretsFile = {
|
|
226
|
+
...envelope,
|
|
227
|
+
$schema: envelope.$schema ?? SCHEMA_REL,
|
|
228
|
+
version: SECRETS_FILE_VERSION,
|
|
229
|
+
mcp: { ...envelope.mcp, [serverName]: credential },
|
|
230
|
+
}
|
|
231
|
+
this.writeEnvelopeAtomic(next)
|
|
232
|
+
} finally {
|
|
233
|
+
release?.()
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async updateMcpAsync<T>(fn: (current: McpSlice) => Promise<{ result: T; next?: McpSlice }>): Promise<T> {
|
|
238
|
+
this.ensureParentDir()
|
|
239
|
+
this.ensureFileExists()
|
|
240
|
+
let release: (() => Promise<void>) | undefined
|
|
241
|
+
let lockCompromised = false
|
|
242
|
+
let lockCompromisedError: Error | undefined
|
|
243
|
+
const throwIfCompromised = (): void => {
|
|
244
|
+
if (lockCompromised) {
|
|
245
|
+
throw lockCompromisedError ?? new Error('Secrets store lock was compromised')
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
try {
|
|
249
|
+
release = await lockfile.lock(this.secretsPath, {
|
|
250
|
+
...ASYNC_LOCK_OPTIONS,
|
|
251
|
+
onCompromised: (err: Error) => {
|
|
252
|
+
lockCompromised = true
|
|
253
|
+
lockCompromisedError = err
|
|
254
|
+
},
|
|
255
|
+
})
|
|
256
|
+
throwIfCompromised()
|
|
257
|
+
const envelope = this.readEnvelope()
|
|
258
|
+
const { result, next } = await fn(envelope.mcp)
|
|
259
|
+
throwIfCompromised()
|
|
260
|
+
if (next !== undefined) {
|
|
261
|
+
const merged: SecretsFile = {
|
|
262
|
+
...envelope,
|
|
263
|
+
$schema: envelope.$schema ?? SCHEMA_REL,
|
|
264
|
+
version: SECRETS_FILE_VERSION,
|
|
265
|
+
mcp: next,
|
|
266
|
+
}
|
|
267
|
+
this.writeEnvelopeAtomic(merged)
|
|
268
|
+
}
|
|
269
|
+
throwIfCompromised()
|
|
270
|
+
return result
|
|
271
|
+
} finally {
|
|
272
|
+
if (release) {
|
|
273
|
+
try {
|
|
274
|
+
await release()
|
|
275
|
+
} catch {}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
removeMcpCredentialSync(serverName: string): boolean {
|
|
281
|
+
if (!existsSync(this.secretsPath)) return false
|
|
282
|
+
let release: (() => void) | undefined
|
|
283
|
+
try {
|
|
284
|
+
release = this.acquireSyncLockWithRetry()
|
|
285
|
+
const envelope = this.readEnvelope()
|
|
286
|
+
if (!(serverName in envelope.mcp)) return false
|
|
287
|
+
const { [serverName]: _removed, ...rest } = envelope.mcp
|
|
288
|
+
const next: SecretsFile = {
|
|
289
|
+
...envelope,
|
|
290
|
+
$schema: envelope.$schema ?? SCHEMA_REL,
|
|
291
|
+
version: SECRETS_FILE_VERSION,
|
|
292
|
+
mcp: rest,
|
|
293
|
+
}
|
|
294
|
+
this.writeEnvelopeAtomic(next)
|
|
295
|
+
return true
|
|
296
|
+
} finally {
|
|
297
|
+
release?.()
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
194
301
|
// Atomic provider credential write. Idempotent at the type level: callers
|
|
195
302
|
// pass the full `ProviderCredential` (api_key or oauth), and the entry is
|
|
196
303
|
// merged into `providers.<id>` verbatim — same shape the schema accepts on
|
|
@@ -407,7 +514,7 @@ export function createSecretsStoreForAgent(secretsPath: string): AuthStorage {
|
|
|
407
514
|
}
|
|
408
515
|
|
|
409
516
|
function newEmptyEnvelope(): SecretsFile {
|
|
410
|
-
return { $schema: SCHEMA_REL, version: SECRETS_FILE_VERSION, providers: {}, channels: {} }
|
|
517
|
+
return { $schema: SCHEMA_REL, version: SECRETS_FILE_VERSION, providers: {}, channels: {}, mcp: {} }
|
|
411
518
|
}
|
|
412
519
|
|
|
413
520
|
function stringifyEnvelope(envelope: SecretsFile): string {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { sendHttp } from '@/hostd/client'
|
|
2
|
-
|
|
3
1
|
import { type WebexAccountRecord, type WebexChannelBlock, webexChannelBlockSchema } from './schema'
|
|
2
|
+
import type { RuntimeSecretsProvider } from './secrets-provider'
|
|
4
3
|
import { SecretsBackend } from './storage'
|
|
5
4
|
|
|
6
5
|
export type SetWebexAccountInput = WebexAccountRecord
|
|
7
6
|
|
|
8
7
|
export type SecretsWebexCredentialStoreOptions =
|
|
9
8
|
| { mode: 'host'; secretsPath: string }
|
|
10
|
-
| { mode: 'container'; secretsPath: string;
|
|
9
|
+
| { mode: 'container'; secretsPath: string; hostProvider: RuntimeSecretsProvider }
|
|
11
10
|
|
|
12
11
|
const EMPTY_BLOCK: WebexChannelBlock = { currentAccount: null, accounts: {} }
|
|
13
12
|
|
|
@@ -61,7 +60,7 @@ export class SecretsWebexCredentialStore {
|
|
|
61
60
|
|
|
62
61
|
private readBlock(): WebexChannelBlock {
|
|
63
62
|
const channels =
|
|
64
|
-
this.options.mode === 'container' ? this.
|
|
63
|
+
this.options.mode === 'container' ? this.options.hostProvider.readChannels() : this.backend.readChannelsSync()
|
|
65
64
|
return parseBlock(channels?.webex)
|
|
66
65
|
}
|
|
67
66
|
|
|
@@ -69,15 +68,7 @@ export class SecretsWebexCredentialStore {
|
|
|
69
68
|
return this.enqueueWrite(async () => {
|
|
70
69
|
if (this.options.mode === 'container') {
|
|
71
70
|
const next = update(this.readBlock())
|
|
72
|
-
|
|
73
|
-
{
|
|
74
|
-
kind: 'secrets-patch',
|
|
75
|
-
containerName: this.options.containerName,
|
|
76
|
-
patch: { channels: { webex: next } },
|
|
77
|
-
},
|
|
78
|
-
{ url: this.options.hostdUrl, token: this.options.restartToken },
|
|
79
|
-
)
|
|
80
|
-
if (!response.ok) throw new Error(`secrets-patch failed: ${response.reason}`)
|
|
71
|
+
await this.options.hostProvider.writeBackChannelBlock({ webex: next })
|
|
81
72
|
return
|
|
82
73
|
}
|
|
83
74
|
|
package/src/server/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { LiveSubagentRegistry } from '@/agent/live-subagents'
|
|
|
15
15
|
import { resolveFallbackChain } from '@/agent/model-fallback'
|
|
16
16
|
import { applyModelRuntimeOverrides } from '@/agent/model-overrides'
|
|
17
17
|
import { forgetSharedLoopGuardTool } from '@/agent/plugin-tools'
|
|
18
|
-
import { detectProviderError,
|
|
18
|
+
import { detectProviderError, isFailoverWorthy } from '@/agent/provider-error'
|
|
19
19
|
import { requestContainerRestart } from '@/agent/restart'
|
|
20
20
|
import { consumeRestartHandoff, type RestartHandoff } from '@/agent/restart-handoff'
|
|
21
21
|
import { sessionMetaPayload } from '@/agent/session-meta'
|
|
@@ -1130,7 +1130,7 @@ async function drain(
|
|
|
1130
1130
|
currentModelRef: state.activeModelRef,
|
|
1131
1131
|
session: state.session,
|
|
1132
1132
|
text: turnText,
|
|
1133
|
-
shouldFailover: (err) =>
|
|
1133
|
+
shouldFailover: (err) => isFailoverWorthy(err.message),
|
|
1134
1134
|
setModelForRef: async (ref) => {
|
|
1135
1135
|
await state.session.setModel(applyModelRuntimeOverrides(resolveModel(ref), ref))
|
|
1136
1136
|
state.activeModelRef = ref
|
|
@@ -132,11 +132,11 @@ The `reviewer` subagent is the analyst; you are the integration layer between it
|
|
|
132
132
|
- **Filter to _decision_ states, not the latest review row.** GitHub's sticky block is cleared only by a later `APPROVED` (or a dismissal) from the same reviewer — a later `COMMENTED` review does **not** clear it. So a history of `CHANGES_REQUESTED` → `COMMENTED` is _still blocked_, even though the latest row is `COMMENTED`. Selecting `last` over the raw review list would misread that as "not a re-review". Filtering to `{CHANGES_REQUESTED, APPROVED}` first, then taking `last`, asks the right question: "what is my latest _blocking decision_, ignoring non-deciding comments?" (Dismissed reviews surface as `state: "DISMISSED"`, so they're correctly excluded from the decision set too.)
|
|
133
133
|
- **`--paginate --slurp` is mandatory.** GitHub returns reviews 30 per page; a bot on a long-lived PR can have its blocking `CHANGES_REQUESTED` past the first page. Without paginating, that review is invisible and a genuine re-review silently falls back to the plain-comment path. `--slurp` collects every page into one array of arrays; the `add` concatenates them before filtering.
|
|
134
134
|
|
|
135
|
-
2. **Spawn the `reviewer` subagent with the PR target.**
|
|
135
|
+
2. **Spawn the `reviewer` subagent with the PR target.** The reviewer runs on the deep profile, so it always runs in the background — you stay responsive while it works. Pass the PR URL (or `owner/repo#N`) plus any context the requester gave you (focus areas, specific files, etc.). The reviewer fetches the diff itself (`gh pr diff`, `gh api /repos/.../pulls/<n>`), loads the `code-review` skill, and returns a `<review>` block whose code findings carry `location="path:line"`.
|
|
136
136
|
|
|
137
137
|
**If step 1 found an unresolved blocking obligation — a formal `CHANGES_REQUESTED` _or_ an unretracted flat-comment blocker — say so in the spawn payload** — e.g. _"This is a re-review: you previously blocked this PR (the prior blockers were …; the block was a formal `CHANGES_REQUESTED` / a flat PR comment). Verify they are resolved and return `approve` or `request-changes` — a re-review must re-decide the blocking state, not return `comment`."_ The reviewer's `code-review` skill enforces the same rule, but telling it the prior blockers (and which form they took) is what lets it apply that rule; a fresh reviewer session has no memory of your earlier block. The flat-comment case especially must be passed through — the reviewer cannot recover it from review state, so omitting it would silently drop the re-review context the moment the flow starts.
|
|
138
138
|
|
|
139
|
-
Do **not** post an "on it" acknowledgement comment before spawning the reviewer — the runtime already adds an :eyes: reaction to the PR the moment it engages, so a "looking into this" comment is redundant noise. Just spawn the reviewer
|
|
139
|
+
Do **not** post an "on it" acknowledgement comment before spawning the reviewer — the runtime already adds an :eyes: reaction to the PR the moment it engages, so a "looking into this" comment is redundant noise. Just spawn the reviewer (it runs in the background); the formal review is your reply. If you want to acknowledge explicitly, use `channel_react({ emoji: "eyes" })`, which reacts without posting a comment.
|
|
140
140
|
|
|
141
141
|
After spawning, **end your turn** — the background reviewer wakes you with a completion `<system-reminder>` (step 3). "Stay responsive" means you remain free to handle _other_ chats meanwhile; it does **not** license you to keep working _this_ PR. Do not poll `subagent_output` in a busy-wait, and do not fill the wait by reviewing the diff yourself (see the exclusivity rule at the top of this flow). The next thing you do on this PR is read the reviewer's `<review>` block when the reminder arrives.
|
|
142
142
|
|
|
@@ -27,4 +27,4 @@ Engagement: every DM message engages. Groups are alias-only because the SDK summ
|
|
|
27
27
|
|
|
28
28
|
Realtime vs polling transport is automatic and invisible to you: TypeClaw uses the hybrid listener when available and falls back to polling on older SDKs.
|
|
29
29
|
|
|
30
|
-
2FA
|
|
30
|
+
2FA and checkpoint-protected Instagram accounts are supported: the operator completes the verification code interactively at `typeclaw channel add instagram` (or `reauth`) time. Nothing about this is visible to you at runtime.
|
|
@@ -21,6 +21,7 @@ The runtime reads `typeclaw.json` at container startup. Some fields are picked u
|
|
|
21
21
|
- `plugins` — array of plugin module specifiers loaded at server boot: npm package names for published plugins, or relative paths for local plugins you are authoring. **Restart-required.**
|
|
22
22
|
- `alias` — additional names the agent answers to when a channel message contains its name in plain text (no `<@id>` mention). The agent folder's directory name (`basename(agentDir)`) is always implicit; `alias` adds further forms (Latin transliteration, nicknames, Korean particles, etc.). Used by the channel engagement layer alongside the structural mention/reply/dm triggers. **Live-reloadable.**
|
|
23
23
|
- `channels` — per-adapter engagement triggers and history-prefetch knobs for external messengers (Discord, Slack, Telegram, LINE, KakaoTalk), plus the GitHub channel (a webhook-driven adapter that watches repos and reviews PRs — see **GitHub channel** below). Access control lives in `roles`, not here. **Live-reloadable** — edits take effect on the next `reload` without a container restart.
|
|
24
|
+
- `branding` — whether your system prompt discloses that you run on TypeClaw. Default `true`: the prompt says you run "inside TypeClaw" and stamps a `## Runtime` TypeClaw-version block. Set `false` and both are stripped — the prompt opens generically and the runtime-version block is omitted (also on the subagent prompt path). Read fresh per session, so it applies on the next `reload`. The `typeclaw.json` filename and the `typeclaw-render-pdf` / `typeclaw-troubleshooting` skill names stay regardless — they are tokens you need to operate, not disclosure. **Live-reloadable.**
|
|
24
25
|
- `docker.file` — controls what ships in the autogenerated container image. Two layers: (1) **toggles** for opinionated package installs — `tmux`, `gh`, `python`, `xvfb` default on (`true`); `cjkFonts` defaults to `"auto"` (resolved from host locale at start); `ffmpeg`, `cloudflared`, `claudeCode`, `codexCli` default off (`false`) — set a toggle to `false` to omit, or to a version string like `"2.40.0"` to apt-pin (`python`, `cjkFonts`, `cloudflared`, `xvfb`, `claudeCode`, and `codexCli` are boolean-only). Most toggles install apt packages with BuildKit cache mounts; `cloudflared`, `claudeCode`, and `codexCli` are exceptions — `cloudflared` downloads the pinned GitHub release, `claudeCode` runs Anthropic's official `curl | bash` installer, `codexCli` `bun install`s the `@openai/codex` npm package. (2) **`append`** — extra Dockerfile lines spliced in right before `ENTRYPOINT` for anything the toggles don't cover. The whole Dockerfile is rewritten on every `start` from the typeclaw template. Lives under the `docker` namespace alongside future Docker-related blocks (e.g. `docker.compose`). **Restart-required** (next `typeclaw start` rebuilds the image).
|
|
25
26
|
- `git.ignore.append` — extra `.gitignore` patterns `typeclaw start` splices into the TypeClaw-owned `.gitignore` before the protected TypeClaw rules. The whole `.gitignore` is rewritten and auto-committed on every `start` when it changes; `append` is the supported escape hatch for local ignore patterns without editing the managed file by hand. Lives under the `git` namespace. **Restart-required** (next `typeclaw start` refreshes and commits `.gitignore`).
|
|
26
27
|
- `portForward` — allow/deny policy for the auto port-forwarder (the host-stage `_hostd` daemon's portbroker). When the agent runs a server inside the container that LISTENs on a TCP port, the broker proxies it to the same port number on `127.0.0.1` of the host so the user can hit it directly. `portForward` decides which ports are allowed through. **Restart-required** — the broker captures the policy at register time on `typeclaw start`.
|
|
@@ -29,7 +30,7 @@ The runtime reads `typeclaw.json` at container startup. Some fields are picked u
|
|
|
29
30
|
|
|
30
31
|
There is no file watcher, but there is a `reload` mechanism. When `typeclaw.json` changes:
|
|
31
32
|
|
|
32
|
-
- **Live-reloadable fields** (`models` — including per-profile `thinkingLevel`, `alias`, `channels`) take effect on the next `reload` — no container restart.
|
|
33
|
+
- **Live-reloadable fields** (`models` — including per-profile `thinkingLevel`, `alias`, `channels`, `branding`) take effect on the next `reload` — no container restart.
|
|
33
34
|
- **Restart-required fields** (`port`, `mounts`, `plugins`, `portForward`, `docker.file`, `git.ignore`) are reported as "reload landed but change won't apply until restart". The diff returns success; the runtime still has the old value in memory. Tell the user explicitly which one they're hitting. `docker.file` additionally requires an image rebuild — that happens automatically on the next `typeclaw start`, no extra flag needed. `git.ignore` refreshes the managed `.gitignore` and auto-commits it on the next `typeclaw start` if content changed.
|
|
34
35
|
- **`$schema`** changes are ignored.
|
|
35
36
|
|
|
@@ -54,6 +55,7 @@ You yourself cannot run `typeclaw restart` — that is a host-stage command and
|
|
|
54
55
|
| `portForward` | no | object | Allow/deny policy for the host-stage portbroker that auto-forwards container LISTEN ports to `127.0.0.1` on the host. Defaults to `{ "allow": "*" }` (forward everything). Omitted from scaffolded `typeclaw.json`. **Restart-required.** See **portForward** section below. |
|
|
55
56
|
| `docker` | no | object | Namespace for Docker-related blocks. Today the only child is `docker.file` — toggles (`tmux`, `gh`, `python`, `ffmpeg`, `cjkFonts`, `cloudflared`, `xvfb`, `claudeCode`, `codexCli`) gate opinionated package installs; `append` adds custom Dockerfile lines just before `ENTRYPOINT`. `docker.file` defaults to `{ ffmpeg: false, gh: true, python: true, tmux: true, cjkFonts: 'auto', cloudflared: false, xvfb: true, claudeCode: false, codexCli: false, append: [] }`. Omitted from scaffolded `typeclaw.json`. **Restart-required** (next `typeclaw start` rebuilds the image). See **Dockerfile** section below. |
|
|
56
57
|
| `git` | no | object | Namespace for git-related blocks. Today the only child is `git.ignore` — extra patterns spliced into the autogenerated `.gitignore` before TypeClaw's protected rules. `git.ignore` defaults to `{ "append": [] }`. Omitted from scaffolded `typeclaw.json`. **Restart-required** (next `typeclaw start` refreshes `.gitignore`). See **Gitignore** section below. |
|
|
58
|
+
| `branding` | no | boolean | Whether the system prompt discloses that you run on TypeClaw. Defaults to `true`. Set `false` to strip every TypeClaw clue from the prompt: the base prompt opens generically (no "inside TypeClaw") and the `## Runtime` version block is omitted, on both the main and subagent prompt paths. Read fresh per session. Functional identifiers (`typeclaw.json`, the `typeclaw-render-pdf` / `typeclaw-troubleshooting` skill names) are unaffected. **Live-reloadable.** |
|
|
57
59
|
|
|
58
60
|
> **Top-level keys not in this table are not "ignored unknowns" anymore** — they are reserved for **plugin config blocks**. The schema's `catchall(z.unknown())` preserves them, and the plugin loader hands each block to its owning plugin's `configSchema` for validation. The bundled memory plugin owns `memory` at the top level — see the `typeclaw-memory` skill for that block's semantics. Do not write a top-level key unless you know which plugin owns it.
|
|
59
61
|
|
|
@@ -438,7 +440,7 @@ Every secret-bearing field in `secrets.json` is a **`Secret`**: either a plain s
|
|
|
438
440
|
{
|
|
439
441
|
"version": 2,
|
|
440
442
|
"providers": {
|
|
441
|
-
"
|
|
443
|
+
"openai": { "type": "api_key", "key": "sk-xxx" },
|
|
442
444
|
"openai-codex": { "type": "oauth", "access_token": "...", "refresh_token": "...", "expires_at": 99 }
|
|
443
445
|
},
|
|
444
446
|
"channels": {
|
|
@@ -453,7 +455,7 @@ Every secret-bearing field in `secrets.json` is a **`Secret`**: either a plain s
|
|
|
453
455
|
**Resolution at boot, in order:**
|
|
454
456
|
|
|
455
457
|
1. `process.env[secret.env]` — explicit binding wins (the `env` field on the object form).
|
|
456
|
-
2. `process.env[<canonical env name>]` — canonical-env fallback (`SLACK_BOT_TOKEN`, `
|
|
458
|
+
2. `process.env[<canonical env name>]` — canonical-env fallback (`SLACK_BOT_TOKEN`, `OPENAI_API_KEY`, etc.).
|
|
457
459
|
3. `secret.value` — the on-disk value.
|
|
458
460
|
4. Otherwise the field is treated as missing.
|
|
459
461
|
|
|
@@ -738,7 +738,7 @@ Plugin `ToolContext` is `{ signal, sessionId, agentDir, logger }`. There is no `
|
|
|
738
738
|
- `session.turn.start` / `session.turn.end`: bracket every `session.prompt(text)` call across all four prompt-driver sites — `src/server/index.ts` (TUI drain + fallback), `src/channels/router.ts` (`fireSessionTurnStart`), `src/cron/consumer.ts` (per-attempt), `src/agent/subagents.ts` (subagent runner). `userPrompt` carries the literal text being passed to `session.prompt(text)`.
|
|
739
739
|
- `session.idle`: `src/server/index.ts` `drain()` — fires immediately after every `session.prompt()` resolves (success or error)
|
|
740
740
|
- `session.start`/`session.end`: `src/server/index.ts` ws open/close
|
|
741
|
-
- `tool.before`/`tool.after`: `src/agent/plugin-tools.ts` `wrapPluginTool`, `wrapSystemTool`,
|
|
741
|
+
- `tool.before`/`tool.after`: `src/agent/plugin-tools.ts` `wrapPluginTool`, `wrapSystemTool`, and `wrapBuiltinToolDefinition`. The last one is the load-bearing path for pi's builtin coding tools (`read`/`bash`/`edit`/`write`/`grep`/`find`/`ls`): as of pi-coding-agent 0.73, every builtin is a `ToolDefinition` (via pi's `create*ToolDefinition` factories) that TypeClaw wraps and ships through `customTools`, while `createAgentSession({ noTools: 'builtin', tools })` disables pi's unwrapped copies and narrows the active set to an explicit name allowlist. See the top-of-file contract block in `plugin-tools.ts` for the full reasoning.
|
|
742
742
|
- **Schema additions**: `src/config/config.ts` (`plugins` array, `.catchall(z.unknown())` for per-plugin blocks, `extractPluginConfigs`)
|
|
743
743
|
|
|
744
744
|
### Audit log on boot
|
|
@@ -28,7 +28,7 @@ Two failure patterns show up over and over when an agent debugs inline, and both
|
|
|
28
28
|
|
|
29
29
|
## The hand-off: spawn operator in background
|
|
30
30
|
|
|
31
|
-
Spawn `operator`
|
|
31
|
+
Spawn `operator` (background by default) so your session stays free, then keep talking to the user. Give operator everything it needs — it does **not** see this conversation, and it does **not** see this skill. Operator runs on a fixed tool set (`read`, `grep`, `find`, `ls`, `bash`, `write`, `edit`) with no skill loading, so any mechanic below that you want it to follow has to be spelled out in the `[REQUEST]` block — don't assume it knows the tmux/PID/polling patterns:
|
|
32
32
|
|
|
33
33
|
```
|
|
34
34
|
[CONTEXT]: <what you were doing, the file/process/command involved, the environment>
|
package/src/stream/broker.ts
CHANGED
|
@@ -22,12 +22,13 @@ const DEFAULT_HISTORY_SIZE = 1000
|
|
|
22
22
|
export function createStream(opts: CreateStreamOptions = {}): Stream {
|
|
23
23
|
const subscriptions = new Set<Subscription>()
|
|
24
24
|
const historySize = Math.max(0, opts.historySize ?? DEFAULT_HISTORY_SIZE)
|
|
25
|
+
const now = opts.now ?? Date.now
|
|
25
26
|
const history: StreamMessage[] = []
|
|
26
27
|
let counter = 0
|
|
27
28
|
|
|
28
29
|
function generateId(): StreamMessageId {
|
|
29
30
|
counter++
|
|
30
|
-
return `s_${
|
|
31
|
+
return `s_${now().toString(36)}_${counter.toString(36)}_${Math.random().toString(36).slice(2, 8)}`
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
function record(msg: StreamMessage): void {
|
|
@@ -51,7 +52,7 @@ export function createStream(opts: CreateStreamOptions = {}): Stream {
|
|
|
51
52
|
function publishMessage(input: StreamMessageInput): StreamMessage {
|
|
52
53
|
const msg: StreamMessage = {
|
|
53
54
|
id: generateId(),
|
|
54
|
-
ts:
|
|
55
|
+
ts: now(),
|
|
55
56
|
target: input.target,
|
|
56
57
|
payload: input.payload,
|
|
57
58
|
...(input.replyTo !== undefined ? { replyTo: input.replyTo } : {}),
|
|
@@ -73,7 +74,7 @@ export function createStream(opts: CreateStreamOptions = {}): Stream {
|
|
|
73
74
|
const requestId = generateId()
|
|
74
75
|
const requestMessage: StreamMessage = {
|
|
75
76
|
id: requestId,
|
|
76
|
-
ts:
|
|
77
|
+
ts: now(),
|
|
77
78
|
target: input.target,
|
|
78
79
|
payload: input.payload,
|
|
79
80
|
...(input.replyTo !== undefined ? { replyTo: input.replyTo } : {}),
|
package/src/stream/types.ts
CHANGED
package/typeclaw.schema.json
CHANGED
|
@@ -33,8 +33,10 @@
|
|
|
33
33
|
"openai-codex/gpt-5.5",
|
|
34
34
|
"anthropic/claude-haiku-4-5",
|
|
35
35
|
"anthropic/claude-sonnet-4-6",
|
|
36
|
+
"anthropic/claude-sonnet-5",
|
|
36
37
|
"anthropic/claude-opus-4-7",
|
|
37
38
|
"anthropic/claude-opus-4-8",
|
|
39
|
+
"anthropic/claude-fable-5",
|
|
38
40
|
"fireworks/accounts/fireworks/routers/kimi-k2p6-turbo",
|
|
39
41
|
"zai/glm-4.5-air",
|
|
40
42
|
"zai/glm-4.6",
|
|
@@ -83,8 +85,10 @@
|
|
|
83
85
|
"openai-codex/gpt-5.5",
|
|
84
86
|
"anthropic/claude-haiku-4-5",
|
|
85
87
|
"anthropic/claude-sonnet-4-6",
|
|
88
|
+
"anthropic/claude-sonnet-5",
|
|
86
89
|
"anthropic/claude-opus-4-7",
|
|
87
90
|
"anthropic/claude-opus-4-8",
|
|
91
|
+
"anthropic/claude-fable-5",
|
|
88
92
|
"fireworks/accounts/fireworks/routers/kimi-k2p6-turbo",
|
|
89
93
|
"zai/glm-4.5-air",
|
|
90
94
|
"zai/glm-4.6",
|
|
@@ -134,8 +138,10 @@
|
|
|
134
138
|
"openai-codex/gpt-5.5",
|
|
135
139
|
"anthropic/claude-haiku-4-5",
|
|
136
140
|
"anthropic/claude-sonnet-4-6",
|
|
141
|
+
"anthropic/claude-sonnet-5",
|
|
137
142
|
"anthropic/claude-opus-4-7",
|
|
138
143
|
"anthropic/claude-opus-4-8",
|
|
144
|
+
"anthropic/claude-fable-5",
|
|
139
145
|
"fireworks/accounts/fireworks/routers/kimi-k2p6-turbo",
|
|
140
146
|
"zai/glm-4.5-air",
|
|
141
147
|
"zai/glm-4.6",
|
|
@@ -183,8 +189,10 @@
|
|
|
183
189
|
"openai-codex/gpt-5.5",
|
|
184
190
|
"anthropic/claude-haiku-4-5",
|
|
185
191
|
"anthropic/claude-sonnet-4-6",
|
|
192
|
+
"anthropic/claude-sonnet-5",
|
|
186
193
|
"anthropic/claude-opus-4-7",
|
|
187
194
|
"anthropic/claude-opus-4-8",
|
|
195
|
+
"anthropic/claude-fable-5",
|
|
188
196
|
"fireworks/accounts/fireworks/routers/kimi-k2p6-turbo",
|
|
189
197
|
"zai/glm-4.5-air",
|
|
190
198
|
"zai/glm-4.6",
|
|
@@ -233,8 +241,10 @@
|
|
|
233
241
|
"openai-codex/gpt-5.5",
|
|
234
242
|
"anthropic/claude-haiku-4-5",
|
|
235
243
|
"anthropic/claude-sonnet-4-6",
|
|
244
|
+
"anthropic/claude-sonnet-5",
|
|
236
245
|
"anthropic/claude-opus-4-7",
|
|
237
246
|
"anthropic/claude-opus-4-8",
|
|
247
|
+
"anthropic/claude-fable-5",
|
|
238
248
|
"fireworks/accounts/fireworks/routers/kimi-k2p6-turbo",
|
|
239
249
|
"zai/glm-4.5-air",
|
|
240
250
|
"zai/glm-4.6",
|
|
@@ -2648,6 +2658,10 @@
|
|
|
2648
2658
|
]
|
|
2649
2659
|
}
|
|
2650
2660
|
},
|
|
2661
|
+
"branding": {
|
|
2662
|
+
"default": true,
|
|
2663
|
+
"type": "boolean"
|
|
2664
|
+
},
|
|
2651
2665
|
"tool-result-cap": {
|
|
2652
2666
|
"default": {
|
|
2653
2667
|
"enabled": true,
|