@soederpop/luca 0.0.31 → 0.0.34
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/README.md +241 -36
- package/bun.lock +24 -5
- package/commands/build-python-bridge.ts +43 -0
- package/docs/apis/clients/rest.md +7 -7
- package/docs/apis/clients/websocket.md +23 -10
- package/docs/apis/features/agi/assistant.md +155 -8
- package/docs/apis/features/agi/assistants-manager.md +90 -22
- package/docs/apis/features/agi/auto-assistant.md +377 -0
- package/docs/apis/features/agi/browser-use.md +802 -0
- package/docs/apis/features/agi/claude-code.md +6 -1
- package/docs/apis/features/agi/conversation-history.md +7 -6
- package/docs/apis/features/agi/conversation.md +111 -38
- package/docs/apis/features/agi/docs-reader.md +35 -57
- package/docs/apis/features/agi/file-tools.md +163 -0
- package/docs/apis/features/agi/openapi.md +2 -2
- package/docs/apis/features/agi/skills-library.md +227 -0
- package/docs/apis/features/node/content-db.md +125 -4
- package/docs/apis/features/node/disk-cache.md +11 -11
- package/docs/apis/features/node/downloader.md +1 -1
- package/docs/apis/features/node/file-manager.md +15 -15
- package/docs/apis/features/node/fs.md +78 -21
- package/docs/apis/features/node/git.md +50 -10
- package/docs/apis/features/node/google-calendar.md +3 -0
- package/docs/apis/features/node/google-docs.md +10 -1
- package/docs/apis/features/node/google-drive.md +3 -0
- package/docs/apis/features/node/google-mail.md +214 -0
- package/docs/apis/features/node/google-sheets.md +3 -0
- package/docs/apis/features/node/ink.md +10 -10
- package/docs/apis/features/node/ipc-socket.md +83 -93
- package/docs/apis/features/node/networking.md +5 -5
- package/docs/apis/features/node/os.md +7 -7
- package/docs/apis/features/node/package-finder.md +14 -14
- package/docs/apis/features/node/proc.md +2 -1
- package/docs/apis/features/node/process-manager.md +70 -3
- package/docs/apis/features/node/python.md +265 -9
- package/docs/apis/features/node/redis.md +380 -0
- package/docs/apis/features/node/ui.md +13 -13
- package/docs/apis/servers/express.md +35 -7
- package/docs/apis/servers/mcp.md +3 -3
- package/docs/apis/servers/websocket.md +51 -8
- package/docs/bootstrap/CLAUDE.md +1 -1
- package/docs/bootstrap/SKILL.md +93 -7
- package/docs/examples/feature-as-tool-provider.md +143 -0
- package/docs/examples/python.md +42 -1
- package/docs/introspection.md +15 -5
- package/docs/tutorials/00-bootstrap.md +3 -3
- package/docs/tutorials/02-container.md +2 -2
- package/docs/tutorials/10-creating-features.md +5 -0
- package/docs/tutorials/13-introspection.md +12 -2
- package/docs/tutorials/19-python-sessions.md +401 -0
- package/package.json +8 -4
- package/src/agi/container.server.ts +8 -0
- package/src/agi/features/assistant.ts +19 -0
- package/src/agi/features/autonomous-assistant.ts +435 -0
- package/src/agi/features/conversation.ts +58 -6
- package/src/agi/features/file-tools.ts +286 -0
- package/src/agi/features/luca-coder.ts +643 -0
- package/src/bootstrap/generated.ts +705 -17
- package/src/cli/build-info.ts +2 -2
- package/src/cli/cli.ts +22 -13
- package/src/commands/bootstrap.ts +49 -6
- package/src/commands/code.ts +369 -0
- package/src/commands/describe.ts +7 -2
- package/src/commands/index.ts +1 -0
- package/src/commands/sandbox-mcp.ts +7 -7
- package/src/commands/save-api-docs.ts +1 -1
- package/src/container-describer.ts +4 -4
- package/src/container.ts +10 -19
- package/src/helper.ts +24 -33
- package/src/introspection/generated.agi.ts +2499 -63
- package/src/introspection/generated.node.ts +1625 -688
- package/src/introspection/generated.web.ts +15 -57
- package/src/node/container.ts +5 -0
- package/src/node/features/figlet-fonts.ts +597 -0
- package/src/node/features/fs.ts +3 -9
- package/src/node/features/helpers.ts +20 -0
- package/src/node/features/python.ts +429 -16
- package/src/node/features/redis.ts +446 -0
- package/src/node/features/ui.ts +4 -11
- package/src/python/bridge.py +220 -0
- package/src/python/generated.ts +227 -0
- package/src/scaffolds/generated.ts +1 -1
- package/test/python-session.test.ts +105 -0
- package/assistants/lucaExpert/CORE.md +0 -37
- package/assistants/lucaExpert/hooks.ts +0 -9
- package/assistants/lucaExpert/tools.ts +0 -177
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setBuildTimeData, setContainerBuildTimeData } from './index.js';
|
|
2
2
|
|
|
3
3
|
// Auto-generated introspection registry data
|
|
4
|
-
// Generated at: 2026-03-
|
|
4
|
+
// Generated at: 2026-03-26T03:30:20.574Z
|
|
5
5
|
|
|
6
6
|
setBuildTimeData('features.googleDocs', {
|
|
7
7
|
"id": "features.googleDocs",
|
|
@@ -5927,6 +5927,312 @@ setBuildTimeData('features.googleCalendar', {
|
|
|
5927
5927
|
}
|
|
5928
5928
|
});
|
|
5929
5929
|
|
|
5930
|
+
setBuildTimeData('features.redis', {
|
|
5931
|
+
"id": "features.redis",
|
|
5932
|
+
"description": "Redis feature for shared state and pub/sub communication between container instances. Wraps ioredis with a focused API for the primitives that matter most: key/value state, pub/sub messaging, and cross-instance coordination. Uses a dedicated subscriber connection for pub/sub (ioredis requirement), created lazily on first subscribe call.",
|
|
5933
|
+
"shortcut": "features.redis",
|
|
5934
|
+
"className": "RedisFeature",
|
|
5935
|
+
"methods": {
|
|
5936
|
+
"set": {
|
|
5937
|
+
"description": "Set a key to a string value with optional TTL.",
|
|
5938
|
+
"parameters": {
|
|
5939
|
+
"key": {
|
|
5940
|
+
"type": "string",
|
|
5941
|
+
"description": "The key name"
|
|
5942
|
+
},
|
|
5943
|
+
"value": {
|
|
5944
|
+
"type": "string",
|
|
5945
|
+
"description": "The string value to store"
|
|
5946
|
+
},
|
|
5947
|
+
"ttl": {
|
|
5948
|
+
"type": "number",
|
|
5949
|
+
"description": "Optional time-to-live in seconds"
|
|
5950
|
+
}
|
|
5951
|
+
},
|
|
5952
|
+
"required": [
|
|
5953
|
+
"key",
|
|
5954
|
+
"value"
|
|
5955
|
+
],
|
|
5956
|
+
"returns": "Promise<void>"
|
|
5957
|
+
},
|
|
5958
|
+
"get": {
|
|
5959
|
+
"description": "Get a key's value. Returns null if the key doesn't exist.",
|
|
5960
|
+
"parameters": {
|
|
5961
|
+
"key": {
|
|
5962
|
+
"type": "string",
|
|
5963
|
+
"description": "The key name"
|
|
5964
|
+
}
|
|
5965
|
+
},
|
|
5966
|
+
"required": [
|
|
5967
|
+
"key"
|
|
5968
|
+
],
|
|
5969
|
+
"returns": "Promise<string | null>"
|
|
5970
|
+
},
|
|
5971
|
+
"del": {
|
|
5972
|
+
"description": "Delete one or more keys.",
|
|
5973
|
+
"parameters": {
|
|
5974
|
+
"keys": {
|
|
5975
|
+
"type": "string[]",
|
|
5976
|
+
"description": "One or more key names to delete"
|
|
5977
|
+
}
|
|
5978
|
+
},
|
|
5979
|
+
"required": [
|
|
5980
|
+
"keys"
|
|
5981
|
+
],
|
|
5982
|
+
"returns": "Promise<number>"
|
|
5983
|
+
},
|
|
5984
|
+
"exists": {
|
|
5985
|
+
"description": "Check if a key exists.",
|
|
5986
|
+
"parameters": {
|
|
5987
|
+
"key": {
|
|
5988
|
+
"type": "string",
|
|
5989
|
+
"description": "The key name"
|
|
5990
|
+
}
|
|
5991
|
+
},
|
|
5992
|
+
"required": [
|
|
5993
|
+
"key"
|
|
5994
|
+
],
|
|
5995
|
+
"returns": "Promise<boolean>"
|
|
5996
|
+
},
|
|
5997
|
+
"expire": {
|
|
5998
|
+
"description": "Set a key's TTL in seconds.",
|
|
5999
|
+
"parameters": {
|
|
6000
|
+
"key": {
|
|
6001
|
+
"type": "string",
|
|
6002
|
+
"description": "The key name"
|
|
6003
|
+
},
|
|
6004
|
+
"seconds": {
|
|
6005
|
+
"type": "number",
|
|
6006
|
+
"description": "TTL in seconds"
|
|
6007
|
+
}
|
|
6008
|
+
},
|
|
6009
|
+
"required": [
|
|
6010
|
+
"key",
|
|
6011
|
+
"seconds"
|
|
6012
|
+
],
|
|
6013
|
+
"returns": "Promise<boolean>"
|
|
6014
|
+
},
|
|
6015
|
+
"keys": {
|
|
6016
|
+
"description": "Find keys matching a glob pattern (respects prefix).",
|
|
6017
|
+
"parameters": {
|
|
6018
|
+
"pattern": {
|
|
6019
|
+
"type": "string",
|
|
6020
|
+
"description": "Glob pattern, e.g. \"worker:*\""
|
|
6021
|
+
}
|
|
6022
|
+
},
|
|
6023
|
+
"required": [],
|
|
6024
|
+
"returns": "Promise<string[]>"
|
|
6025
|
+
},
|
|
6026
|
+
"setJSON": {
|
|
6027
|
+
"description": "Store a value as JSON.",
|
|
6028
|
+
"parameters": {
|
|
6029
|
+
"key": {
|
|
6030
|
+
"type": "string",
|
|
6031
|
+
"description": "The key name"
|
|
6032
|
+
},
|
|
6033
|
+
"value": {
|
|
6034
|
+
"type": "unknown",
|
|
6035
|
+
"description": "Any JSON-serializable value"
|
|
6036
|
+
},
|
|
6037
|
+
"ttl": {
|
|
6038
|
+
"type": "number",
|
|
6039
|
+
"description": "Optional TTL in seconds"
|
|
6040
|
+
}
|
|
6041
|
+
},
|
|
6042
|
+
"required": [
|
|
6043
|
+
"key",
|
|
6044
|
+
"value"
|
|
6045
|
+
],
|
|
6046
|
+
"returns": "Promise<void>"
|
|
6047
|
+
},
|
|
6048
|
+
"getJSON": {
|
|
6049
|
+
"description": "Retrieve and parse a JSON value.",
|
|
6050
|
+
"parameters": {
|
|
6051
|
+
"key": {
|
|
6052
|
+
"type": "string",
|
|
6053
|
+
"description": "The key name"
|
|
6054
|
+
}
|
|
6055
|
+
},
|
|
6056
|
+
"required": [
|
|
6057
|
+
"key"
|
|
6058
|
+
],
|
|
6059
|
+
"returns": "Promise<T | null>"
|
|
6060
|
+
},
|
|
6061
|
+
"hset": {
|
|
6062
|
+
"description": "Set fields on a hash.",
|
|
6063
|
+
"parameters": {
|
|
6064
|
+
"key": {
|
|
6065
|
+
"type": "string",
|
|
6066
|
+
"description": "The hash key"
|
|
6067
|
+
},
|
|
6068
|
+
"fields": {
|
|
6069
|
+
"type": "Record<string, string>",
|
|
6070
|
+
"description": "Object of field/value pairs"
|
|
6071
|
+
}
|
|
6072
|
+
},
|
|
6073
|
+
"required": [
|
|
6074
|
+
"key",
|
|
6075
|
+
"fields"
|
|
6076
|
+
],
|
|
6077
|
+
"returns": "Promise<void>"
|
|
6078
|
+
},
|
|
6079
|
+
"hgetall": {
|
|
6080
|
+
"description": "Get all fields from a hash.",
|
|
6081
|
+
"parameters": {
|
|
6082
|
+
"key": {
|
|
6083
|
+
"type": "string",
|
|
6084
|
+
"description": "The hash key"
|
|
6085
|
+
}
|
|
6086
|
+
},
|
|
6087
|
+
"required": [
|
|
6088
|
+
"key"
|
|
6089
|
+
],
|
|
6090
|
+
"returns": "Promise<Record<string, string>>"
|
|
6091
|
+
},
|
|
6092
|
+
"hget": {
|
|
6093
|
+
"description": "Get a single field from a hash.",
|
|
6094
|
+
"parameters": {
|
|
6095
|
+
"key": {
|
|
6096
|
+
"type": "string",
|
|
6097
|
+
"description": "The hash key"
|
|
6098
|
+
},
|
|
6099
|
+
"field": {
|
|
6100
|
+
"type": "string",
|
|
6101
|
+
"description": "The field name"
|
|
6102
|
+
}
|
|
6103
|
+
},
|
|
6104
|
+
"required": [
|
|
6105
|
+
"key",
|
|
6106
|
+
"field"
|
|
6107
|
+
],
|
|
6108
|
+
"returns": "Promise<string | null>"
|
|
6109
|
+
},
|
|
6110
|
+
"subscribe": {
|
|
6111
|
+
"description": "Subscribe to one or more channels. Optionally pass a handler that fires only for these channels. The feature also emits a `message` event for all messages.",
|
|
6112
|
+
"parameters": {
|
|
6113
|
+
"channels": {
|
|
6114
|
+
"type": "string | string[]",
|
|
6115
|
+
"description": "Channel name(s) to subscribe to"
|
|
6116
|
+
},
|
|
6117
|
+
"handler": {
|
|
6118
|
+
"type": "MessageHandler",
|
|
6119
|
+
"description": "Optional per-channel message handler"
|
|
6120
|
+
}
|
|
6121
|
+
},
|
|
6122
|
+
"required": [
|
|
6123
|
+
"channels"
|
|
6124
|
+
],
|
|
6125
|
+
"returns": "Promise<void>",
|
|
6126
|
+
"examples": [
|
|
6127
|
+
{
|
|
6128
|
+
"language": "ts",
|
|
6129
|
+
"code": "await redis.subscribe('tasks', (channel, msg) => {\n console.log(`Got ${msg} on ${channel}`)\n})"
|
|
6130
|
+
}
|
|
6131
|
+
]
|
|
6132
|
+
},
|
|
6133
|
+
"unsubscribe": {
|
|
6134
|
+
"description": "Unsubscribe from one or more channels.",
|
|
6135
|
+
"parameters": {
|
|
6136
|
+
"channels": {
|
|
6137
|
+
"type": "string[]",
|
|
6138
|
+
"description": "Channel name(s) to unsubscribe from"
|
|
6139
|
+
}
|
|
6140
|
+
},
|
|
6141
|
+
"required": [
|
|
6142
|
+
"channels"
|
|
6143
|
+
],
|
|
6144
|
+
"returns": "Promise<void>"
|
|
6145
|
+
},
|
|
6146
|
+
"publish": {
|
|
6147
|
+
"description": "Publish a message to a channel.",
|
|
6148
|
+
"parameters": {
|
|
6149
|
+
"channel": {
|
|
6150
|
+
"type": "string",
|
|
6151
|
+
"description": "The channel to publish to"
|
|
6152
|
+
},
|
|
6153
|
+
"message": {
|
|
6154
|
+
"type": "string",
|
|
6155
|
+
"description": "The message string (use JSON.stringify for objects)"
|
|
6156
|
+
}
|
|
6157
|
+
},
|
|
6158
|
+
"required": [
|
|
6159
|
+
"channel",
|
|
6160
|
+
"message"
|
|
6161
|
+
],
|
|
6162
|
+
"returns": "Promise<number>"
|
|
6163
|
+
},
|
|
6164
|
+
"ensureLocalDocker": {
|
|
6165
|
+
"description": "Spin up a local Redis instance via Docker. Checks if a container with the given name already exists and starts it if stopped, or creates a new one from redis:alpine. Requires the docker feature to be available on the container.",
|
|
6166
|
+
"parameters": {
|
|
6167
|
+
"options": {
|
|
6168
|
+
"type": "{ name?: string; port?: number; image?: string }",
|
|
6169
|
+
"description": "Container name and host port"
|
|
6170
|
+
}
|
|
6171
|
+
},
|
|
6172
|
+
"required": [],
|
|
6173
|
+
"returns": "Promise<string>",
|
|
6174
|
+
"examples": [
|
|
6175
|
+
{
|
|
6176
|
+
"language": "ts",
|
|
6177
|
+
"code": "const redis = container.feature('redis', { url: 'redis://localhost:6379', lazyConnect: true })\nawait redis.ensureLocalDocker()"
|
|
6178
|
+
}
|
|
6179
|
+
]
|
|
6180
|
+
},
|
|
6181
|
+
"close": {
|
|
6182
|
+
"description": "Close all redis connections (main client + subscriber).",
|
|
6183
|
+
"parameters": {},
|
|
6184
|
+
"required": [],
|
|
6185
|
+
"returns": "Promise<this>"
|
|
6186
|
+
}
|
|
6187
|
+
},
|
|
6188
|
+
"getters": {
|
|
6189
|
+
"client": {
|
|
6190
|
+
"description": "The underlying ioredis client for advanced operations.",
|
|
6191
|
+
"returns": "Redis"
|
|
6192
|
+
},
|
|
6193
|
+
"subscriber": {
|
|
6194
|
+
"description": "The dedicated subscriber connection, if pub/sub is active.",
|
|
6195
|
+
"returns": "Redis | null"
|
|
6196
|
+
}
|
|
6197
|
+
},
|
|
6198
|
+
"events": {
|
|
6199
|
+
"message": {
|
|
6200
|
+
"name": "message",
|
|
6201
|
+
"description": "Event emitted by RedisFeature",
|
|
6202
|
+
"arguments": {}
|
|
6203
|
+
},
|
|
6204
|
+
"error": {
|
|
6205
|
+
"name": "error",
|
|
6206
|
+
"description": "Event emitted by RedisFeature",
|
|
6207
|
+
"arguments": {}
|
|
6208
|
+
},
|
|
6209
|
+
"subscribed": {
|
|
6210
|
+
"name": "subscribed",
|
|
6211
|
+
"description": "Event emitted by RedisFeature",
|
|
6212
|
+
"arguments": {}
|
|
6213
|
+
},
|
|
6214
|
+
"unsubscribed": {
|
|
6215
|
+
"name": "unsubscribed",
|
|
6216
|
+
"description": "Event emitted by RedisFeature",
|
|
6217
|
+
"arguments": {}
|
|
6218
|
+
},
|
|
6219
|
+
"closed": {
|
|
6220
|
+
"name": "closed",
|
|
6221
|
+
"description": "Event emitted by RedisFeature",
|
|
6222
|
+
"arguments": {}
|
|
6223
|
+
}
|
|
6224
|
+
},
|
|
6225
|
+
"state": {},
|
|
6226
|
+
"options": {},
|
|
6227
|
+
"envVars": [],
|
|
6228
|
+
"examples": [
|
|
6229
|
+
{
|
|
6230
|
+
"language": "ts",
|
|
6231
|
+
"code": "const redis = container.feature('redis', { url: 'redis://localhost:6379' })\n\n// Shared state\nawait redis.set('worker:status', 'active')\nconst status = await redis.get('worker:status')\n\n// Pub/sub between instances\nredis.on('message', (channel, msg) => console.log(`${channel}: ${msg}`))\nawait redis.subscribe('tasks')\nawait redis.publish('tasks', JSON.stringify({ type: 'ping' }))\n\n// JSON helpers\nawait redis.setJSON('config', { workers: 4, debug: true })\nconst config = await redis.getJSON<{ workers: number }>('config')"
|
|
6232
|
+
}
|
|
6233
|
+
]
|
|
6234
|
+
});
|
|
6235
|
+
|
|
5930
6236
|
setBuildTimeData('features.fs', {
|
|
5931
6237
|
"id": "features.fs",
|
|
5932
6238
|
"description": "The FS feature provides methods for interacting with the file system, relative to the container's cwd.",
|
|
@@ -7566,7 +7872,7 @@ setBuildTimeData('features.postgres', {
|
|
|
7566
7872
|
|
|
7567
7873
|
setBuildTimeData('features.python', {
|
|
7568
7874
|
"id": "features.python",
|
|
7569
|
-
"description": "The Python VM feature provides Python virtual machine capabilities for executing Python code. This feature automatically detects Python environments (uv, conda, venv, system) and provides methods to install dependencies and execute Python scripts. It can manage project-specific Python environments and maintain context between executions.",
|
|
7875
|
+
"description": "The Python VM feature provides Python virtual machine capabilities for executing Python code. This feature automatically detects Python environments (uv, conda, venv, system) and provides methods to install dependencies and execute Python scripts. It can manage project-specific Python environments and maintain context between executions. Supports two modes: - **Stateless** (default): `execute()` and `executeFile()` spawn a fresh process per call - **Persistent session**: `startSession()` spawns a long-lived bridge process that maintains state across `run()` calls, enabling real codebase interaction with imports and session variables",
|
|
7570
7876
|
"shortcut": "features.python",
|
|
7571
7877
|
"className": "Python",
|
|
7572
7878
|
"methods": {
|
|
@@ -7666,6 +7972,146 @@ setBuildTimeData('features.python', {
|
|
|
7666
7972
|
"parameters": {},
|
|
7667
7973
|
"required": [],
|
|
7668
7974
|
"returns": "Promise<{ version: string; path: string; packages: string[] }>"
|
|
7975
|
+
},
|
|
7976
|
+
"startSession": {
|
|
7977
|
+
"description": "Starts a persistent Python session by spawning the bridge process. The bridge sets up sys.path for the project directory, then enters a JSON-line REPL loop. State (variables, imports) persists across run() calls until stopSession() or resetSession() is called.",
|
|
7978
|
+
"parameters": {},
|
|
7979
|
+
"required": [],
|
|
7980
|
+
"returns": "Promise<void>",
|
|
7981
|
+
"examples": [
|
|
7982
|
+
{
|
|
7983
|
+
"language": "ts",
|
|
7984
|
+
"code": "const python = container.feature('python', { dir: '/path/to/project' })\nawait python.enable()\nawait python.startSession()\nawait python.run('x = 42')\nconst result = await python.run('print(x)')\nconsole.log(result.stdout) // '42\\n'\nawait python.stopSession()"
|
|
7985
|
+
}
|
|
7986
|
+
]
|
|
7987
|
+
},
|
|
7988
|
+
"stopSession": {
|
|
7989
|
+
"description": "Stops the persistent Python session and cleans up the bridge process.",
|
|
7990
|
+
"parameters": {},
|
|
7991
|
+
"required": [],
|
|
7992
|
+
"returns": "Promise<void>",
|
|
7993
|
+
"examples": [
|
|
7994
|
+
{
|
|
7995
|
+
"language": "ts",
|
|
7996
|
+
"code": "await python.stopSession()"
|
|
7997
|
+
}
|
|
7998
|
+
]
|
|
7999
|
+
},
|
|
8000
|
+
"run": {
|
|
8001
|
+
"description": "Executes Python code in the persistent session. Variables and imports survive across calls. This is the session equivalent of execute().",
|
|
8002
|
+
"parameters": {
|
|
8003
|
+
"code": {
|
|
8004
|
+
"type": "string",
|
|
8005
|
+
"description": "Python code to execute"
|
|
8006
|
+
},
|
|
8007
|
+
"variables": {
|
|
8008
|
+
"type": "Record<string, any>",
|
|
8009
|
+
"description": "Variables to inject into the namespace before execution"
|
|
8010
|
+
}
|
|
8011
|
+
},
|
|
8012
|
+
"required": [
|
|
8013
|
+
"code"
|
|
8014
|
+
],
|
|
8015
|
+
"returns": "Promise<RunResult>",
|
|
8016
|
+
"examples": [
|
|
8017
|
+
{
|
|
8018
|
+
"language": "ts",
|
|
8019
|
+
"code": "await python.startSession()\n\n// State persists across calls\nawait python.run('x = 42')\nconst result = await python.run('print(x * 2)')\nconsole.log(result.stdout) // '84\\n'\n\n// Inject variables from JS\nconst result2 = await python.run('print(f\"Hello {name}!\")', { name: 'World' })\nconsole.log(result2.stdout) // 'Hello World!\\n'"
|
|
8020
|
+
}
|
|
8021
|
+
]
|
|
8022
|
+
},
|
|
8023
|
+
"eval": {
|
|
8024
|
+
"description": "Evaluates a Python expression in the persistent session and returns its value.",
|
|
8025
|
+
"parameters": {
|
|
8026
|
+
"expression": {
|
|
8027
|
+
"type": "string",
|
|
8028
|
+
"description": "Python expression to evaluate"
|
|
8029
|
+
}
|
|
8030
|
+
},
|
|
8031
|
+
"required": [
|
|
8032
|
+
"expression"
|
|
8033
|
+
],
|
|
8034
|
+
"returns": "Promise<any>",
|
|
8035
|
+
"examples": [
|
|
8036
|
+
{
|
|
8037
|
+
"language": "ts",
|
|
8038
|
+
"code": "await python.run('x = 42')\nconst result = await python.eval('x * 2')\nconsole.log(result) // 84"
|
|
8039
|
+
}
|
|
8040
|
+
]
|
|
8041
|
+
},
|
|
8042
|
+
"importModule": {
|
|
8043
|
+
"description": "Imports a Python module into the persistent session namespace.",
|
|
8044
|
+
"parameters": {
|
|
8045
|
+
"moduleName": {
|
|
8046
|
+
"type": "string",
|
|
8047
|
+
"description": "Dotted module path (e.g. 'myapp.models')"
|
|
8048
|
+
},
|
|
8049
|
+
"alias": {
|
|
8050
|
+
"type": "string",
|
|
8051
|
+
"description": "Optional alias for the import (defaults to the last segment)"
|
|
8052
|
+
}
|
|
8053
|
+
},
|
|
8054
|
+
"required": [
|
|
8055
|
+
"moduleName"
|
|
8056
|
+
],
|
|
8057
|
+
"returns": "Promise<void>",
|
|
8058
|
+
"examples": [
|
|
8059
|
+
{
|
|
8060
|
+
"language": "ts",
|
|
8061
|
+
"code": "await python.importModule('json')\nawait python.importModule('myapp.models', 'models')\nconst result = await python.eval('models.User')"
|
|
8062
|
+
}
|
|
8063
|
+
]
|
|
8064
|
+
},
|
|
8065
|
+
"call": {
|
|
8066
|
+
"description": "Calls a function by dotted path in the persistent session namespace.",
|
|
8067
|
+
"parameters": {
|
|
8068
|
+
"funcPath": {
|
|
8069
|
+
"type": "string",
|
|
8070
|
+
"description": "Dotted path to the function (e.g. 'json.dumps' or 'my_func')"
|
|
8071
|
+
},
|
|
8072
|
+
"args": {
|
|
8073
|
+
"type": "any[]",
|
|
8074
|
+
"description": "Positional arguments"
|
|
8075
|
+
},
|
|
8076
|
+
"kwargs": {
|
|
8077
|
+
"type": "Record<string, any>",
|
|
8078
|
+
"description": "Keyword arguments"
|
|
8079
|
+
}
|
|
8080
|
+
},
|
|
8081
|
+
"required": [
|
|
8082
|
+
"funcPath"
|
|
8083
|
+
],
|
|
8084
|
+
"returns": "Promise<any>",
|
|
8085
|
+
"examples": [
|
|
8086
|
+
{
|
|
8087
|
+
"language": "ts",
|
|
8088
|
+
"code": "await python.importModule('json')\nconst result = await python.call('json.dumps', [{ a: 1 }], { indent: 2 })"
|
|
8089
|
+
}
|
|
8090
|
+
]
|
|
8091
|
+
},
|
|
8092
|
+
"getLocals": {
|
|
8093
|
+
"description": "Returns all non-dunder variables from the persistent session namespace.",
|
|
8094
|
+
"parameters": {},
|
|
8095
|
+
"required": [],
|
|
8096
|
+
"returns": "Promise<Record<string, any>>",
|
|
8097
|
+
"examples": [
|
|
8098
|
+
{
|
|
8099
|
+
"language": "ts",
|
|
8100
|
+
"code": "await python.run('x = 42\\ny = \"hello\"')\nconst locals = await python.getLocals()\nconsole.log(locals) // { x: 42, y: 'hello' }"
|
|
8101
|
+
}
|
|
8102
|
+
]
|
|
8103
|
+
},
|
|
8104
|
+
"resetSession": {
|
|
8105
|
+
"description": "Clears all variables and imports from the persistent session namespace. The session remains active — you can continue calling run() after reset.",
|
|
8106
|
+
"parameters": {},
|
|
8107
|
+
"required": [],
|
|
8108
|
+
"returns": "Promise<void>",
|
|
8109
|
+
"examples": [
|
|
8110
|
+
{
|
|
8111
|
+
"language": "ts",
|
|
8112
|
+
"code": "await python.run('x = 42')\nawait python.resetSession()\n// x is now undefined"
|
|
8113
|
+
}
|
|
8114
|
+
]
|
|
7669
8115
|
}
|
|
7670
8116
|
},
|
|
7671
8117
|
"getters": {
|
|
@@ -7722,6 +8168,21 @@ setBuildTimeData('features.python', {
|
|
|
7722
8168
|
"name": "fileExecuted",
|
|
7723
8169
|
"description": "Event emitted by Python",
|
|
7724
8170
|
"arguments": {}
|
|
8171
|
+
},
|
|
8172
|
+
"sessionError": {
|
|
8173
|
+
"name": "sessionError",
|
|
8174
|
+
"description": "Event emitted by Python",
|
|
8175
|
+
"arguments": {}
|
|
8176
|
+
},
|
|
8177
|
+
"sessionStarted": {
|
|
8178
|
+
"name": "sessionStarted",
|
|
8179
|
+
"description": "Event emitted by Python",
|
|
8180
|
+
"arguments": {}
|
|
8181
|
+
},
|
|
8182
|
+
"sessionStopped": {
|
|
8183
|
+
"name": "sessionStopped",
|
|
8184
|
+
"description": "Event emitted by Python",
|
|
8185
|
+
"arguments": {}
|
|
7725
8186
|
}
|
|
7726
8187
|
},
|
|
7727
8188
|
"state": {},
|
|
@@ -7730,9 +8191,38 @@ setBuildTimeData('features.python', {
|
|
|
7730
8191
|
"examples": [
|
|
7731
8192
|
{
|
|
7732
8193
|
"language": "ts",
|
|
7733
|
-
"code": "const python = container.feature('python', {
|
|
8194
|
+
"code": "const python = container.feature('python', {\n dir: \"/path/to/python/project\",\n})\n\n// Stateless execution\nconst result = await python.execute('print(\"Hello from Python!\")')\n\n// Persistent session\nawait python.startSession()\nawait python.run('import myapp.models')\nawait python.run('users = myapp.models.User.objects.all()')\nconst result = await python.run('print(len(users))')\nawait python.stopSession()"
|
|
7734
8195
|
}
|
|
7735
|
-
]
|
|
8196
|
+
],
|
|
8197
|
+
"types": {
|
|
8198
|
+
"RunResult": {
|
|
8199
|
+
"description": "Result from a persistent session run() call.",
|
|
8200
|
+
"properties": {
|
|
8201
|
+
"ok": {
|
|
8202
|
+
"type": "boolean",
|
|
8203
|
+
"description": ""
|
|
8204
|
+
},
|
|
8205
|
+
"result": {
|
|
8206
|
+
"type": "any",
|
|
8207
|
+
"description": ""
|
|
8208
|
+
},
|
|
8209
|
+
"stdout": {
|
|
8210
|
+
"type": "string",
|
|
8211
|
+
"description": ""
|
|
8212
|
+
},
|
|
8213
|
+
"error": {
|
|
8214
|
+
"type": "string",
|
|
8215
|
+
"description": "",
|
|
8216
|
+
"optional": true
|
|
8217
|
+
},
|
|
8218
|
+
"traceback": {
|
|
8219
|
+
"type": "string",
|
|
8220
|
+
"description": "",
|
|
8221
|
+
"optional": true
|
|
8222
|
+
}
|
|
8223
|
+
}
|
|
8224
|
+
}
|
|
8225
|
+
}
|
|
7736
8226
|
});
|
|
7737
8227
|
|
|
7738
8228
|
setBuildTimeData('features.jsonTree', {
|
|
@@ -16543,6 +17033,303 @@ setBuildTimeData('features.openaiCodex', {
|
|
|
16543
17033
|
}
|
|
16544
17034
|
});
|
|
16545
17035
|
|
|
17036
|
+
setBuildTimeData('features.lucaCoder', {
|
|
17037
|
+
"id": "features.lucaCoder",
|
|
17038
|
+
"description": "A coding assistant that owns a lower-level Assistant instance and gates all tool calls through a permission system. Comes with built-in Bash tool (via proc.execAndCapture) and auto-loads the luca-framework skill when found in .claude/skills paths. Tools are stacked from feature bundles (fileTools, etc.) and each tool can be set to 'allow' (runs immediately), 'ask' (blocks until user approves/denies), or 'deny' (always rejected).",
|
|
17039
|
+
"shortcut": "features.lucaCoder",
|
|
17040
|
+
"className": "LucaCoder",
|
|
17041
|
+
"methods": {
|
|
17042
|
+
"getPermission": {
|
|
17043
|
+
"description": "Get the effective permission level for a tool.",
|
|
17044
|
+
"parameters": {
|
|
17045
|
+
"toolName": {
|
|
17046
|
+
"type": "string",
|
|
17047
|
+
"description": "Parameter toolName"
|
|
17048
|
+
}
|
|
17049
|
+
},
|
|
17050
|
+
"required": [
|
|
17051
|
+
"toolName"
|
|
17052
|
+
],
|
|
17053
|
+
"returns": "PermissionLevel"
|
|
17054
|
+
},
|
|
17055
|
+
"setPermission": {
|
|
17056
|
+
"description": "Set permission level for one or more tools.",
|
|
17057
|
+
"parameters": {
|
|
17058
|
+
"toolName": {
|
|
17059
|
+
"type": "string | string[]",
|
|
17060
|
+
"description": "Parameter toolName"
|
|
17061
|
+
},
|
|
17062
|
+
"level": {
|
|
17063
|
+
"type": "PermissionLevel",
|
|
17064
|
+
"description": "Parameter level"
|
|
17065
|
+
}
|
|
17066
|
+
},
|
|
17067
|
+
"required": [
|
|
17068
|
+
"toolName",
|
|
17069
|
+
"level"
|
|
17070
|
+
],
|
|
17071
|
+
"returns": "this"
|
|
17072
|
+
},
|
|
17073
|
+
"setDefaultPermission": {
|
|
17074
|
+
"description": "Set the default permission level for unconfigured tools.",
|
|
17075
|
+
"parameters": {
|
|
17076
|
+
"level": {
|
|
17077
|
+
"type": "PermissionLevel",
|
|
17078
|
+
"description": "Parameter level"
|
|
17079
|
+
}
|
|
17080
|
+
},
|
|
17081
|
+
"required": [
|
|
17082
|
+
"level"
|
|
17083
|
+
],
|
|
17084
|
+
"returns": "this"
|
|
17085
|
+
},
|
|
17086
|
+
"permitTool": {
|
|
17087
|
+
"description": "Allow a tool (or tools) to run without approval.",
|
|
17088
|
+
"parameters": {
|
|
17089
|
+
"toolNames": {
|
|
17090
|
+
"type": "string[]",
|
|
17091
|
+
"description": "Parameter toolNames"
|
|
17092
|
+
}
|
|
17093
|
+
},
|
|
17094
|
+
"required": [
|
|
17095
|
+
"toolNames"
|
|
17096
|
+
],
|
|
17097
|
+
"returns": "this"
|
|
17098
|
+
},
|
|
17099
|
+
"gateTool": {
|
|
17100
|
+
"description": "Require approval before a tool (or tools) can run.",
|
|
17101
|
+
"parameters": {
|
|
17102
|
+
"toolNames": {
|
|
17103
|
+
"type": "string[]",
|
|
17104
|
+
"description": "Parameter toolNames"
|
|
17105
|
+
}
|
|
17106
|
+
},
|
|
17107
|
+
"required": [
|
|
17108
|
+
"toolNames"
|
|
17109
|
+
],
|
|
17110
|
+
"returns": "this"
|
|
17111
|
+
},
|
|
17112
|
+
"blockTool": {
|
|
17113
|
+
"description": "Block a tool (or tools) from ever running.",
|
|
17114
|
+
"parameters": {
|
|
17115
|
+
"toolNames": {
|
|
17116
|
+
"type": "string[]",
|
|
17117
|
+
"description": "Parameter toolNames"
|
|
17118
|
+
}
|
|
17119
|
+
},
|
|
17120
|
+
"required": [
|
|
17121
|
+
"toolNames"
|
|
17122
|
+
],
|
|
17123
|
+
"returns": "this"
|
|
17124
|
+
},
|
|
17125
|
+
"approve": {
|
|
17126
|
+
"description": "Approve a pending tool call by ID. The tool will execute.",
|
|
17127
|
+
"parameters": {
|
|
17128
|
+
"id": {
|
|
17129
|
+
"type": "string",
|
|
17130
|
+
"description": "Parameter id"
|
|
17131
|
+
}
|
|
17132
|
+
},
|
|
17133
|
+
"required": [
|
|
17134
|
+
"id"
|
|
17135
|
+
],
|
|
17136
|
+
"returns": "this"
|
|
17137
|
+
},
|
|
17138
|
+
"deny": {
|
|
17139
|
+
"description": "Deny a pending tool call by ID. The tool call will be skipped.",
|
|
17140
|
+
"parameters": {
|
|
17141
|
+
"id": {
|
|
17142
|
+
"type": "string",
|
|
17143
|
+
"description": "Parameter id"
|
|
17144
|
+
}
|
|
17145
|
+
},
|
|
17146
|
+
"required": [
|
|
17147
|
+
"id"
|
|
17148
|
+
],
|
|
17149
|
+
"returns": "this"
|
|
17150
|
+
},
|
|
17151
|
+
"approveAll": {
|
|
17152
|
+
"description": "Approve all pending tool calls.",
|
|
17153
|
+
"parameters": {},
|
|
17154
|
+
"required": [],
|
|
17155
|
+
"returns": "this"
|
|
17156
|
+
},
|
|
17157
|
+
"denyAll": {
|
|
17158
|
+
"description": "Deny all pending tool calls.",
|
|
17159
|
+
"parameters": {},
|
|
17160
|
+
"required": [],
|
|
17161
|
+
"returns": "this"
|
|
17162
|
+
},
|
|
17163
|
+
"bash": {
|
|
17164
|
+
"description": "Execute a shell command string and return its output. Uses proc.execAndCapture under the hood — runs `sh -c <command>`.",
|
|
17165
|
+
"parameters": {
|
|
17166
|
+
"{ command, cwd, timeout }": {
|
|
17167
|
+
"type": "{ command: string; cwd?: string; timeout?: number }",
|
|
17168
|
+
"description": "Parameter { command, cwd, timeout }"
|
|
17169
|
+
}
|
|
17170
|
+
},
|
|
17171
|
+
"required": [
|
|
17172
|
+
"{ command, cwd, timeout }"
|
|
17173
|
+
],
|
|
17174
|
+
"returns": "Promise<{\n\t\texitCode: number\n\t\tstdout: string\n\t\tstderr: string\n\t\tsuccess: boolean\n\t}>"
|
|
17175
|
+
},
|
|
17176
|
+
"start": {
|
|
17177
|
+
"description": "Initialize the inner assistant, register the bash tool, stack tool bundles, auto-load skills, and wire up the permission interceptor.",
|
|
17178
|
+
"parameters": {},
|
|
17179
|
+
"required": [],
|
|
17180
|
+
"returns": "Promise<this>"
|
|
17181
|
+
},
|
|
17182
|
+
"ask": {
|
|
17183
|
+
"description": "Ask the coder a question. Auto-starts if needed. Tool calls will be gated by the permission system.",
|
|
17184
|
+
"parameters": {
|
|
17185
|
+
"question": {
|
|
17186
|
+
"type": "string",
|
|
17187
|
+
"description": "Parameter question"
|
|
17188
|
+
},
|
|
17189
|
+
"options": {
|
|
17190
|
+
"type": "Record<string, any>",
|
|
17191
|
+
"description": "Parameter options"
|
|
17192
|
+
}
|
|
17193
|
+
},
|
|
17194
|
+
"required": [
|
|
17195
|
+
"question"
|
|
17196
|
+
],
|
|
17197
|
+
"returns": "Promise<string>"
|
|
17198
|
+
},
|
|
17199
|
+
"use": {
|
|
17200
|
+
"description": "Add a tool bundle after initialization. Useful for dynamically extending the assistant's capabilities.",
|
|
17201
|
+
"parameters": {
|
|
17202
|
+
"spec": {
|
|
17203
|
+
"type": "ToolBundleSpec",
|
|
17204
|
+
"description": "Parameter spec"
|
|
17205
|
+
}
|
|
17206
|
+
},
|
|
17207
|
+
"required": [
|
|
17208
|
+
"spec"
|
|
17209
|
+
],
|
|
17210
|
+
"returns": "this"
|
|
17211
|
+
}
|
|
17212
|
+
},
|
|
17213
|
+
"getters": {
|
|
17214
|
+
"assistant": {
|
|
17215
|
+
"description": "The inner assistant. Throws if not started.",
|
|
17216
|
+
"returns": "Assistant"
|
|
17217
|
+
},
|
|
17218
|
+
"permissions": {
|
|
17219
|
+
"description": "Current permission map from state.",
|
|
17220
|
+
"returns": "Record<string, PermissionLevel>"
|
|
17221
|
+
},
|
|
17222
|
+
"pendingApprovals": {
|
|
17223
|
+
"description": "Current pending approvals.",
|
|
17224
|
+
"returns": "PendingApproval[]"
|
|
17225
|
+
},
|
|
17226
|
+
"isStarted": {
|
|
17227
|
+
"description": "Whether the assistant is started and ready.",
|
|
17228
|
+
"returns": "boolean"
|
|
17229
|
+
},
|
|
17230
|
+
"tools": {
|
|
17231
|
+
"description": "The tools registered on the inner assistant.",
|
|
17232
|
+
"returns": "Record<string, any>"
|
|
17233
|
+
},
|
|
17234
|
+
"conversation": {
|
|
17235
|
+
"description": "The conversation on the inner assistant (if started).",
|
|
17236
|
+
"returns": "any"
|
|
17237
|
+
},
|
|
17238
|
+
"messages": {
|
|
17239
|
+
"description": "Messages from the inner assistant's conversation.",
|
|
17240
|
+
"returns": "any"
|
|
17241
|
+
}
|
|
17242
|
+
},
|
|
17243
|
+
"events": {
|
|
17244
|
+
"permissionGranted": {
|
|
17245
|
+
"name": "permissionGranted",
|
|
17246
|
+
"description": "Event emitted by LucaCoder",
|
|
17247
|
+
"arguments": {}
|
|
17248
|
+
},
|
|
17249
|
+
"permissionDenied": {
|
|
17250
|
+
"name": "permissionDenied",
|
|
17251
|
+
"description": "Event emitted by LucaCoder",
|
|
17252
|
+
"arguments": {}
|
|
17253
|
+
},
|
|
17254
|
+
"toolBlocked": {
|
|
17255
|
+
"name": "toolBlocked",
|
|
17256
|
+
"description": "Event emitted by LucaCoder",
|
|
17257
|
+
"arguments": {}
|
|
17258
|
+
},
|
|
17259
|
+
"chunk": {
|
|
17260
|
+
"name": "chunk",
|
|
17261
|
+
"description": "Event emitted by LucaCoder",
|
|
17262
|
+
"arguments": {}
|
|
17263
|
+
},
|
|
17264
|
+
"response": {
|
|
17265
|
+
"name": "response",
|
|
17266
|
+
"description": "Event emitted by LucaCoder",
|
|
17267
|
+
"arguments": {}
|
|
17268
|
+
},
|
|
17269
|
+
"toolCall": {
|
|
17270
|
+
"name": "toolCall",
|
|
17271
|
+
"description": "Event emitted by LucaCoder",
|
|
17272
|
+
"arguments": {}
|
|
17273
|
+
},
|
|
17274
|
+
"toolResult": {
|
|
17275
|
+
"name": "toolResult",
|
|
17276
|
+
"description": "Event emitted by LucaCoder",
|
|
17277
|
+
"arguments": {}
|
|
17278
|
+
},
|
|
17279
|
+
"toolError": {
|
|
17280
|
+
"name": "toolError",
|
|
17281
|
+
"description": "Event emitted by LucaCoder",
|
|
17282
|
+
"arguments": {}
|
|
17283
|
+
},
|
|
17284
|
+
"started": {
|
|
17285
|
+
"name": "started",
|
|
17286
|
+
"description": "Event emitted by LucaCoder",
|
|
17287
|
+
"arguments": {}
|
|
17288
|
+
},
|
|
17289
|
+
"permissionRequest": {
|
|
17290
|
+
"name": "permissionRequest",
|
|
17291
|
+
"description": "Event emitted by LucaCoder",
|
|
17292
|
+
"arguments": {}
|
|
17293
|
+
}
|
|
17294
|
+
},
|
|
17295
|
+
"state": {},
|
|
17296
|
+
"options": {},
|
|
17297
|
+
"envVars": [],
|
|
17298
|
+
"examples": [
|
|
17299
|
+
{
|
|
17300
|
+
"language": "ts",
|
|
17301
|
+
"code": "const coder = container.feature('lucaCoder', {\n tools: ['fileTools'],\n permissions: {\n readFile: 'allow',\n searchFiles: 'allow',\n writeFile: 'ask',\n bash: 'ask',\n },\n defaultPermission: 'ask',\n systemPrompt: 'You are a coding assistant.',\n})\n\ncoder.on('permissionRequest', ({ id, toolName, args }) => {\n console.log(`Tool \"${toolName}\" wants to run with`, args)\n coder.approve(id) // or coder.deny(id)\n})\n\nawait coder.ask('Refactor the auth module to use async/await')"
|
|
17302
|
+
}
|
|
17303
|
+
],
|
|
17304
|
+
"types": {
|
|
17305
|
+
"PendingApproval": {
|
|
17306
|
+
"description": "A pending approval awaiting user decision.",
|
|
17307
|
+
"properties": {
|
|
17308
|
+
"id": {
|
|
17309
|
+
"type": "string",
|
|
17310
|
+
"description": ""
|
|
17311
|
+
},
|
|
17312
|
+
"toolName": {
|
|
17313
|
+
"type": "string",
|
|
17314
|
+
"description": ""
|
|
17315
|
+
},
|
|
17316
|
+
"args": {
|
|
17317
|
+
"type": "Record<string, any>",
|
|
17318
|
+
"description": ""
|
|
17319
|
+
},
|
|
17320
|
+
"timestamp": {
|
|
17321
|
+
"type": "number",
|
|
17322
|
+
"description": ""
|
|
17323
|
+
},
|
|
17324
|
+
"resolve": {
|
|
17325
|
+
"type": "(decision: 'approve' | 'deny') => void",
|
|
17326
|
+
"description": ""
|
|
17327
|
+
}
|
|
17328
|
+
}
|
|
17329
|
+
}
|
|
17330
|
+
}
|
|
17331
|
+
});
|
|
17332
|
+
|
|
16546
17333
|
setBuildTimeData('features.conversationHistory', {
|
|
16547
17334
|
"id": "features.conversationHistory",
|
|
16548
17335
|
"description": "Persists conversations to disk using the diskCache feature (cacache). Each conversation is stored as a JSON blob keyed by ID, with metadata stored alongside for efficient listing and search without loading full message arrays.",
|
|
@@ -17023,6 +17810,460 @@ setBuildTimeData('features.conversationHistory', {
|
|
|
17023
17810
|
}
|
|
17024
17811
|
});
|
|
17025
17812
|
|
|
17813
|
+
setBuildTimeData('features.autoAssistant', {
|
|
17814
|
+
"id": "features.autoAssistant",
|
|
17815
|
+
"description": "An autonomous assistant that owns a lower-level Assistant instance and gates all tool calls through a permission system. Tools are stacked from feature bundles (fileTools, processManager, etc.) and each tool can be set to 'allow' (runs immediately), 'ask' (blocks until user approves/denies), or 'deny' (always rejected).",
|
|
17816
|
+
"shortcut": "features.autoAssistant",
|
|
17817
|
+
"className": "AutonomousAssistant",
|
|
17818
|
+
"methods": {
|
|
17819
|
+
"getPermission": {
|
|
17820
|
+
"description": "Get the effective permission level for a tool.",
|
|
17821
|
+
"parameters": {
|
|
17822
|
+
"toolName": {
|
|
17823
|
+
"type": "string",
|
|
17824
|
+
"description": "Parameter toolName"
|
|
17825
|
+
}
|
|
17826
|
+
},
|
|
17827
|
+
"required": [
|
|
17828
|
+
"toolName"
|
|
17829
|
+
],
|
|
17830
|
+
"returns": "PermissionLevel"
|
|
17831
|
+
},
|
|
17832
|
+
"setPermission": {
|
|
17833
|
+
"description": "Set permission level for one or more tools.",
|
|
17834
|
+
"parameters": {
|
|
17835
|
+
"toolName": {
|
|
17836
|
+
"type": "string | string[]",
|
|
17837
|
+
"description": "Parameter toolName"
|
|
17838
|
+
},
|
|
17839
|
+
"level": {
|
|
17840
|
+
"type": "PermissionLevel",
|
|
17841
|
+
"description": "Parameter level"
|
|
17842
|
+
}
|
|
17843
|
+
},
|
|
17844
|
+
"required": [
|
|
17845
|
+
"toolName",
|
|
17846
|
+
"level"
|
|
17847
|
+
],
|
|
17848
|
+
"returns": "this"
|
|
17849
|
+
},
|
|
17850
|
+
"setDefaultPermission": {
|
|
17851
|
+
"description": "Set the default permission level for unconfigured tools.",
|
|
17852
|
+
"parameters": {
|
|
17853
|
+
"level": {
|
|
17854
|
+
"type": "PermissionLevel",
|
|
17855
|
+
"description": "Parameter level"
|
|
17856
|
+
}
|
|
17857
|
+
},
|
|
17858
|
+
"required": [
|
|
17859
|
+
"level"
|
|
17860
|
+
],
|
|
17861
|
+
"returns": "this"
|
|
17862
|
+
},
|
|
17863
|
+
"permitTool": {
|
|
17864
|
+
"description": "Allow a tool (or tools) to run without approval.",
|
|
17865
|
+
"parameters": {
|
|
17866
|
+
"toolNames": {
|
|
17867
|
+
"type": "string[]",
|
|
17868
|
+
"description": "Parameter toolNames"
|
|
17869
|
+
}
|
|
17870
|
+
},
|
|
17871
|
+
"required": [
|
|
17872
|
+
"toolNames"
|
|
17873
|
+
],
|
|
17874
|
+
"returns": "this"
|
|
17875
|
+
},
|
|
17876
|
+
"gateTool": {
|
|
17877
|
+
"description": "Require approval before a tool (or tools) can run.",
|
|
17878
|
+
"parameters": {
|
|
17879
|
+
"toolNames": {
|
|
17880
|
+
"type": "string[]",
|
|
17881
|
+
"description": "Parameter toolNames"
|
|
17882
|
+
}
|
|
17883
|
+
},
|
|
17884
|
+
"required": [
|
|
17885
|
+
"toolNames"
|
|
17886
|
+
],
|
|
17887
|
+
"returns": "this"
|
|
17888
|
+
},
|
|
17889
|
+
"blockTool": {
|
|
17890
|
+
"description": "Block a tool (or tools) from ever running.",
|
|
17891
|
+
"parameters": {
|
|
17892
|
+
"toolNames": {
|
|
17893
|
+
"type": "string[]",
|
|
17894
|
+
"description": "Parameter toolNames"
|
|
17895
|
+
}
|
|
17896
|
+
},
|
|
17897
|
+
"required": [
|
|
17898
|
+
"toolNames"
|
|
17899
|
+
],
|
|
17900
|
+
"returns": "this"
|
|
17901
|
+
},
|
|
17902
|
+
"approve": {
|
|
17903
|
+
"description": "Approve a pending tool call by ID. The tool will execute.",
|
|
17904
|
+
"parameters": {
|
|
17905
|
+
"id": {
|
|
17906
|
+
"type": "string",
|
|
17907
|
+
"description": "Parameter id"
|
|
17908
|
+
}
|
|
17909
|
+
},
|
|
17910
|
+
"required": [
|
|
17911
|
+
"id"
|
|
17912
|
+
],
|
|
17913
|
+
"returns": "this"
|
|
17914
|
+
},
|
|
17915
|
+
"deny": {
|
|
17916
|
+
"description": "Deny a pending tool call by ID. The tool call will be skipped.",
|
|
17917
|
+
"parameters": {
|
|
17918
|
+
"id": {
|
|
17919
|
+
"type": "string",
|
|
17920
|
+
"description": "Parameter id"
|
|
17921
|
+
}
|
|
17922
|
+
},
|
|
17923
|
+
"required": [
|
|
17924
|
+
"id"
|
|
17925
|
+
],
|
|
17926
|
+
"returns": "this"
|
|
17927
|
+
},
|
|
17928
|
+
"approveAll": {
|
|
17929
|
+
"description": "Approve all pending tool calls.",
|
|
17930
|
+
"parameters": {},
|
|
17931
|
+
"required": [],
|
|
17932
|
+
"returns": "this"
|
|
17933
|
+
},
|
|
17934
|
+
"denyAll": {
|
|
17935
|
+
"description": "Deny all pending tool calls.",
|
|
17936
|
+
"parameters": {},
|
|
17937
|
+
"required": [],
|
|
17938
|
+
"returns": "this"
|
|
17939
|
+
},
|
|
17940
|
+
"start": {
|
|
17941
|
+
"description": "Initialize the inner assistant, stack tool bundles, and wire up the permission interceptor.",
|
|
17942
|
+
"parameters": {},
|
|
17943
|
+
"required": [],
|
|
17944
|
+
"returns": "Promise<this>"
|
|
17945
|
+
},
|
|
17946
|
+
"ask": {
|
|
17947
|
+
"description": "Ask the autonomous assistant a question. Auto-starts if needed. Tool calls will be gated by the permission system.",
|
|
17948
|
+
"parameters": {
|
|
17949
|
+
"question": {
|
|
17950
|
+
"type": "string",
|
|
17951
|
+
"description": "Parameter question"
|
|
17952
|
+
},
|
|
17953
|
+
"options": {
|
|
17954
|
+
"type": "Record<string, any>",
|
|
17955
|
+
"description": "Parameter options"
|
|
17956
|
+
}
|
|
17957
|
+
},
|
|
17958
|
+
"required": [
|
|
17959
|
+
"question"
|
|
17960
|
+
],
|
|
17961
|
+
"returns": "Promise<string>"
|
|
17962
|
+
},
|
|
17963
|
+
"use": {
|
|
17964
|
+
"description": "Add a tool bundle after initialization. Useful for dynamically extending the assistant's capabilities.",
|
|
17965
|
+
"parameters": {
|
|
17966
|
+
"spec": {
|
|
17967
|
+
"type": "ToolBundleSpec",
|
|
17968
|
+
"description": "Parameter spec"
|
|
17969
|
+
}
|
|
17970
|
+
},
|
|
17971
|
+
"required": [
|
|
17972
|
+
"spec"
|
|
17973
|
+
],
|
|
17974
|
+
"returns": "this"
|
|
17975
|
+
}
|
|
17976
|
+
},
|
|
17977
|
+
"getters": {
|
|
17978
|
+
"assistant": {
|
|
17979
|
+
"description": "The inner assistant. Throws if not started.",
|
|
17980
|
+
"returns": "Assistant"
|
|
17981
|
+
},
|
|
17982
|
+
"permissions": {
|
|
17983
|
+
"description": "Current permission map from state.",
|
|
17984
|
+
"returns": "Record<string, PermissionLevel>"
|
|
17985
|
+
},
|
|
17986
|
+
"pendingApprovals": {
|
|
17987
|
+
"description": "Current pending approvals.",
|
|
17988
|
+
"returns": "PendingApproval[]"
|
|
17989
|
+
},
|
|
17990
|
+
"isStarted": {
|
|
17991
|
+
"description": "Whether the assistant is started and ready.",
|
|
17992
|
+
"returns": "boolean"
|
|
17993
|
+
},
|
|
17994
|
+
"tools": {
|
|
17995
|
+
"description": "The tools registered on the inner assistant.",
|
|
17996
|
+
"returns": "Record<string, any>"
|
|
17997
|
+
},
|
|
17998
|
+
"conversation": {
|
|
17999
|
+
"description": "The conversation on the inner assistant (if started).",
|
|
18000
|
+
"returns": "any"
|
|
18001
|
+
},
|
|
18002
|
+
"messages": {
|
|
18003
|
+
"description": "Messages from the inner assistant's conversation.",
|
|
18004
|
+
"returns": "any"
|
|
18005
|
+
}
|
|
18006
|
+
},
|
|
18007
|
+
"events": {
|
|
18008
|
+
"permissionGranted": {
|
|
18009
|
+
"name": "permissionGranted",
|
|
18010
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18011
|
+
"arguments": {}
|
|
18012
|
+
},
|
|
18013
|
+
"permissionDenied": {
|
|
18014
|
+
"name": "permissionDenied",
|
|
18015
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18016
|
+
"arguments": {}
|
|
18017
|
+
},
|
|
18018
|
+
"toolBlocked": {
|
|
18019
|
+
"name": "toolBlocked",
|
|
18020
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18021
|
+
"arguments": {}
|
|
18022
|
+
},
|
|
18023
|
+
"chunk": {
|
|
18024
|
+
"name": "chunk",
|
|
18025
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18026
|
+
"arguments": {}
|
|
18027
|
+
},
|
|
18028
|
+
"response": {
|
|
18029
|
+
"name": "response",
|
|
18030
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18031
|
+
"arguments": {}
|
|
18032
|
+
},
|
|
18033
|
+
"toolCall": {
|
|
18034
|
+
"name": "toolCall",
|
|
18035
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18036
|
+
"arguments": {}
|
|
18037
|
+
},
|
|
18038
|
+
"toolResult": {
|
|
18039
|
+
"name": "toolResult",
|
|
18040
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18041
|
+
"arguments": {}
|
|
18042
|
+
},
|
|
18043
|
+
"toolError": {
|
|
18044
|
+
"name": "toolError",
|
|
18045
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18046
|
+
"arguments": {}
|
|
18047
|
+
},
|
|
18048
|
+
"started": {
|
|
18049
|
+
"name": "started",
|
|
18050
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18051
|
+
"arguments": {}
|
|
18052
|
+
},
|
|
18053
|
+
"permissionRequest": {
|
|
18054
|
+
"name": "permissionRequest",
|
|
18055
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
18056
|
+
"arguments": {}
|
|
18057
|
+
}
|
|
18058
|
+
},
|
|
18059
|
+
"state": {},
|
|
18060
|
+
"options": {},
|
|
18061
|
+
"envVars": [],
|
|
18062
|
+
"examples": [
|
|
18063
|
+
{
|
|
18064
|
+
"language": "ts",
|
|
18065
|
+
"code": "const auto = container.feature('autoAssistant', {\n tools: ['fileTools', { feature: 'processManager', except: ['killAllProcesses'] }],\n permissions: {\n readFile: 'allow',\n searchFiles: 'allow',\n writeFile: 'ask',\n editFile: 'ask',\n deleteFile: 'deny',\n },\n defaultPermission: 'ask',\n systemPrompt: 'You are a coding assistant.',\n})\n\nauto.on('permissionRequest', ({ id, toolName, args }) => {\n console.log(`Tool \"${toolName}\" wants to run with`, args)\n // Show UI, then:\n auto.approve(id) // or auto.deny(id)\n})\n\nawait auto.ask('Refactor the auth module to use async/await')"
|
|
18066
|
+
}
|
|
18067
|
+
],
|
|
18068
|
+
"types": {
|
|
18069
|
+
"PendingApproval": {
|
|
18070
|
+
"description": "A pending approval awaiting user decision.",
|
|
18071
|
+
"properties": {
|
|
18072
|
+
"id": {
|
|
18073
|
+
"type": "string",
|
|
18074
|
+
"description": ""
|
|
18075
|
+
},
|
|
18076
|
+
"toolName": {
|
|
18077
|
+
"type": "string",
|
|
18078
|
+
"description": ""
|
|
18079
|
+
},
|
|
18080
|
+
"args": {
|
|
18081
|
+
"type": "Record<string, any>",
|
|
18082
|
+
"description": ""
|
|
18083
|
+
},
|
|
18084
|
+
"timestamp": {
|
|
18085
|
+
"type": "number",
|
|
18086
|
+
"description": ""
|
|
18087
|
+
},
|
|
18088
|
+
"resolve": {
|
|
18089
|
+
"type": "(decision: 'approve' | 'deny') => void",
|
|
18090
|
+
"description": ""
|
|
18091
|
+
}
|
|
18092
|
+
}
|
|
18093
|
+
}
|
|
18094
|
+
}
|
|
18095
|
+
});
|
|
18096
|
+
|
|
18097
|
+
setBuildTimeData('features.fileTools', {
|
|
18098
|
+
"id": "features.fileTools",
|
|
18099
|
+
"description": "Curated file-system and code-search tools for AI assistants. Wraps the container's `fs` and `grep` features into a focused tool surface modeled on the tools that coding assistants (Claude Code, Cursor, etc.) rely on: read, write, edit, list, search, find, stat, mkdir, move, copy, delete. Usage: ```typescript const fileTools = container.feature('fileTools') assistant.use(fileTools) // or selectively: assistant.use(fileTools.toTools({ only: ['readFile', 'searchFiles', 'listDirectory'] })) ```",
|
|
18100
|
+
"shortcut": "features.fileTools",
|
|
18101
|
+
"className": "FileTools",
|
|
18102
|
+
"methods": {
|
|
18103
|
+
"readFile": {
|
|
18104
|
+
"description": "",
|
|
18105
|
+
"parameters": {
|
|
18106
|
+
"args": {
|
|
18107
|
+
"type": "{ path: string; offset?: number; limit?: number }",
|
|
18108
|
+
"description": "Parameter args"
|
|
18109
|
+
}
|
|
18110
|
+
},
|
|
18111
|
+
"required": [
|
|
18112
|
+
"args"
|
|
18113
|
+
],
|
|
18114
|
+
"returns": "Promise<string>"
|
|
18115
|
+
},
|
|
18116
|
+
"writeFile": {
|
|
18117
|
+
"description": "",
|
|
18118
|
+
"parameters": {
|
|
18119
|
+
"args": {
|
|
18120
|
+
"type": "{ path: string; content: string }",
|
|
18121
|
+
"description": "Parameter args"
|
|
18122
|
+
}
|
|
18123
|
+
},
|
|
18124
|
+
"required": [
|
|
18125
|
+
"args"
|
|
18126
|
+
],
|
|
18127
|
+
"returns": "Promise<string>"
|
|
18128
|
+
},
|
|
18129
|
+
"editFile": {
|
|
18130
|
+
"description": "",
|
|
18131
|
+
"parameters": {
|
|
18132
|
+
"args": {
|
|
18133
|
+
"type": "{ path: string; oldString: string; newString: string; replaceAll?: boolean }",
|
|
18134
|
+
"description": "Parameter args"
|
|
18135
|
+
}
|
|
18136
|
+
},
|
|
18137
|
+
"required": [
|
|
18138
|
+
"args"
|
|
18139
|
+
],
|
|
18140
|
+
"returns": "Promise<string>"
|
|
18141
|
+
},
|
|
18142
|
+
"listDirectory": {
|
|
18143
|
+
"description": "",
|
|
18144
|
+
"parameters": {
|
|
18145
|
+
"args": {
|
|
18146
|
+
"type": "{ path?: string; recursive?: boolean; include?: string; exclude?: string }",
|
|
18147
|
+
"description": "Parameter args"
|
|
18148
|
+
}
|
|
18149
|
+
},
|
|
18150
|
+
"required": [
|
|
18151
|
+
"args"
|
|
18152
|
+
],
|
|
18153
|
+
"returns": "Promise<string>"
|
|
18154
|
+
},
|
|
18155
|
+
"searchFiles": {
|
|
18156
|
+
"description": "",
|
|
18157
|
+
"parameters": {
|
|
18158
|
+
"args": {
|
|
18159
|
+
"type": "{ pattern: string; path?: string; include?: string; exclude?: string; ignoreCase?: boolean; maxResults?: number }",
|
|
18160
|
+
"description": "Parameter args"
|
|
18161
|
+
}
|
|
18162
|
+
},
|
|
18163
|
+
"required": [
|
|
18164
|
+
"args"
|
|
18165
|
+
],
|
|
18166
|
+
"returns": "Promise<string>"
|
|
18167
|
+
},
|
|
18168
|
+
"findFiles": {
|
|
18169
|
+
"description": "",
|
|
18170
|
+
"parameters": {
|
|
18171
|
+
"args": {
|
|
18172
|
+
"type": "{ pattern: string; path?: string; exclude?: string }",
|
|
18173
|
+
"description": "Parameter args"
|
|
18174
|
+
}
|
|
18175
|
+
},
|
|
18176
|
+
"required": [
|
|
18177
|
+
"args"
|
|
18178
|
+
],
|
|
18179
|
+
"returns": "Promise<string>"
|
|
18180
|
+
},
|
|
18181
|
+
"fileInfo": {
|
|
18182
|
+
"description": "",
|
|
18183
|
+
"parameters": {
|
|
18184
|
+
"args": {
|
|
18185
|
+
"type": "{ path: string }",
|
|
18186
|
+
"description": "Parameter args"
|
|
18187
|
+
}
|
|
18188
|
+
},
|
|
18189
|
+
"required": [
|
|
18190
|
+
"args"
|
|
18191
|
+
],
|
|
18192
|
+
"returns": "Promise<string>"
|
|
18193
|
+
},
|
|
18194
|
+
"createDirectory": {
|
|
18195
|
+
"description": "",
|
|
18196
|
+
"parameters": {
|
|
18197
|
+
"args": {
|
|
18198
|
+
"type": "{ path: string }",
|
|
18199
|
+
"description": "Parameter args"
|
|
18200
|
+
}
|
|
18201
|
+
},
|
|
18202
|
+
"required": [
|
|
18203
|
+
"args"
|
|
18204
|
+
],
|
|
18205
|
+
"returns": "Promise<string>"
|
|
18206
|
+
},
|
|
18207
|
+
"moveFile": {
|
|
18208
|
+
"description": "",
|
|
18209
|
+
"parameters": {
|
|
18210
|
+
"args": {
|
|
18211
|
+
"type": "{ source: string; destination: string }",
|
|
18212
|
+
"description": "Parameter args"
|
|
18213
|
+
}
|
|
18214
|
+
},
|
|
18215
|
+
"required": [
|
|
18216
|
+
"args"
|
|
18217
|
+
],
|
|
18218
|
+
"returns": "Promise<string>"
|
|
18219
|
+
},
|
|
18220
|
+
"copyFile": {
|
|
18221
|
+
"description": "",
|
|
18222
|
+
"parameters": {
|
|
18223
|
+
"args": {
|
|
18224
|
+
"type": "{ source: string; destination: string }",
|
|
18225
|
+
"description": "Parameter args"
|
|
18226
|
+
}
|
|
18227
|
+
},
|
|
18228
|
+
"required": [
|
|
18229
|
+
"args"
|
|
18230
|
+
],
|
|
18231
|
+
"returns": "Promise<string>"
|
|
18232
|
+
},
|
|
18233
|
+
"deleteFile": {
|
|
18234
|
+
"description": "",
|
|
18235
|
+
"parameters": {
|
|
18236
|
+
"args": {
|
|
18237
|
+
"type": "{ path: string }",
|
|
18238
|
+
"description": "Parameter args"
|
|
18239
|
+
}
|
|
18240
|
+
},
|
|
18241
|
+
"required": [
|
|
18242
|
+
"args"
|
|
18243
|
+
],
|
|
18244
|
+
"returns": "Promise<string>"
|
|
18245
|
+
},
|
|
18246
|
+
"setupToolsConsumer": {
|
|
18247
|
+
"description": "When an assistant uses fileTools, inject system prompt guidance about how to use the tools effectively.",
|
|
18248
|
+
"parameters": {
|
|
18249
|
+
"consumer": {
|
|
18250
|
+
"type": "Helper",
|
|
18251
|
+
"description": "Parameter consumer"
|
|
18252
|
+
}
|
|
18253
|
+
},
|
|
18254
|
+
"required": [
|
|
18255
|
+
"consumer"
|
|
18256
|
+
],
|
|
18257
|
+
"returns": "void"
|
|
18258
|
+
}
|
|
18259
|
+
},
|
|
18260
|
+
"getters": {},
|
|
18261
|
+
"events": {},
|
|
18262
|
+
"state": {},
|
|
18263
|
+
"options": {},
|
|
18264
|
+
"envVars": []
|
|
18265
|
+
});
|
|
18266
|
+
|
|
17026
18267
|
// Container introspection data
|
|
17027
18268
|
setContainerBuildTimeData('Container', {
|
|
17028
18269
|
"className": "Container",
|
|
@@ -17254,7 +18495,7 @@ setContainerBuildTimeData('Container', {
|
|
|
17254
18495
|
}
|
|
17255
18496
|
]
|
|
17256
18497
|
},
|
|
17257
|
-
"
|
|
18498
|
+
"introspect": {
|
|
17258
18499
|
"description": "Returns a full introspection object for this container, merging build-time AST data (JSDoc descriptions, methods, getters) with runtime data (registries, factories, state, environment).",
|
|
17259
18500
|
"parameters": {},
|
|
17260
18501
|
"required": [],
|
|
@@ -17262,11 +18503,11 @@ setContainerBuildTimeData('Container', {
|
|
|
17262
18503
|
"examples": [
|
|
17263
18504
|
{
|
|
17264
18505
|
"language": "ts",
|
|
17265
|
-
"code": "const info = container.
|
|
18506
|
+
"code": "const info = container.introspect()\nconsole.log(info.methods) // all public methods with descriptions\nconsole.log(info.getters) // all getters with return types\nconsole.log(info.registries) // features, clients, servers, etc."
|
|
17266
18507
|
}
|
|
17267
18508
|
]
|
|
17268
18509
|
},
|
|
17269
|
-
"
|
|
18510
|
+
"introspectAsText": {
|
|
17270
18511
|
"description": "Returns a human-readable markdown representation of this container's introspection data. Useful in REPLs, AI agent contexts, or documentation generation. Pass a section name to render only that section (e.g. 'methods', 'getters', 'events', 'state').",
|
|
17271
18512
|
"parameters": {
|
|
17272
18513
|
"sectionOrDepth": {
|
|
@@ -17283,32 +18524,17 @@ setContainerBuildTimeData('Container', {
|
|
|
17283
18524
|
"examples": [
|
|
17284
18525
|
{
|
|
17285
18526
|
"language": "ts",
|
|
17286
|
-
"code": "console.log(container.
|
|
18527
|
+
"code": "console.log(container.introspectAsText()) // full description\nconsole.log(container.introspectAsText('methods')) // just methods"
|
|
17287
18528
|
}
|
|
17288
18529
|
]
|
|
17289
18530
|
},
|
|
17290
|
-
"introspectAsText": {
|
|
17291
|
-
"description": "Alias for inspectAsText.",
|
|
17292
|
-
"parameters": {
|
|
17293
|
-
"sectionOrDepth": {
|
|
17294
|
-
"type": "IntrospectionSection | number",
|
|
17295
|
-
"description": "Parameter sectionOrDepth"
|
|
17296
|
-
},
|
|
17297
|
-
"startHeadingDepth": {
|
|
17298
|
-
"type": "number",
|
|
17299
|
-
"description": "Parameter startHeadingDepth"
|
|
17300
|
-
}
|
|
17301
|
-
},
|
|
17302
|
-
"required": [],
|
|
17303
|
-
"returns": "string"
|
|
17304
|
-
},
|
|
17305
18531
|
"introspectAsJSON": {
|
|
17306
|
-
"description": "
|
|
18532
|
+
"description": "Returns JSON introspection data.",
|
|
17307
18533
|
"parameters": {},
|
|
17308
18534
|
"required": [],
|
|
17309
18535
|
"returns": "ContainerIntrospection"
|
|
17310
18536
|
},
|
|
17311
|
-
"
|
|
18537
|
+
"introspectAsType": {
|
|
17312
18538
|
"description": "Returns the container's introspection data formatted as a TypeScript interface declaration. Includes the container's own methods, getters, factories, and registered helper types.",
|
|
17313
18539
|
"parameters": {},
|
|
17314
18540
|
"required": [],
|
|
@@ -17316,16 +18542,10 @@ setContainerBuildTimeData('Container', {
|
|
|
17316
18542
|
"examples": [
|
|
17317
18543
|
{
|
|
17318
18544
|
"language": "ts",
|
|
17319
|
-
"code": "console.log(container.
|
|
18545
|
+
"code": "console.log(container.introspectAsType())\n// interface NodeContainer {\n// feature<T>(id: string, options?: object): T;\n// readonly uuid: string;\n// ...\n// }"
|
|
17320
18546
|
}
|
|
17321
18547
|
]
|
|
17322
18548
|
},
|
|
17323
|
-
"introspectAsType": {
|
|
17324
|
-
"description": "",
|
|
17325
|
-
"parameters": {},
|
|
17326
|
-
"required": [],
|
|
17327
|
-
"returns": "string"
|
|
17328
|
-
},
|
|
17329
18549
|
"sleep": {
|
|
17330
18550
|
"description": "Sleep for the specified number of milliseconds. Useful for scripting and sequencing.",
|
|
17331
18551
|
"parameters": {
|
|
@@ -23428,6 +24648,311 @@ export const introspectionData = [
|
|
|
23428
24648
|
}
|
|
23429
24649
|
}
|
|
23430
24650
|
},
|
|
24651
|
+
{
|
|
24652
|
+
"id": "features.redis",
|
|
24653
|
+
"description": "Redis feature for shared state and pub/sub communication between container instances. Wraps ioredis with a focused API for the primitives that matter most: key/value state, pub/sub messaging, and cross-instance coordination. Uses a dedicated subscriber connection for pub/sub (ioredis requirement), created lazily on first subscribe call.",
|
|
24654
|
+
"shortcut": "features.redis",
|
|
24655
|
+
"className": "RedisFeature",
|
|
24656
|
+
"methods": {
|
|
24657
|
+
"set": {
|
|
24658
|
+
"description": "Set a key to a string value with optional TTL.",
|
|
24659
|
+
"parameters": {
|
|
24660
|
+
"key": {
|
|
24661
|
+
"type": "string",
|
|
24662
|
+
"description": "The key name"
|
|
24663
|
+
},
|
|
24664
|
+
"value": {
|
|
24665
|
+
"type": "string",
|
|
24666
|
+
"description": "The string value to store"
|
|
24667
|
+
},
|
|
24668
|
+
"ttl": {
|
|
24669
|
+
"type": "number",
|
|
24670
|
+
"description": "Optional time-to-live in seconds"
|
|
24671
|
+
}
|
|
24672
|
+
},
|
|
24673
|
+
"required": [
|
|
24674
|
+
"key",
|
|
24675
|
+
"value"
|
|
24676
|
+
],
|
|
24677
|
+
"returns": "Promise<void>"
|
|
24678
|
+
},
|
|
24679
|
+
"get": {
|
|
24680
|
+
"description": "Get a key's value. Returns null if the key doesn't exist.",
|
|
24681
|
+
"parameters": {
|
|
24682
|
+
"key": {
|
|
24683
|
+
"type": "string",
|
|
24684
|
+
"description": "The key name"
|
|
24685
|
+
}
|
|
24686
|
+
},
|
|
24687
|
+
"required": [
|
|
24688
|
+
"key"
|
|
24689
|
+
],
|
|
24690
|
+
"returns": "Promise<string | null>"
|
|
24691
|
+
},
|
|
24692
|
+
"del": {
|
|
24693
|
+
"description": "Delete one or more keys.",
|
|
24694
|
+
"parameters": {
|
|
24695
|
+
"keys": {
|
|
24696
|
+
"type": "string[]",
|
|
24697
|
+
"description": "One or more key names to delete"
|
|
24698
|
+
}
|
|
24699
|
+
},
|
|
24700
|
+
"required": [
|
|
24701
|
+
"keys"
|
|
24702
|
+
],
|
|
24703
|
+
"returns": "Promise<number>"
|
|
24704
|
+
},
|
|
24705
|
+
"exists": {
|
|
24706
|
+
"description": "Check if a key exists.",
|
|
24707
|
+
"parameters": {
|
|
24708
|
+
"key": {
|
|
24709
|
+
"type": "string",
|
|
24710
|
+
"description": "The key name"
|
|
24711
|
+
}
|
|
24712
|
+
},
|
|
24713
|
+
"required": [
|
|
24714
|
+
"key"
|
|
24715
|
+
],
|
|
24716
|
+
"returns": "Promise<boolean>"
|
|
24717
|
+
},
|
|
24718
|
+
"expire": {
|
|
24719
|
+
"description": "Set a key's TTL in seconds.",
|
|
24720
|
+
"parameters": {
|
|
24721
|
+
"key": {
|
|
24722
|
+
"type": "string",
|
|
24723
|
+
"description": "The key name"
|
|
24724
|
+
},
|
|
24725
|
+
"seconds": {
|
|
24726
|
+
"type": "number",
|
|
24727
|
+
"description": "TTL in seconds"
|
|
24728
|
+
}
|
|
24729
|
+
},
|
|
24730
|
+
"required": [
|
|
24731
|
+
"key",
|
|
24732
|
+
"seconds"
|
|
24733
|
+
],
|
|
24734
|
+
"returns": "Promise<boolean>"
|
|
24735
|
+
},
|
|
24736
|
+
"keys": {
|
|
24737
|
+
"description": "Find keys matching a glob pattern (respects prefix).",
|
|
24738
|
+
"parameters": {
|
|
24739
|
+
"pattern": {
|
|
24740
|
+
"type": "string",
|
|
24741
|
+
"description": "Glob pattern, e.g. \"worker:*\""
|
|
24742
|
+
}
|
|
24743
|
+
},
|
|
24744
|
+
"required": [],
|
|
24745
|
+
"returns": "Promise<string[]>"
|
|
24746
|
+
},
|
|
24747
|
+
"setJSON": {
|
|
24748
|
+
"description": "Store a value as JSON.",
|
|
24749
|
+
"parameters": {
|
|
24750
|
+
"key": {
|
|
24751
|
+
"type": "string",
|
|
24752
|
+
"description": "The key name"
|
|
24753
|
+
},
|
|
24754
|
+
"value": {
|
|
24755
|
+
"type": "unknown",
|
|
24756
|
+
"description": "Any JSON-serializable value"
|
|
24757
|
+
},
|
|
24758
|
+
"ttl": {
|
|
24759
|
+
"type": "number",
|
|
24760
|
+
"description": "Optional TTL in seconds"
|
|
24761
|
+
}
|
|
24762
|
+
},
|
|
24763
|
+
"required": [
|
|
24764
|
+
"key",
|
|
24765
|
+
"value"
|
|
24766
|
+
],
|
|
24767
|
+
"returns": "Promise<void>"
|
|
24768
|
+
},
|
|
24769
|
+
"getJSON": {
|
|
24770
|
+
"description": "Retrieve and parse a JSON value.",
|
|
24771
|
+
"parameters": {
|
|
24772
|
+
"key": {
|
|
24773
|
+
"type": "string",
|
|
24774
|
+
"description": "The key name"
|
|
24775
|
+
}
|
|
24776
|
+
},
|
|
24777
|
+
"required": [
|
|
24778
|
+
"key"
|
|
24779
|
+
],
|
|
24780
|
+
"returns": "Promise<T | null>"
|
|
24781
|
+
},
|
|
24782
|
+
"hset": {
|
|
24783
|
+
"description": "Set fields on a hash.",
|
|
24784
|
+
"parameters": {
|
|
24785
|
+
"key": {
|
|
24786
|
+
"type": "string",
|
|
24787
|
+
"description": "The hash key"
|
|
24788
|
+
},
|
|
24789
|
+
"fields": {
|
|
24790
|
+
"type": "Record<string, string>",
|
|
24791
|
+
"description": "Object of field/value pairs"
|
|
24792
|
+
}
|
|
24793
|
+
},
|
|
24794
|
+
"required": [
|
|
24795
|
+
"key",
|
|
24796
|
+
"fields"
|
|
24797
|
+
],
|
|
24798
|
+
"returns": "Promise<void>"
|
|
24799
|
+
},
|
|
24800
|
+
"hgetall": {
|
|
24801
|
+
"description": "Get all fields from a hash.",
|
|
24802
|
+
"parameters": {
|
|
24803
|
+
"key": {
|
|
24804
|
+
"type": "string",
|
|
24805
|
+
"description": "The hash key"
|
|
24806
|
+
}
|
|
24807
|
+
},
|
|
24808
|
+
"required": [
|
|
24809
|
+
"key"
|
|
24810
|
+
],
|
|
24811
|
+
"returns": "Promise<Record<string, string>>"
|
|
24812
|
+
},
|
|
24813
|
+
"hget": {
|
|
24814
|
+
"description": "Get a single field from a hash.",
|
|
24815
|
+
"parameters": {
|
|
24816
|
+
"key": {
|
|
24817
|
+
"type": "string",
|
|
24818
|
+
"description": "The hash key"
|
|
24819
|
+
},
|
|
24820
|
+
"field": {
|
|
24821
|
+
"type": "string",
|
|
24822
|
+
"description": "The field name"
|
|
24823
|
+
}
|
|
24824
|
+
},
|
|
24825
|
+
"required": [
|
|
24826
|
+
"key",
|
|
24827
|
+
"field"
|
|
24828
|
+
],
|
|
24829
|
+
"returns": "Promise<string | null>"
|
|
24830
|
+
},
|
|
24831
|
+
"subscribe": {
|
|
24832
|
+
"description": "Subscribe to one or more channels. Optionally pass a handler that fires only for these channels. The feature also emits a `message` event for all messages.",
|
|
24833
|
+
"parameters": {
|
|
24834
|
+
"channels": {
|
|
24835
|
+
"type": "string | string[]",
|
|
24836
|
+
"description": "Channel name(s) to subscribe to"
|
|
24837
|
+
},
|
|
24838
|
+
"handler": {
|
|
24839
|
+
"type": "MessageHandler",
|
|
24840
|
+
"description": "Optional per-channel message handler"
|
|
24841
|
+
}
|
|
24842
|
+
},
|
|
24843
|
+
"required": [
|
|
24844
|
+
"channels"
|
|
24845
|
+
],
|
|
24846
|
+
"returns": "Promise<void>",
|
|
24847
|
+
"examples": [
|
|
24848
|
+
{
|
|
24849
|
+
"language": "ts",
|
|
24850
|
+
"code": "await redis.subscribe('tasks', (channel, msg) => {\n console.log(`Got ${msg} on ${channel}`)\n})"
|
|
24851
|
+
}
|
|
24852
|
+
]
|
|
24853
|
+
},
|
|
24854
|
+
"unsubscribe": {
|
|
24855
|
+
"description": "Unsubscribe from one or more channels.",
|
|
24856
|
+
"parameters": {
|
|
24857
|
+
"channels": {
|
|
24858
|
+
"type": "string[]",
|
|
24859
|
+
"description": "Channel name(s) to unsubscribe from"
|
|
24860
|
+
}
|
|
24861
|
+
},
|
|
24862
|
+
"required": [
|
|
24863
|
+
"channels"
|
|
24864
|
+
],
|
|
24865
|
+
"returns": "Promise<void>"
|
|
24866
|
+
},
|
|
24867
|
+
"publish": {
|
|
24868
|
+
"description": "Publish a message to a channel.",
|
|
24869
|
+
"parameters": {
|
|
24870
|
+
"channel": {
|
|
24871
|
+
"type": "string",
|
|
24872
|
+
"description": "The channel to publish to"
|
|
24873
|
+
},
|
|
24874
|
+
"message": {
|
|
24875
|
+
"type": "string",
|
|
24876
|
+
"description": "The message string (use JSON.stringify for objects)"
|
|
24877
|
+
}
|
|
24878
|
+
},
|
|
24879
|
+
"required": [
|
|
24880
|
+
"channel",
|
|
24881
|
+
"message"
|
|
24882
|
+
],
|
|
24883
|
+
"returns": "Promise<number>"
|
|
24884
|
+
},
|
|
24885
|
+
"ensureLocalDocker": {
|
|
24886
|
+
"description": "Spin up a local Redis instance via Docker. Checks if a container with the given name already exists and starts it if stopped, or creates a new one from redis:alpine. Requires the docker feature to be available on the container.",
|
|
24887
|
+
"parameters": {
|
|
24888
|
+
"options": {
|
|
24889
|
+
"type": "{ name?: string; port?: number; image?: string }",
|
|
24890
|
+
"description": "Container name and host port"
|
|
24891
|
+
}
|
|
24892
|
+
},
|
|
24893
|
+
"required": [],
|
|
24894
|
+
"returns": "Promise<string>",
|
|
24895
|
+
"examples": [
|
|
24896
|
+
{
|
|
24897
|
+
"language": "ts",
|
|
24898
|
+
"code": "const redis = container.feature('redis', { url: 'redis://localhost:6379', lazyConnect: true })\nawait redis.ensureLocalDocker()"
|
|
24899
|
+
}
|
|
24900
|
+
]
|
|
24901
|
+
},
|
|
24902
|
+
"close": {
|
|
24903
|
+
"description": "Close all redis connections (main client + subscriber).",
|
|
24904
|
+
"parameters": {},
|
|
24905
|
+
"required": [],
|
|
24906
|
+
"returns": "Promise<this>"
|
|
24907
|
+
}
|
|
24908
|
+
},
|
|
24909
|
+
"getters": {
|
|
24910
|
+
"client": {
|
|
24911
|
+
"description": "The underlying ioredis client for advanced operations.",
|
|
24912
|
+
"returns": "Redis"
|
|
24913
|
+
},
|
|
24914
|
+
"subscriber": {
|
|
24915
|
+
"description": "The dedicated subscriber connection, if pub/sub is active.",
|
|
24916
|
+
"returns": "Redis | null"
|
|
24917
|
+
}
|
|
24918
|
+
},
|
|
24919
|
+
"events": {
|
|
24920
|
+
"message": {
|
|
24921
|
+
"name": "message",
|
|
24922
|
+
"description": "Event emitted by RedisFeature",
|
|
24923
|
+
"arguments": {}
|
|
24924
|
+
},
|
|
24925
|
+
"error": {
|
|
24926
|
+
"name": "error",
|
|
24927
|
+
"description": "Event emitted by RedisFeature",
|
|
24928
|
+
"arguments": {}
|
|
24929
|
+
},
|
|
24930
|
+
"subscribed": {
|
|
24931
|
+
"name": "subscribed",
|
|
24932
|
+
"description": "Event emitted by RedisFeature",
|
|
24933
|
+
"arguments": {}
|
|
24934
|
+
},
|
|
24935
|
+
"unsubscribed": {
|
|
24936
|
+
"name": "unsubscribed",
|
|
24937
|
+
"description": "Event emitted by RedisFeature",
|
|
24938
|
+
"arguments": {}
|
|
24939
|
+
},
|
|
24940
|
+
"closed": {
|
|
24941
|
+
"name": "closed",
|
|
24942
|
+
"description": "Event emitted by RedisFeature",
|
|
24943
|
+
"arguments": {}
|
|
24944
|
+
}
|
|
24945
|
+
},
|
|
24946
|
+
"state": {},
|
|
24947
|
+
"options": {},
|
|
24948
|
+
"envVars": [],
|
|
24949
|
+
"examples": [
|
|
24950
|
+
{
|
|
24951
|
+
"language": "ts",
|
|
24952
|
+
"code": "const redis = container.feature('redis', { url: 'redis://localhost:6379' })\n\n// Shared state\nawait redis.set('worker:status', 'active')\nconst status = await redis.get('worker:status')\n\n// Pub/sub between instances\nredis.on('message', (channel, msg) => console.log(`${channel}: ${msg}`))\nawait redis.subscribe('tasks')\nawait redis.publish('tasks', JSON.stringify({ type: 'ping' }))\n\n// JSON helpers\nawait redis.setJSON('config', { workers: 4, debug: true })\nconst config = await redis.getJSON<{ workers: number }>('config')"
|
|
24953
|
+
}
|
|
24954
|
+
]
|
|
24955
|
+
},
|
|
23431
24956
|
{
|
|
23432
24957
|
"id": "features.fs",
|
|
23433
24958
|
"description": "The FS feature provides methods for interacting with the file system, relative to the container's cwd.",
|
|
@@ -25063,7 +26588,7 @@ export const introspectionData = [
|
|
|
25063
26588
|
},
|
|
25064
26589
|
{
|
|
25065
26590
|
"id": "features.python",
|
|
25066
|
-
"description": "The Python VM feature provides Python virtual machine capabilities for executing Python code. This feature automatically detects Python environments (uv, conda, venv, system) and provides methods to install dependencies and execute Python scripts. It can manage project-specific Python environments and maintain context between executions.",
|
|
26591
|
+
"description": "The Python VM feature provides Python virtual machine capabilities for executing Python code. This feature automatically detects Python environments (uv, conda, venv, system) and provides methods to install dependencies and execute Python scripts. It can manage project-specific Python environments and maintain context between executions. Supports two modes: - **Stateless** (default): `execute()` and `executeFile()` spawn a fresh process per call - **Persistent session**: `startSession()` spawns a long-lived bridge process that maintains state across `run()` calls, enabling real codebase interaction with imports and session variables",
|
|
25067
26592
|
"shortcut": "features.python",
|
|
25068
26593
|
"className": "Python",
|
|
25069
26594
|
"methods": {
|
|
@@ -25163,6 +26688,146 @@ export const introspectionData = [
|
|
|
25163
26688
|
"parameters": {},
|
|
25164
26689
|
"required": [],
|
|
25165
26690
|
"returns": "Promise<{ version: string; path: string; packages: string[] }>"
|
|
26691
|
+
},
|
|
26692
|
+
"startSession": {
|
|
26693
|
+
"description": "Starts a persistent Python session by spawning the bridge process. The bridge sets up sys.path for the project directory, then enters a JSON-line REPL loop. State (variables, imports) persists across run() calls until stopSession() or resetSession() is called.",
|
|
26694
|
+
"parameters": {},
|
|
26695
|
+
"required": [],
|
|
26696
|
+
"returns": "Promise<void>",
|
|
26697
|
+
"examples": [
|
|
26698
|
+
{
|
|
26699
|
+
"language": "ts",
|
|
26700
|
+
"code": "const python = container.feature('python', { dir: '/path/to/project' })\nawait python.enable()\nawait python.startSession()\nawait python.run('x = 42')\nconst result = await python.run('print(x)')\nconsole.log(result.stdout) // '42\\n'\nawait python.stopSession()"
|
|
26701
|
+
}
|
|
26702
|
+
]
|
|
26703
|
+
},
|
|
26704
|
+
"stopSession": {
|
|
26705
|
+
"description": "Stops the persistent Python session and cleans up the bridge process.",
|
|
26706
|
+
"parameters": {},
|
|
26707
|
+
"required": [],
|
|
26708
|
+
"returns": "Promise<void>",
|
|
26709
|
+
"examples": [
|
|
26710
|
+
{
|
|
26711
|
+
"language": "ts",
|
|
26712
|
+
"code": "await python.stopSession()"
|
|
26713
|
+
}
|
|
26714
|
+
]
|
|
26715
|
+
},
|
|
26716
|
+
"run": {
|
|
26717
|
+
"description": "Executes Python code in the persistent session. Variables and imports survive across calls. This is the session equivalent of execute().",
|
|
26718
|
+
"parameters": {
|
|
26719
|
+
"code": {
|
|
26720
|
+
"type": "string",
|
|
26721
|
+
"description": "Python code to execute"
|
|
26722
|
+
},
|
|
26723
|
+
"variables": {
|
|
26724
|
+
"type": "Record<string, any>",
|
|
26725
|
+
"description": "Variables to inject into the namespace before execution"
|
|
26726
|
+
}
|
|
26727
|
+
},
|
|
26728
|
+
"required": [
|
|
26729
|
+
"code"
|
|
26730
|
+
],
|
|
26731
|
+
"returns": "Promise<RunResult>",
|
|
26732
|
+
"examples": [
|
|
26733
|
+
{
|
|
26734
|
+
"language": "ts",
|
|
26735
|
+
"code": "await python.startSession()\n\n// State persists across calls\nawait python.run('x = 42')\nconst result = await python.run('print(x * 2)')\nconsole.log(result.stdout) // '84\\n'\n\n// Inject variables from JS\nconst result2 = await python.run('print(f\"Hello {name}!\")', { name: 'World' })\nconsole.log(result2.stdout) // 'Hello World!\\n'"
|
|
26736
|
+
}
|
|
26737
|
+
]
|
|
26738
|
+
},
|
|
26739
|
+
"eval": {
|
|
26740
|
+
"description": "Evaluates a Python expression in the persistent session and returns its value.",
|
|
26741
|
+
"parameters": {
|
|
26742
|
+
"expression": {
|
|
26743
|
+
"type": "string",
|
|
26744
|
+
"description": "Python expression to evaluate"
|
|
26745
|
+
}
|
|
26746
|
+
},
|
|
26747
|
+
"required": [
|
|
26748
|
+
"expression"
|
|
26749
|
+
],
|
|
26750
|
+
"returns": "Promise<any>",
|
|
26751
|
+
"examples": [
|
|
26752
|
+
{
|
|
26753
|
+
"language": "ts",
|
|
26754
|
+
"code": "await python.run('x = 42')\nconst result = await python.eval('x * 2')\nconsole.log(result) // 84"
|
|
26755
|
+
}
|
|
26756
|
+
]
|
|
26757
|
+
},
|
|
26758
|
+
"importModule": {
|
|
26759
|
+
"description": "Imports a Python module into the persistent session namespace.",
|
|
26760
|
+
"parameters": {
|
|
26761
|
+
"moduleName": {
|
|
26762
|
+
"type": "string",
|
|
26763
|
+
"description": "Dotted module path (e.g. 'myapp.models')"
|
|
26764
|
+
},
|
|
26765
|
+
"alias": {
|
|
26766
|
+
"type": "string",
|
|
26767
|
+
"description": "Optional alias for the import (defaults to the last segment)"
|
|
26768
|
+
}
|
|
26769
|
+
},
|
|
26770
|
+
"required": [
|
|
26771
|
+
"moduleName"
|
|
26772
|
+
],
|
|
26773
|
+
"returns": "Promise<void>",
|
|
26774
|
+
"examples": [
|
|
26775
|
+
{
|
|
26776
|
+
"language": "ts",
|
|
26777
|
+
"code": "await python.importModule('json')\nawait python.importModule('myapp.models', 'models')\nconst result = await python.eval('models.User')"
|
|
26778
|
+
}
|
|
26779
|
+
]
|
|
26780
|
+
},
|
|
26781
|
+
"call": {
|
|
26782
|
+
"description": "Calls a function by dotted path in the persistent session namespace.",
|
|
26783
|
+
"parameters": {
|
|
26784
|
+
"funcPath": {
|
|
26785
|
+
"type": "string",
|
|
26786
|
+
"description": "Dotted path to the function (e.g. 'json.dumps' or 'my_func')"
|
|
26787
|
+
},
|
|
26788
|
+
"args": {
|
|
26789
|
+
"type": "any[]",
|
|
26790
|
+
"description": "Positional arguments"
|
|
26791
|
+
},
|
|
26792
|
+
"kwargs": {
|
|
26793
|
+
"type": "Record<string, any>",
|
|
26794
|
+
"description": "Keyword arguments"
|
|
26795
|
+
}
|
|
26796
|
+
},
|
|
26797
|
+
"required": [
|
|
26798
|
+
"funcPath"
|
|
26799
|
+
],
|
|
26800
|
+
"returns": "Promise<any>",
|
|
26801
|
+
"examples": [
|
|
26802
|
+
{
|
|
26803
|
+
"language": "ts",
|
|
26804
|
+
"code": "await python.importModule('json')\nconst result = await python.call('json.dumps', [{ a: 1 }], { indent: 2 })"
|
|
26805
|
+
}
|
|
26806
|
+
]
|
|
26807
|
+
},
|
|
26808
|
+
"getLocals": {
|
|
26809
|
+
"description": "Returns all non-dunder variables from the persistent session namespace.",
|
|
26810
|
+
"parameters": {},
|
|
26811
|
+
"required": [],
|
|
26812
|
+
"returns": "Promise<Record<string, any>>",
|
|
26813
|
+
"examples": [
|
|
26814
|
+
{
|
|
26815
|
+
"language": "ts",
|
|
26816
|
+
"code": "await python.run('x = 42\\ny = \"hello\"')\nconst locals = await python.getLocals()\nconsole.log(locals) // { x: 42, y: 'hello' }"
|
|
26817
|
+
}
|
|
26818
|
+
]
|
|
26819
|
+
},
|
|
26820
|
+
"resetSession": {
|
|
26821
|
+
"description": "Clears all variables and imports from the persistent session namespace. The session remains active — you can continue calling run() after reset.",
|
|
26822
|
+
"parameters": {},
|
|
26823
|
+
"required": [],
|
|
26824
|
+
"returns": "Promise<void>",
|
|
26825
|
+
"examples": [
|
|
26826
|
+
{
|
|
26827
|
+
"language": "ts",
|
|
26828
|
+
"code": "await python.run('x = 42')\nawait python.resetSession()\n// x is now undefined"
|
|
26829
|
+
}
|
|
26830
|
+
]
|
|
25166
26831
|
}
|
|
25167
26832
|
},
|
|
25168
26833
|
"getters": {
|
|
@@ -25219,6 +26884,21 @@ export const introspectionData = [
|
|
|
25219
26884
|
"name": "fileExecuted",
|
|
25220
26885
|
"description": "Event emitted by Python",
|
|
25221
26886
|
"arguments": {}
|
|
26887
|
+
},
|
|
26888
|
+
"sessionError": {
|
|
26889
|
+
"name": "sessionError",
|
|
26890
|
+
"description": "Event emitted by Python",
|
|
26891
|
+
"arguments": {}
|
|
26892
|
+
},
|
|
26893
|
+
"sessionStarted": {
|
|
26894
|
+
"name": "sessionStarted",
|
|
26895
|
+
"description": "Event emitted by Python",
|
|
26896
|
+
"arguments": {}
|
|
26897
|
+
},
|
|
26898
|
+
"sessionStopped": {
|
|
26899
|
+
"name": "sessionStopped",
|
|
26900
|
+
"description": "Event emitted by Python",
|
|
26901
|
+
"arguments": {}
|
|
25222
26902
|
}
|
|
25223
26903
|
},
|
|
25224
26904
|
"state": {},
|
|
@@ -25227,9 +26907,38 @@ export const introspectionData = [
|
|
|
25227
26907
|
"examples": [
|
|
25228
26908
|
{
|
|
25229
26909
|
"language": "ts",
|
|
25230
|
-
"code": "const python = container.feature('python', {
|
|
26910
|
+
"code": "const python = container.feature('python', {\n dir: \"/path/to/python/project\",\n})\n\n// Stateless execution\nconst result = await python.execute('print(\"Hello from Python!\")')\n\n// Persistent session\nawait python.startSession()\nawait python.run('import myapp.models')\nawait python.run('users = myapp.models.User.objects.all()')\nconst result = await python.run('print(len(users))')\nawait python.stopSession()"
|
|
25231
26911
|
}
|
|
25232
|
-
]
|
|
26912
|
+
],
|
|
26913
|
+
"types": {
|
|
26914
|
+
"RunResult": {
|
|
26915
|
+
"description": "Result from a persistent session run() call.",
|
|
26916
|
+
"properties": {
|
|
26917
|
+
"ok": {
|
|
26918
|
+
"type": "boolean",
|
|
26919
|
+
"description": ""
|
|
26920
|
+
},
|
|
26921
|
+
"result": {
|
|
26922
|
+
"type": "any",
|
|
26923
|
+
"description": ""
|
|
26924
|
+
},
|
|
26925
|
+
"stdout": {
|
|
26926
|
+
"type": "string",
|
|
26927
|
+
"description": ""
|
|
26928
|
+
},
|
|
26929
|
+
"error": {
|
|
26930
|
+
"type": "string",
|
|
26931
|
+
"description": "",
|
|
26932
|
+
"optional": true
|
|
26933
|
+
},
|
|
26934
|
+
"traceback": {
|
|
26935
|
+
"type": "string",
|
|
26936
|
+
"description": "",
|
|
26937
|
+
"optional": true
|
|
26938
|
+
}
|
|
26939
|
+
}
|
|
26940
|
+
}
|
|
26941
|
+
}
|
|
25233
26942
|
},
|
|
25234
26943
|
{
|
|
25235
26944
|
"id": "features.jsonTree",
|
|
@@ -34009,6 +35718,302 @@ export const introspectionData = [
|
|
|
34009
35718
|
}
|
|
34010
35719
|
}
|
|
34011
35720
|
},
|
|
35721
|
+
{
|
|
35722
|
+
"id": "features.lucaCoder",
|
|
35723
|
+
"description": "A coding assistant that owns a lower-level Assistant instance and gates all tool calls through a permission system. Comes with built-in Bash tool (via proc.execAndCapture) and auto-loads the luca-framework skill when found in .claude/skills paths. Tools are stacked from feature bundles (fileTools, etc.) and each tool can be set to 'allow' (runs immediately), 'ask' (blocks until user approves/denies), or 'deny' (always rejected).",
|
|
35724
|
+
"shortcut": "features.lucaCoder",
|
|
35725
|
+
"className": "LucaCoder",
|
|
35726
|
+
"methods": {
|
|
35727
|
+
"getPermission": {
|
|
35728
|
+
"description": "Get the effective permission level for a tool.",
|
|
35729
|
+
"parameters": {
|
|
35730
|
+
"toolName": {
|
|
35731
|
+
"type": "string",
|
|
35732
|
+
"description": "Parameter toolName"
|
|
35733
|
+
}
|
|
35734
|
+
},
|
|
35735
|
+
"required": [
|
|
35736
|
+
"toolName"
|
|
35737
|
+
],
|
|
35738
|
+
"returns": "PermissionLevel"
|
|
35739
|
+
},
|
|
35740
|
+
"setPermission": {
|
|
35741
|
+
"description": "Set permission level for one or more tools.",
|
|
35742
|
+
"parameters": {
|
|
35743
|
+
"toolName": {
|
|
35744
|
+
"type": "string | string[]",
|
|
35745
|
+
"description": "Parameter toolName"
|
|
35746
|
+
},
|
|
35747
|
+
"level": {
|
|
35748
|
+
"type": "PermissionLevel",
|
|
35749
|
+
"description": "Parameter level"
|
|
35750
|
+
}
|
|
35751
|
+
},
|
|
35752
|
+
"required": [
|
|
35753
|
+
"toolName",
|
|
35754
|
+
"level"
|
|
35755
|
+
],
|
|
35756
|
+
"returns": "this"
|
|
35757
|
+
},
|
|
35758
|
+
"setDefaultPermission": {
|
|
35759
|
+
"description": "Set the default permission level for unconfigured tools.",
|
|
35760
|
+
"parameters": {
|
|
35761
|
+
"level": {
|
|
35762
|
+
"type": "PermissionLevel",
|
|
35763
|
+
"description": "Parameter level"
|
|
35764
|
+
}
|
|
35765
|
+
},
|
|
35766
|
+
"required": [
|
|
35767
|
+
"level"
|
|
35768
|
+
],
|
|
35769
|
+
"returns": "this"
|
|
35770
|
+
},
|
|
35771
|
+
"permitTool": {
|
|
35772
|
+
"description": "Allow a tool (or tools) to run without approval.",
|
|
35773
|
+
"parameters": {
|
|
35774
|
+
"toolNames": {
|
|
35775
|
+
"type": "string[]",
|
|
35776
|
+
"description": "Parameter toolNames"
|
|
35777
|
+
}
|
|
35778
|
+
},
|
|
35779
|
+
"required": [
|
|
35780
|
+
"toolNames"
|
|
35781
|
+
],
|
|
35782
|
+
"returns": "this"
|
|
35783
|
+
},
|
|
35784
|
+
"gateTool": {
|
|
35785
|
+
"description": "Require approval before a tool (or tools) can run.",
|
|
35786
|
+
"parameters": {
|
|
35787
|
+
"toolNames": {
|
|
35788
|
+
"type": "string[]",
|
|
35789
|
+
"description": "Parameter toolNames"
|
|
35790
|
+
}
|
|
35791
|
+
},
|
|
35792
|
+
"required": [
|
|
35793
|
+
"toolNames"
|
|
35794
|
+
],
|
|
35795
|
+
"returns": "this"
|
|
35796
|
+
},
|
|
35797
|
+
"blockTool": {
|
|
35798
|
+
"description": "Block a tool (or tools) from ever running.",
|
|
35799
|
+
"parameters": {
|
|
35800
|
+
"toolNames": {
|
|
35801
|
+
"type": "string[]",
|
|
35802
|
+
"description": "Parameter toolNames"
|
|
35803
|
+
}
|
|
35804
|
+
},
|
|
35805
|
+
"required": [
|
|
35806
|
+
"toolNames"
|
|
35807
|
+
],
|
|
35808
|
+
"returns": "this"
|
|
35809
|
+
},
|
|
35810
|
+
"approve": {
|
|
35811
|
+
"description": "Approve a pending tool call by ID. The tool will execute.",
|
|
35812
|
+
"parameters": {
|
|
35813
|
+
"id": {
|
|
35814
|
+
"type": "string",
|
|
35815
|
+
"description": "Parameter id"
|
|
35816
|
+
}
|
|
35817
|
+
},
|
|
35818
|
+
"required": [
|
|
35819
|
+
"id"
|
|
35820
|
+
],
|
|
35821
|
+
"returns": "this"
|
|
35822
|
+
},
|
|
35823
|
+
"deny": {
|
|
35824
|
+
"description": "Deny a pending tool call by ID. The tool call will be skipped.",
|
|
35825
|
+
"parameters": {
|
|
35826
|
+
"id": {
|
|
35827
|
+
"type": "string",
|
|
35828
|
+
"description": "Parameter id"
|
|
35829
|
+
}
|
|
35830
|
+
},
|
|
35831
|
+
"required": [
|
|
35832
|
+
"id"
|
|
35833
|
+
],
|
|
35834
|
+
"returns": "this"
|
|
35835
|
+
},
|
|
35836
|
+
"approveAll": {
|
|
35837
|
+
"description": "Approve all pending tool calls.",
|
|
35838
|
+
"parameters": {},
|
|
35839
|
+
"required": [],
|
|
35840
|
+
"returns": "this"
|
|
35841
|
+
},
|
|
35842
|
+
"denyAll": {
|
|
35843
|
+
"description": "Deny all pending tool calls.",
|
|
35844
|
+
"parameters": {},
|
|
35845
|
+
"required": [],
|
|
35846
|
+
"returns": "this"
|
|
35847
|
+
},
|
|
35848
|
+
"bash": {
|
|
35849
|
+
"description": "Execute a shell command string and return its output. Uses proc.execAndCapture under the hood — runs `sh -c <command>`.",
|
|
35850
|
+
"parameters": {
|
|
35851
|
+
"{ command, cwd, timeout }": {
|
|
35852
|
+
"type": "{ command: string; cwd?: string; timeout?: number }",
|
|
35853
|
+
"description": "Parameter { command, cwd, timeout }"
|
|
35854
|
+
}
|
|
35855
|
+
},
|
|
35856
|
+
"required": [
|
|
35857
|
+
"{ command, cwd, timeout }"
|
|
35858
|
+
],
|
|
35859
|
+
"returns": "Promise<{\n\t\texitCode: number\n\t\tstdout: string\n\t\tstderr: string\n\t\tsuccess: boolean\n\t}>"
|
|
35860
|
+
},
|
|
35861
|
+
"start": {
|
|
35862
|
+
"description": "Initialize the inner assistant, register the bash tool, stack tool bundles, auto-load skills, and wire up the permission interceptor.",
|
|
35863
|
+
"parameters": {},
|
|
35864
|
+
"required": [],
|
|
35865
|
+
"returns": "Promise<this>"
|
|
35866
|
+
},
|
|
35867
|
+
"ask": {
|
|
35868
|
+
"description": "Ask the coder a question. Auto-starts if needed. Tool calls will be gated by the permission system.",
|
|
35869
|
+
"parameters": {
|
|
35870
|
+
"question": {
|
|
35871
|
+
"type": "string",
|
|
35872
|
+
"description": "Parameter question"
|
|
35873
|
+
},
|
|
35874
|
+
"options": {
|
|
35875
|
+
"type": "Record<string, any>",
|
|
35876
|
+
"description": "Parameter options"
|
|
35877
|
+
}
|
|
35878
|
+
},
|
|
35879
|
+
"required": [
|
|
35880
|
+
"question"
|
|
35881
|
+
],
|
|
35882
|
+
"returns": "Promise<string>"
|
|
35883
|
+
},
|
|
35884
|
+
"use": {
|
|
35885
|
+
"description": "Add a tool bundle after initialization. Useful for dynamically extending the assistant's capabilities.",
|
|
35886
|
+
"parameters": {
|
|
35887
|
+
"spec": {
|
|
35888
|
+
"type": "ToolBundleSpec",
|
|
35889
|
+
"description": "Parameter spec"
|
|
35890
|
+
}
|
|
35891
|
+
},
|
|
35892
|
+
"required": [
|
|
35893
|
+
"spec"
|
|
35894
|
+
],
|
|
35895
|
+
"returns": "this"
|
|
35896
|
+
}
|
|
35897
|
+
},
|
|
35898
|
+
"getters": {
|
|
35899
|
+
"assistant": {
|
|
35900
|
+
"description": "The inner assistant. Throws if not started.",
|
|
35901
|
+
"returns": "Assistant"
|
|
35902
|
+
},
|
|
35903
|
+
"permissions": {
|
|
35904
|
+
"description": "Current permission map from state.",
|
|
35905
|
+
"returns": "Record<string, PermissionLevel>"
|
|
35906
|
+
},
|
|
35907
|
+
"pendingApprovals": {
|
|
35908
|
+
"description": "Current pending approvals.",
|
|
35909
|
+
"returns": "PendingApproval[]"
|
|
35910
|
+
},
|
|
35911
|
+
"isStarted": {
|
|
35912
|
+
"description": "Whether the assistant is started and ready.",
|
|
35913
|
+
"returns": "boolean"
|
|
35914
|
+
},
|
|
35915
|
+
"tools": {
|
|
35916
|
+
"description": "The tools registered on the inner assistant.",
|
|
35917
|
+
"returns": "Record<string, any>"
|
|
35918
|
+
},
|
|
35919
|
+
"conversation": {
|
|
35920
|
+
"description": "The conversation on the inner assistant (if started).",
|
|
35921
|
+
"returns": "any"
|
|
35922
|
+
},
|
|
35923
|
+
"messages": {
|
|
35924
|
+
"description": "Messages from the inner assistant's conversation.",
|
|
35925
|
+
"returns": "any"
|
|
35926
|
+
}
|
|
35927
|
+
},
|
|
35928
|
+
"events": {
|
|
35929
|
+
"permissionGranted": {
|
|
35930
|
+
"name": "permissionGranted",
|
|
35931
|
+
"description": "Event emitted by LucaCoder",
|
|
35932
|
+
"arguments": {}
|
|
35933
|
+
},
|
|
35934
|
+
"permissionDenied": {
|
|
35935
|
+
"name": "permissionDenied",
|
|
35936
|
+
"description": "Event emitted by LucaCoder",
|
|
35937
|
+
"arguments": {}
|
|
35938
|
+
},
|
|
35939
|
+
"toolBlocked": {
|
|
35940
|
+
"name": "toolBlocked",
|
|
35941
|
+
"description": "Event emitted by LucaCoder",
|
|
35942
|
+
"arguments": {}
|
|
35943
|
+
},
|
|
35944
|
+
"chunk": {
|
|
35945
|
+
"name": "chunk",
|
|
35946
|
+
"description": "Event emitted by LucaCoder",
|
|
35947
|
+
"arguments": {}
|
|
35948
|
+
},
|
|
35949
|
+
"response": {
|
|
35950
|
+
"name": "response",
|
|
35951
|
+
"description": "Event emitted by LucaCoder",
|
|
35952
|
+
"arguments": {}
|
|
35953
|
+
},
|
|
35954
|
+
"toolCall": {
|
|
35955
|
+
"name": "toolCall",
|
|
35956
|
+
"description": "Event emitted by LucaCoder",
|
|
35957
|
+
"arguments": {}
|
|
35958
|
+
},
|
|
35959
|
+
"toolResult": {
|
|
35960
|
+
"name": "toolResult",
|
|
35961
|
+
"description": "Event emitted by LucaCoder",
|
|
35962
|
+
"arguments": {}
|
|
35963
|
+
},
|
|
35964
|
+
"toolError": {
|
|
35965
|
+
"name": "toolError",
|
|
35966
|
+
"description": "Event emitted by LucaCoder",
|
|
35967
|
+
"arguments": {}
|
|
35968
|
+
},
|
|
35969
|
+
"started": {
|
|
35970
|
+
"name": "started",
|
|
35971
|
+
"description": "Event emitted by LucaCoder",
|
|
35972
|
+
"arguments": {}
|
|
35973
|
+
},
|
|
35974
|
+
"permissionRequest": {
|
|
35975
|
+
"name": "permissionRequest",
|
|
35976
|
+
"description": "Event emitted by LucaCoder",
|
|
35977
|
+
"arguments": {}
|
|
35978
|
+
}
|
|
35979
|
+
},
|
|
35980
|
+
"state": {},
|
|
35981
|
+
"options": {},
|
|
35982
|
+
"envVars": [],
|
|
35983
|
+
"examples": [
|
|
35984
|
+
{
|
|
35985
|
+
"language": "ts",
|
|
35986
|
+
"code": "const coder = container.feature('lucaCoder', {\n tools: ['fileTools'],\n permissions: {\n readFile: 'allow',\n searchFiles: 'allow',\n writeFile: 'ask',\n bash: 'ask',\n },\n defaultPermission: 'ask',\n systemPrompt: 'You are a coding assistant.',\n})\n\ncoder.on('permissionRequest', ({ id, toolName, args }) => {\n console.log(`Tool \"${toolName}\" wants to run with`, args)\n coder.approve(id) // or coder.deny(id)\n})\n\nawait coder.ask('Refactor the auth module to use async/await')"
|
|
35987
|
+
}
|
|
35988
|
+
],
|
|
35989
|
+
"types": {
|
|
35990
|
+
"PendingApproval": {
|
|
35991
|
+
"description": "A pending approval awaiting user decision.",
|
|
35992
|
+
"properties": {
|
|
35993
|
+
"id": {
|
|
35994
|
+
"type": "string",
|
|
35995
|
+
"description": ""
|
|
35996
|
+
},
|
|
35997
|
+
"toolName": {
|
|
35998
|
+
"type": "string",
|
|
35999
|
+
"description": ""
|
|
36000
|
+
},
|
|
36001
|
+
"args": {
|
|
36002
|
+
"type": "Record<string, any>",
|
|
36003
|
+
"description": ""
|
|
36004
|
+
},
|
|
36005
|
+
"timestamp": {
|
|
36006
|
+
"type": "number",
|
|
36007
|
+
"description": ""
|
|
36008
|
+
},
|
|
36009
|
+
"resolve": {
|
|
36010
|
+
"type": "(decision: 'approve' | 'deny') => void",
|
|
36011
|
+
"description": ""
|
|
36012
|
+
}
|
|
36013
|
+
}
|
|
36014
|
+
}
|
|
36015
|
+
}
|
|
36016
|
+
},
|
|
34012
36017
|
{
|
|
34013
36018
|
"id": "features.conversationHistory",
|
|
34014
36019
|
"description": "Persists conversations to disk using the diskCache feature (cacache). Each conversation is stored as a JSON blob keyed by ID, with metadata stored alongside for efficient listing and search without loading full message arrays.",
|
|
@@ -34487,6 +36492,458 @@ export const introspectionData = [
|
|
|
34487
36492
|
}
|
|
34488
36493
|
}
|
|
34489
36494
|
}
|
|
36495
|
+
},
|
|
36496
|
+
{
|
|
36497
|
+
"id": "features.autoAssistant",
|
|
36498
|
+
"description": "An autonomous assistant that owns a lower-level Assistant instance and gates all tool calls through a permission system. Tools are stacked from feature bundles (fileTools, processManager, etc.) and each tool can be set to 'allow' (runs immediately), 'ask' (blocks until user approves/denies), or 'deny' (always rejected).",
|
|
36499
|
+
"shortcut": "features.autoAssistant",
|
|
36500
|
+
"className": "AutonomousAssistant",
|
|
36501
|
+
"methods": {
|
|
36502
|
+
"getPermission": {
|
|
36503
|
+
"description": "Get the effective permission level for a tool.",
|
|
36504
|
+
"parameters": {
|
|
36505
|
+
"toolName": {
|
|
36506
|
+
"type": "string",
|
|
36507
|
+
"description": "Parameter toolName"
|
|
36508
|
+
}
|
|
36509
|
+
},
|
|
36510
|
+
"required": [
|
|
36511
|
+
"toolName"
|
|
36512
|
+
],
|
|
36513
|
+
"returns": "PermissionLevel"
|
|
36514
|
+
},
|
|
36515
|
+
"setPermission": {
|
|
36516
|
+
"description": "Set permission level for one or more tools.",
|
|
36517
|
+
"parameters": {
|
|
36518
|
+
"toolName": {
|
|
36519
|
+
"type": "string | string[]",
|
|
36520
|
+
"description": "Parameter toolName"
|
|
36521
|
+
},
|
|
36522
|
+
"level": {
|
|
36523
|
+
"type": "PermissionLevel",
|
|
36524
|
+
"description": "Parameter level"
|
|
36525
|
+
}
|
|
36526
|
+
},
|
|
36527
|
+
"required": [
|
|
36528
|
+
"toolName",
|
|
36529
|
+
"level"
|
|
36530
|
+
],
|
|
36531
|
+
"returns": "this"
|
|
36532
|
+
},
|
|
36533
|
+
"setDefaultPermission": {
|
|
36534
|
+
"description": "Set the default permission level for unconfigured tools.",
|
|
36535
|
+
"parameters": {
|
|
36536
|
+
"level": {
|
|
36537
|
+
"type": "PermissionLevel",
|
|
36538
|
+
"description": "Parameter level"
|
|
36539
|
+
}
|
|
36540
|
+
},
|
|
36541
|
+
"required": [
|
|
36542
|
+
"level"
|
|
36543
|
+
],
|
|
36544
|
+
"returns": "this"
|
|
36545
|
+
},
|
|
36546
|
+
"permitTool": {
|
|
36547
|
+
"description": "Allow a tool (or tools) to run without approval.",
|
|
36548
|
+
"parameters": {
|
|
36549
|
+
"toolNames": {
|
|
36550
|
+
"type": "string[]",
|
|
36551
|
+
"description": "Parameter toolNames"
|
|
36552
|
+
}
|
|
36553
|
+
},
|
|
36554
|
+
"required": [
|
|
36555
|
+
"toolNames"
|
|
36556
|
+
],
|
|
36557
|
+
"returns": "this"
|
|
36558
|
+
},
|
|
36559
|
+
"gateTool": {
|
|
36560
|
+
"description": "Require approval before a tool (or tools) can run.",
|
|
36561
|
+
"parameters": {
|
|
36562
|
+
"toolNames": {
|
|
36563
|
+
"type": "string[]",
|
|
36564
|
+
"description": "Parameter toolNames"
|
|
36565
|
+
}
|
|
36566
|
+
},
|
|
36567
|
+
"required": [
|
|
36568
|
+
"toolNames"
|
|
36569
|
+
],
|
|
36570
|
+
"returns": "this"
|
|
36571
|
+
},
|
|
36572
|
+
"blockTool": {
|
|
36573
|
+
"description": "Block a tool (or tools) from ever running.",
|
|
36574
|
+
"parameters": {
|
|
36575
|
+
"toolNames": {
|
|
36576
|
+
"type": "string[]",
|
|
36577
|
+
"description": "Parameter toolNames"
|
|
36578
|
+
}
|
|
36579
|
+
},
|
|
36580
|
+
"required": [
|
|
36581
|
+
"toolNames"
|
|
36582
|
+
],
|
|
36583
|
+
"returns": "this"
|
|
36584
|
+
},
|
|
36585
|
+
"approve": {
|
|
36586
|
+
"description": "Approve a pending tool call by ID. The tool will execute.",
|
|
36587
|
+
"parameters": {
|
|
36588
|
+
"id": {
|
|
36589
|
+
"type": "string",
|
|
36590
|
+
"description": "Parameter id"
|
|
36591
|
+
}
|
|
36592
|
+
},
|
|
36593
|
+
"required": [
|
|
36594
|
+
"id"
|
|
36595
|
+
],
|
|
36596
|
+
"returns": "this"
|
|
36597
|
+
},
|
|
36598
|
+
"deny": {
|
|
36599
|
+
"description": "Deny a pending tool call by ID. The tool call will be skipped.",
|
|
36600
|
+
"parameters": {
|
|
36601
|
+
"id": {
|
|
36602
|
+
"type": "string",
|
|
36603
|
+
"description": "Parameter id"
|
|
36604
|
+
}
|
|
36605
|
+
},
|
|
36606
|
+
"required": [
|
|
36607
|
+
"id"
|
|
36608
|
+
],
|
|
36609
|
+
"returns": "this"
|
|
36610
|
+
},
|
|
36611
|
+
"approveAll": {
|
|
36612
|
+
"description": "Approve all pending tool calls.",
|
|
36613
|
+
"parameters": {},
|
|
36614
|
+
"required": [],
|
|
36615
|
+
"returns": "this"
|
|
36616
|
+
},
|
|
36617
|
+
"denyAll": {
|
|
36618
|
+
"description": "Deny all pending tool calls.",
|
|
36619
|
+
"parameters": {},
|
|
36620
|
+
"required": [],
|
|
36621
|
+
"returns": "this"
|
|
36622
|
+
},
|
|
36623
|
+
"start": {
|
|
36624
|
+
"description": "Initialize the inner assistant, stack tool bundles, and wire up the permission interceptor.",
|
|
36625
|
+
"parameters": {},
|
|
36626
|
+
"required": [],
|
|
36627
|
+
"returns": "Promise<this>"
|
|
36628
|
+
},
|
|
36629
|
+
"ask": {
|
|
36630
|
+
"description": "Ask the autonomous assistant a question. Auto-starts if needed. Tool calls will be gated by the permission system.",
|
|
36631
|
+
"parameters": {
|
|
36632
|
+
"question": {
|
|
36633
|
+
"type": "string",
|
|
36634
|
+
"description": "Parameter question"
|
|
36635
|
+
},
|
|
36636
|
+
"options": {
|
|
36637
|
+
"type": "Record<string, any>",
|
|
36638
|
+
"description": "Parameter options"
|
|
36639
|
+
}
|
|
36640
|
+
},
|
|
36641
|
+
"required": [
|
|
36642
|
+
"question"
|
|
36643
|
+
],
|
|
36644
|
+
"returns": "Promise<string>"
|
|
36645
|
+
},
|
|
36646
|
+
"use": {
|
|
36647
|
+
"description": "Add a tool bundle after initialization. Useful for dynamically extending the assistant's capabilities.",
|
|
36648
|
+
"parameters": {
|
|
36649
|
+
"spec": {
|
|
36650
|
+
"type": "ToolBundleSpec",
|
|
36651
|
+
"description": "Parameter spec"
|
|
36652
|
+
}
|
|
36653
|
+
},
|
|
36654
|
+
"required": [
|
|
36655
|
+
"spec"
|
|
36656
|
+
],
|
|
36657
|
+
"returns": "this"
|
|
36658
|
+
}
|
|
36659
|
+
},
|
|
36660
|
+
"getters": {
|
|
36661
|
+
"assistant": {
|
|
36662
|
+
"description": "The inner assistant. Throws if not started.",
|
|
36663
|
+
"returns": "Assistant"
|
|
36664
|
+
},
|
|
36665
|
+
"permissions": {
|
|
36666
|
+
"description": "Current permission map from state.",
|
|
36667
|
+
"returns": "Record<string, PermissionLevel>"
|
|
36668
|
+
},
|
|
36669
|
+
"pendingApprovals": {
|
|
36670
|
+
"description": "Current pending approvals.",
|
|
36671
|
+
"returns": "PendingApproval[]"
|
|
36672
|
+
},
|
|
36673
|
+
"isStarted": {
|
|
36674
|
+
"description": "Whether the assistant is started and ready.",
|
|
36675
|
+
"returns": "boolean"
|
|
36676
|
+
},
|
|
36677
|
+
"tools": {
|
|
36678
|
+
"description": "The tools registered on the inner assistant.",
|
|
36679
|
+
"returns": "Record<string, any>"
|
|
36680
|
+
},
|
|
36681
|
+
"conversation": {
|
|
36682
|
+
"description": "The conversation on the inner assistant (if started).",
|
|
36683
|
+
"returns": "any"
|
|
36684
|
+
},
|
|
36685
|
+
"messages": {
|
|
36686
|
+
"description": "Messages from the inner assistant's conversation.",
|
|
36687
|
+
"returns": "any"
|
|
36688
|
+
}
|
|
36689
|
+
},
|
|
36690
|
+
"events": {
|
|
36691
|
+
"permissionGranted": {
|
|
36692
|
+
"name": "permissionGranted",
|
|
36693
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36694
|
+
"arguments": {}
|
|
36695
|
+
},
|
|
36696
|
+
"permissionDenied": {
|
|
36697
|
+
"name": "permissionDenied",
|
|
36698
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36699
|
+
"arguments": {}
|
|
36700
|
+
},
|
|
36701
|
+
"toolBlocked": {
|
|
36702
|
+
"name": "toolBlocked",
|
|
36703
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36704
|
+
"arguments": {}
|
|
36705
|
+
},
|
|
36706
|
+
"chunk": {
|
|
36707
|
+
"name": "chunk",
|
|
36708
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36709
|
+
"arguments": {}
|
|
36710
|
+
},
|
|
36711
|
+
"response": {
|
|
36712
|
+
"name": "response",
|
|
36713
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36714
|
+
"arguments": {}
|
|
36715
|
+
},
|
|
36716
|
+
"toolCall": {
|
|
36717
|
+
"name": "toolCall",
|
|
36718
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36719
|
+
"arguments": {}
|
|
36720
|
+
},
|
|
36721
|
+
"toolResult": {
|
|
36722
|
+
"name": "toolResult",
|
|
36723
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36724
|
+
"arguments": {}
|
|
36725
|
+
},
|
|
36726
|
+
"toolError": {
|
|
36727
|
+
"name": "toolError",
|
|
36728
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36729
|
+
"arguments": {}
|
|
36730
|
+
},
|
|
36731
|
+
"started": {
|
|
36732
|
+
"name": "started",
|
|
36733
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36734
|
+
"arguments": {}
|
|
36735
|
+
},
|
|
36736
|
+
"permissionRequest": {
|
|
36737
|
+
"name": "permissionRequest",
|
|
36738
|
+
"description": "Event emitted by AutonomousAssistant",
|
|
36739
|
+
"arguments": {}
|
|
36740
|
+
}
|
|
36741
|
+
},
|
|
36742
|
+
"state": {},
|
|
36743
|
+
"options": {},
|
|
36744
|
+
"envVars": [],
|
|
36745
|
+
"examples": [
|
|
36746
|
+
{
|
|
36747
|
+
"language": "ts",
|
|
36748
|
+
"code": "const auto = container.feature('autoAssistant', {\n tools: ['fileTools', { feature: 'processManager', except: ['killAllProcesses'] }],\n permissions: {\n readFile: 'allow',\n searchFiles: 'allow',\n writeFile: 'ask',\n editFile: 'ask',\n deleteFile: 'deny',\n },\n defaultPermission: 'ask',\n systemPrompt: 'You are a coding assistant.',\n})\n\nauto.on('permissionRequest', ({ id, toolName, args }) => {\n console.log(`Tool \"${toolName}\" wants to run with`, args)\n // Show UI, then:\n auto.approve(id) // or auto.deny(id)\n})\n\nawait auto.ask('Refactor the auth module to use async/await')"
|
|
36749
|
+
}
|
|
36750
|
+
],
|
|
36751
|
+
"types": {
|
|
36752
|
+
"PendingApproval": {
|
|
36753
|
+
"description": "A pending approval awaiting user decision.",
|
|
36754
|
+
"properties": {
|
|
36755
|
+
"id": {
|
|
36756
|
+
"type": "string",
|
|
36757
|
+
"description": ""
|
|
36758
|
+
},
|
|
36759
|
+
"toolName": {
|
|
36760
|
+
"type": "string",
|
|
36761
|
+
"description": ""
|
|
36762
|
+
},
|
|
36763
|
+
"args": {
|
|
36764
|
+
"type": "Record<string, any>",
|
|
36765
|
+
"description": ""
|
|
36766
|
+
},
|
|
36767
|
+
"timestamp": {
|
|
36768
|
+
"type": "number",
|
|
36769
|
+
"description": ""
|
|
36770
|
+
},
|
|
36771
|
+
"resolve": {
|
|
36772
|
+
"type": "(decision: 'approve' | 'deny') => void",
|
|
36773
|
+
"description": ""
|
|
36774
|
+
}
|
|
36775
|
+
}
|
|
36776
|
+
}
|
|
36777
|
+
}
|
|
36778
|
+
},
|
|
36779
|
+
{
|
|
36780
|
+
"id": "features.fileTools",
|
|
36781
|
+
"description": "Curated file-system and code-search tools for AI assistants. Wraps the container's `fs` and `grep` features into a focused tool surface modeled on the tools that coding assistants (Claude Code, Cursor, etc.) rely on: read, write, edit, list, search, find, stat, mkdir, move, copy, delete. Usage: ```typescript const fileTools = container.feature('fileTools') assistant.use(fileTools) // or selectively: assistant.use(fileTools.toTools({ only: ['readFile', 'searchFiles', 'listDirectory'] })) ```",
|
|
36782
|
+
"shortcut": "features.fileTools",
|
|
36783
|
+
"className": "FileTools",
|
|
36784
|
+
"methods": {
|
|
36785
|
+
"readFile": {
|
|
36786
|
+
"description": "",
|
|
36787
|
+
"parameters": {
|
|
36788
|
+
"args": {
|
|
36789
|
+
"type": "{ path: string; offset?: number; limit?: number }",
|
|
36790
|
+
"description": "Parameter args"
|
|
36791
|
+
}
|
|
36792
|
+
},
|
|
36793
|
+
"required": [
|
|
36794
|
+
"args"
|
|
36795
|
+
],
|
|
36796
|
+
"returns": "Promise<string>"
|
|
36797
|
+
},
|
|
36798
|
+
"writeFile": {
|
|
36799
|
+
"description": "",
|
|
36800
|
+
"parameters": {
|
|
36801
|
+
"args": {
|
|
36802
|
+
"type": "{ path: string; content: string }",
|
|
36803
|
+
"description": "Parameter args"
|
|
36804
|
+
}
|
|
36805
|
+
},
|
|
36806
|
+
"required": [
|
|
36807
|
+
"args"
|
|
36808
|
+
],
|
|
36809
|
+
"returns": "Promise<string>"
|
|
36810
|
+
},
|
|
36811
|
+
"editFile": {
|
|
36812
|
+
"description": "",
|
|
36813
|
+
"parameters": {
|
|
36814
|
+
"args": {
|
|
36815
|
+
"type": "{ path: string; oldString: string; newString: string; replaceAll?: boolean }",
|
|
36816
|
+
"description": "Parameter args"
|
|
36817
|
+
}
|
|
36818
|
+
},
|
|
36819
|
+
"required": [
|
|
36820
|
+
"args"
|
|
36821
|
+
],
|
|
36822
|
+
"returns": "Promise<string>"
|
|
36823
|
+
},
|
|
36824
|
+
"listDirectory": {
|
|
36825
|
+
"description": "",
|
|
36826
|
+
"parameters": {
|
|
36827
|
+
"args": {
|
|
36828
|
+
"type": "{ path?: string; recursive?: boolean; include?: string; exclude?: string }",
|
|
36829
|
+
"description": "Parameter args"
|
|
36830
|
+
}
|
|
36831
|
+
},
|
|
36832
|
+
"required": [
|
|
36833
|
+
"args"
|
|
36834
|
+
],
|
|
36835
|
+
"returns": "Promise<string>"
|
|
36836
|
+
},
|
|
36837
|
+
"searchFiles": {
|
|
36838
|
+
"description": "",
|
|
36839
|
+
"parameters": {
|
|
36840
|
+
"args": {
|
|
36841
|
+
"type": "{ pattern: string; path?: string; include?: string; exclude?: string; ignoreCase?: boolean; maxResults?: number }",
|
|
36842
|
+
"description": "Parameter args"
|
|
36843
|
+
}
|
|
36844
|
+
},
|
|
36845
|
+
"required": [
|
|
36846
|
+
"args"
|
|
36847
|
+
],
|
|
36848
|
+
"returns": "Promise<string>"
|
|
36849
|
+
},
|
|
36850
|
+
"findFiles": {
|
|
36851
|
+
"description": "",
|
|
36852
|
+
"parameters": {
|
|
36853
|
+
"args": {
|
|
36854
|
+
"type": "{ pattern: string; path?: string; exclude?: string }",
|
|
36855
|
+
"description": "Parameter args"
|
|
36856
|
+
}
|
|
36857
|
+
},
|
|
36858
|
+
"required": [
|
|
36859
|
+
"args"
|
|
36860
|
+
],
|
|
36861
|
+
"returns": "Promise<string>"
|
|
36862
|
+
},
|
|
36863
|
+
"fileInfo": {
|
|
36864
|
+
"description": "",
|
|
36865
|
+
"parameters": {
|
|
36866
|
+
"args": {
|
|
36867
|
+
"type": "{ path: string }",
|
|
36868
|
+
"description": "Parameter args"
|
|
36869
|
+
}
|
|
36870
|
+
},
|
|
36871
|
+
"required": [
|
|
36872
|
+
"args"
|
|
36873
|
+
],
|
|
36874
|
+
"returns": "Promise<string>"
|
|
36875
|
+
},
|
|
36876
|
+
"createDirectory": {
|
|
36877
|
+
"description": "",
|
|
36878
|
+
"parameters": {
|
|
36879
|
+
"args": {
|
|
36880
|
+
"type": "{ path: string }",
|
|
36881
|
+
"description": "Parameter args"
|
|
36882
|
+
}
|
|
36883
|
+
},
|
|
36884
|
+
"required": [
|
|
36885
|
+
"args"
|
|
36886
|
+
],
|
|
36887
|
+
"returns": "Promise<string>"
|
|
36888
|
+
},
|
|
36889
|
+
"moveFile": {
|
|
36890
|
+
"description": "",
|
|
36891
|
+
"parameters": {
|
|
36892
|
+
"args": {
|
|
36893
|
+
"type": "{ source: string; destination: string }",
|
|
36894
|
+
"description": "Parameter args"
|
|
36895
|
+
}
|
|
36896
|
+
},
|
|
36897
|
+
"required": [
|
|
36898
|
+
"args"
|
|
36899
|
+
],
|
|
36900
|
+
"returns": "Promise<string>"
|
|
36901
|
+
},
|
|
36902
|
+
"copyFile": {
|
|
36903
|
+
"description": "",
|
|
36904
|
+
"parameters": {
|
|
36905
|
+
"args": {
|
|
36906
|
+
"type": "{ source: string; destination: string }",
|
|
36907
|
+
"description": "Parameter args"
|
|
36908
|
+
}
|
|
36909
|
+
},
|
|
36910
|
+
"required": [
|
|
36911
|
+
"args"
|
|
36912
|
+
],
|
|
36913
|
+
"returns": "Promise<string>"
|
|
36914
|
+
},
|
|
36915
|
+
"deleteFile": {
|
|
36916
|
+
"description": "",
|
|
36917
|
+
"parameters": {
|
|
36918
|
+
"args": {
|
|
36919
|
+
"type": "{ path: string }",
|
|
36920
|
+
"description": "Parameter args"
|
|
36921
|
+
}
|
|
36922
|
+
},
|
|
36923
|
+
"required": [
|
|
36924
|
+
"args"
|
|
36925
|
+
],
|
|
36926
|
+
"returns": "Promise<string>"
|
|
36927
|
+
},
|
|
36928
|
+
"setupToolsConsumer": {
|
|
36929
|
+
"description": "When an assistant uses fileTools, inject system prompt guidance about how to use the tools effectively.",
|
|
36930
|
+
"parameters": {
|
|
36931
|
+
"consumer": {
|
|
36932
|
+
"type": "Helper",
|
|
36933
|
+
"description": "Parameter consumer"
|
|
36934
|
+
}
|
|
36935
|
+
},
|
|
36936
|
+
"required": [
|
|
36937
|
+
"consumer"
|
|
36938
|
+
],
|
|
36939
|
+
"returns": "void"
|
|
36940
|
+
}
|
|
36941
|
+
},
|
|
36942
|
+
"getters": {},
|
|
36943
|
+
"events": {},
|
|
36944
|
+
"state": {},
|
|
36945
|
+
"options": {},
|
|
36946
|
+
"envVars": []
|
|
34490
36947
|
}
|
|
34491
36948
|
];
|
|
34492
36949
|
|
|
@@ -34721,7 +37178,7 @@ export const containerIntrospectionData = [
|
|
|
34721
37178
|
}
|
|
34722
37179
|
]
|
|
34723
37180
|
},
|
|
34724
|
-
"
|
|
37181
|
+
"introspect": {
|
|
34725
37182
|
"description": "Returns a full introspection object for this container, merging build-time AST data (JSDoc descriptions, methods, getters) with runtime data (registries, factories, state, environment).",
|
|
34726
37183
|
"parameters": {},
|
|
34727
37184
|
"required": [],
|
|
@@ -34729,11 +37186,11 @@ export const containerIntrospectionData = [
|
|
|
34729
37186
|
"examples": [
|
|
34730
37187
|
{
|
|
34731
37188
|
"language": "ts",
|
|
34732
|
-
"code": "const info = container.
|
|
37189
|
+
"code": "const info = container.introspect()\nconsole.log(info.methods) // all public methods with descriptions\nconsole.log(info.getters) // all getters with return types\nconsole.log(info.registries) // features, clients, servers, etc."
|
|
34733
37190
|
}
|
|
34734
37191
|
]
|
|
34735
37192
|
},
|
|
34736
|
-
"
|
|
37193
|
+
"introspectAsText": {
|
|
34737
37194
|
"description": "Returns a human-readable markdown representation of this container's introspection data. Useful in REPLs, AI agent contexts, or documentation generation. Pass a section name to render only that section (e.g. 'methods', 'getters', 'events', 'state').",
|
|
34738
37195
|
"parameters": {
|
|
34739
37196
|
"sectionOrDepth": {
|
|
@@ -34750,32 +37207,17 @@ export const containerIntrospectionData = [
|
|
|
34750
37207
|
"examples": [
|
|
34751
37208
|
{
|
|
34752
37209
|
"language": "ts",
|
|
34753
|
-
"code": "console.log(container.
|
|
37210
|
+
"code": "console.log(container.introspectAsText()) // full description\nconsole.log(container.introspectAsText('methods')) // just methods"
|
|
34754
37211
|
}
|
|
34755
37212
|
]
|
|
34756
37213
|
},
|
|
34757
|
-
"introspectAsText": {
|
|
34758
|
-
"description": "Alias for inspectAsText.",
|
|
34759
|
-
"parameters": {
|
|
34760
|
-
"sectionOrDepth": {
|
|
34761
|
-
"type": "IntrospectionSection | number",
|
|
34762
|
-
"description": "Parameter sectionOrDepth"
|
|
34763
|
-
},
|
|
34764
|
-
"startHeadingDepth": {
|
|
34765
|
-
"type": "number",
|
|
34766
|
-
"description": "Parameter startHeadingDepth"
|
|
34767
|
-
}
|
|
34768
|
-
},
|
|
34769
|
-
"required": [],
|
|
34770
|
-
"returns": "string"
|
|
34771
|
-
},
|
|
34772
37214
|
"introspectAsJSON": {
|
|
34773
|
-
"description": "
|
|
37215
|
+
"description": "Returns JSON introspection data.",
|
|
34774
37216
|
"parameters": {},
|
|
34775
37217
|
"required": [],
|
|
34776
37218
|
"returns": "ContainerIntrospection"
|
|
34777
37219
|
},
|
|
34778
|
-
"
|
|
37220
|
+
"introspectAsType": {
|
|
34779
37221
|
"description": "Returns the container's introspection data formatted as a TypeScript interface declaration. Includes the container's own methods, getters, factories, and registered helper types.",
|
|
34780
37222
|
"parameters": {},
|
|
34781
37223
|
"required": [],
|
|
@@ -34783,16 +37225,10 @@ export const containerIntrospectionData = [
|
|
|
34783
37225
|
"examples": [
|
|
34784
37226
|
{
|
|
34785
37227
|
"language": "ts",
|
|
34786
|
-
"code": "console.log(container.
|
|
37228
|
+
"code": "console.log(container.introspectAsType())\n// interface NodeContainer {\n// feature<T>(id: string, options?: object): T;\n// readonly uuid: string;\n// ...\n// }"
|
|
34787
37229
|
}
|
|
34788
37230
|
]
|
|
34789
37231
|
},
|
|
34790
|
-
"introspectAsType": {
|
|
34791
|
-
"description": "",
|
|
34792
|
-
"parameters": {},
|
|
34793
|
-
"required": [],
|
|
34794
|
-
"returns": "string"
|
|
34795
|
-
},
|
|
34796
37232
|
"sleep": {
|
|
34797
37233
|
"description": "Sleep for the specified number of milliseconds. Useful for scripting and sequencing.",
|
|
34798
37234
|
"parameters": {
|