@h1r-ai/croche 0.5.0 → 0.5.2
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 +23 -15
- package/dist/core-bindgen.js +18 -18
- package/dist/core-runtime.d.ts +1 -1
- package/dist/core-runtime.js +1 -1
- package/dist/core-wasm-bytes.d.ts +3 -3
- package/dist/core-wasm-bytes.js +3 -3
- package/dist/project-types.d.ts +2 -2
- package/dist/types.d.ts +6 -8
- package/docs/CODING-AGENT.md +11 -7
- package/docs/SKILL.md +309 -265
- package/docs/skills/croche/agents/openai.yaml +4 -0
- package/docs/skills/croche/references/agents.md +78 -0
- package/docs/skills/croche/references/first-turn.md +74 -0
- package/docs/skills/croche/references/tools.md +43 -0
- package/docs/skills/croche/references/web-search.md +85 -0
- package/docs/skills/croche-cli/SKILL.md +158 -0
- package/docs/skills/croche-cli/agents/openai.yaml +4 -0
- package/docs/skills/croche-cli/references/powershell.md +47 -0
- package/docs/skills/croche-config/SKILL.md +153 -0
- package/docs/skills/croche-config/agents/openai.yaml +4 -0
- package/docs/skills/croche-config/references/models.md +12 -0
- package/docs/skills/croche-platforms/SKILL.md +55 -0
- package/docs/skills/croche-platforms/agents/openai.yaml +4 -0
- package/docs/skills/croche-platforms/references/android.md +185 -0
- package/docs/skills/croche-platforms/references/ios.md +165 -0
- package/docs/skills/croche-platforms/references/react-native.md +50 -0
- package/docs/skills/croche-platforms/references/web-backend.md +58 -0
- package/docs/skills/croche-troubleshoot/SKILL.md +72 -0
- package/docs/skills/croche-troubleshoot/agents/openai.yaml +4 -0
- package/docs/skills/croche-troubleshoot/references/recovery.md +31 -0
- package/package.json +1 -1
- package/src/core-bindgen.ts +18 -18
- package/src/core-runtime.ts +1 -1
- package/src/core-wasm-bytes.ts +3 -3
- package/src/project-types.ts +2 -2
- package/src/types.ts +6 -8
package/README.md
CHANGED
|
@@ -11,11 +11,12 @@ and receives a report of every call in the background. **A Cloud outage does not
|
|
|
11
11
|
|
|
12
12
|
The shared Rust Core owns conversations, command routing, receipts, spending and
|
|
13
13
|
Cloud synchronization. This package embeds its WebAssembly build for browsers,
|
|
14
|
-
Node, and WebViews. Native iOS (Swift) and Android (Kotlin) SDKs are
|
|
15
|
-
0.5.
|
|
14
|
+
Node, and WebViews. Native iOS (Swift) and Android (Kotlin) SDKs are published as
|
|
15
|
+
0.5.2, with the same `Croche.open` API.
|
|
16
16
|
For React Native, install `@h1r-ai/croche-react-native` beside this package; it carries
|
|
17
17
|
the native Core ([React Native](#react-native)).
|
|
18
|
-
|
|
18
|
+
Your app can choose the model with `model` in the `config` passed to `Croche.open`; if it
|
|
19
|
+
doesn't, Croche chooses one for the project.
|
|
19
20
|
|
|
20
21
|
## Install
|
|
21
22
|
|
|
@@ -40,7 +41,7 @@ WASM Core, with no runtime npm dependencies. Consuming apps need no Rust compile
|
|
|
40
41
|
or source checkout. Rust is needed only to rebuild the Core from source. A strict
|
|
41
42
|
browser CSP must include `script-src 'self' 'wasm-unsafe-eval'`; JavaScript `eval`
|
|
42
43
|
and `new Function` remain unnecessary.
|
|
43
|
-
|
|
44
|
+
Version 0.5.2 is published on the public npm registry as `@h1r-ai/croche`.
|
|
44
45
|
|
|
45
46
|
## Projects and agents
|
|
46
47
|
|
|
@@ -98,7 +99,10 @@ await croche.close();
|
|
|
98
99
|
(status changes: `queued`, `seen`, `answered`, `no_reply`, `failed`, `cancelled`),
|
|
99
100
|
`message.start` / `message.delta` / `message.end`, and `state` (`idle`, `running`,
|
|
100
101
|
`waiting`). `history({ limit, before? })` adds an older `page`; `clearHistory()` writes
|
|
101
|
-
`cleared`. `cancel(id?)` cancels one input, or the running turn.
|
|
102
|
+
`cleared`. `cancel(id?)` cancels one input, or the running turn. One subscription per agent:
|
|
103
|
+
a second `subscribe` replaces the first, which receives a final `{ type: 'replaced' }`.
|
|
104
|
+
- **Tool refusals** are not stream events. The app sees them through
|
|
105
|
+
`Croche.open({ onDebugEvent })` as `tool.calls_refused`; your tool knows what it ran.
|
|
102
106
|
- **Agents:** `croche.agent('helper')` opens an agent declared under `config.agents`; an id
|
|
103
107
|
the config does not declare is `invalid_configuration`. The same call while it is open
|
|
104
108
|
returns the same object.
|
|
@@ -386,10 +390,14 @@ its images are left out. The turn result counts what was left out as `imagesOmit
|
|
|
386
390
|
images stay while the conversation holds them, as a message's do. Stores written with them are
|
|
387
391
|
version 11: an older Core refuses them (`store_too_new`) rather than misread them.
|
|
388
392
|
|
|
389
|
-
`context` is
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
+
`context` is optional app state, kept apart from the person's words. Most turns contain
|
|
394
|
+
only a user message. Context costs tokens each time it is included; it is useful when the
|
|
395
|
+
request needs the app's state, such as a command or button acting on app data, or after
|
|
396
|
+
that state changed. An image can be stacked into the same input when needed. A message
|
|
397
|
+
without `context` carries only the message; earlier states stay in the conversation as
|
|
398
|
+
they were until older turns are folded. They are not a live view of the app. Authoritative
|
|
399
|
+
values (gold, inventory, permissions) live in your app and its tools, not in what the agent
|
|
400
|
+
is told: a tool must check them itself.
|
|
393
401
|
|
|
394
402
|
Model and tool history is retained. Each turn sees as much recent conversation as fits
|
|
395
403
|
`maxContextTokens`, in whole turns; your instructions, your tools' declarations and the entire
|
|
@@ -950,7 +958,7 @@ retains a generic local discovery opt-out and separate full CLI control settings
|
|
|
950
958
|
|
|
951
959
|
Chat uses the existing local debugger on port 8790. Authenticated running services
|
|
952
960
|
and their captures are preserved; an occupied port with an unknown credential is
|
|
953
|
-
refused. The CLI needs no provider or Cloud
|
|
961
|
+
refused. The CLI needs no provider or Cloud account key for this workflow.
|
|
954
962
|
Other SDK apps must register their own adapter for the existing Runtime; see the
|
|
955
963
|
[complete example](docs/DEBUGGER.md#attach-another-javascripttypescript-app).
|
|
956
964
|
|
|
@@ -1137,17 +1145,17 @@ const mara = await croche.agent();
|
|
|
1137
1145
|
|
|
1138
1146
|
## Account CLI and local Runtime control
|
|
1139
1147
|
|
|
1140
|
-
Install the CLI globally with `npm install --global @h1r-ai/croche-cli`, then create
|
|
1141
|
-
**Studio →
|
|
1148
|
+
Install the CLI globally with `npm install --global @h1r-ai/croche-cli`, then create an account key in
|
|
1149
|
+
**Studio → Account keys**. Cloud stores its hash and shows the secret once.
|
|
1142
1150
|
|
|
1143
1151
|
```sh
|
|
1144
|
-
export
|
|
1152
|
+
export CROCHE_ACCOUNT_KEY='YOUR_ACCOUNT_KEY'
|
|
1145
1153
|
croche auth whoami
|
|
1146
|
-
croche projects list
|
|
1154
|
+
croche projects list
|
|
1147
1155
|
croche --help
|
|
1148
1156
|
```
|
|
1149
1157
|
|
|
1150
|
-
The
|
|
1158
|
+
The account key identifies your account for project/Studio management. It is
|
|
1151
1159
|
separate from the public project key passed to an app and from local Runtime
|
|
1152
1160
|
control pairing. Keep it out of application bundles and model prompts.
|
|
1153
1161
|
|
package/dist/core-bindgen.js
CHANGED
|
@@ -157,7 +157,7 @@ function _assertClass(instance, klass) {
|
|
|
157
157
|
throw new Error(`expected instance of ${klass.name}`);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function __wbg_adapter_10(arg0, arg1, arg2) {
|
|
161
161
|
wasm.closure216_externref_shim(arg0, arg1, arg2);
|
|
162
162
|
}
|
|
163
163
|
function __wbg_adapter_135(arg0, arg1, arg2, arg3) {
|
|
@@ -1213,7 +1213,7 @@ function __wbg_get_imports() {
|
|
|
1213
1213
|
return ret;
|
|
1214
1214
|
}, arguments);
|
|
1215
1215
|
};
|
|
1216
|
-
imports.wbg.
|
|
1216
|
+
imports.wbg.__wbg_http_18b3e005e7618f7a = function (arg0, arg1, arg2, arg3) {
|
|
1217
1217
|
const ret = arg0.http(arg1, WasmSink.__wrap(arg2), WasmCancel.__wrap(arg3));
|
|
1218
1218
|
return ret;
|
|
1219
1219
|
};
|
|
@@ -1236,7 +1236,7 @@ function __wbg_get_imports() {
|
|
|
1236
1236
|
const ret = arg0.length;
|
|
1237
1237
|
return ret;
|
|
1238
1238
|
};
|
|
1239
|
-
imports.wbg.
|
|
1239
|
+
imports.wbg.__wbg_lock_904efb61fb548b1f = function (arg0, arg1, arg2) {
|
|
1240
1240
|
const ret = arg0.lock(getStringFromWasm0(arg1, arg2));
|
|
1241
1241
|
return ret;
|
|
1242
1242
|
};
|
|
@@ -1272,7 +1272,7 @@ function __wbg_get_imports() {
|
|
|
1272
1272
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
1273
1273
|
return ret;
|
|
1274
1274
|
};
|
|
1275
|
-
imports.wbg.
|
|
1275
|
+
imports.wbg.__wbg_nowMs_14c2a07c06614f73 = function (arg0) {
|
|
1276
1276
|
const ret = arg0.nowMs();
|
|
1277
1277
|
return ret;
|
|
1278
1278
|
};
|
|
@@ -1294,26 +1294,26 @@ function __wbg_get_imports() {
|
|
|
1294
1294
|
const ret = arg0.queueMicrotask;
|
|
1295
1295
|
return ret;
|
|
1296
1296
|
};
|
|
1297
|
-
imports.wbg.
|
|
1297
|
+
imports.wbg.__wbg_random_679898e6bd0741ac = function (arg0, arg1) {
|
|
1298
1298
|
const ret = arg1.random();
|
|
1299
1299
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1300
1300
|
const len1 = WASM_VECTOR_LEN;
|
|
1301
1301
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
1302
1302
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1303
1303
|
};
|
|
1304
|
-
imports.wbg.
|
|
1304
|
+
imports.wbg.__wbg_readSecret_f65ef4b8ddd21804 = function (arg0, arg1, arg2) {
|
|
1305
1305
|
const ret = arg0.readSecret(getStringFromWasm0(arg1, arg2));
|
|
1306
1306
|
return ret;
|
|
1307
1307
|
};
|
|
1308
|
-
imports.wbg.
|
|
1308
|
+
imports.wbg.__wbg_read_ce1fe505575c8a22 = function (arg0, arg1, arg2) {
|
|
1309
1309
|
const ret = arg0.read(getStringFromWasm0(arg1, arg2));
|
|
1310
1310
|
return ret;
|
|
1311
1311
|
};
|
|
1312
|
-
imports.wbg.
|
|
1312
|
+
imports.wbg.__wbg_removeSecret_0fb2f98faf247a00 = function (arg0, arg1, arg2) {
|
|
1313
1313
|
const ret = arg0.removeSecret(getStringFromWasm0(arg1, arg2));
|
|
1314
1314
|
return ret;
|
|
1315
1315
|
};
|
|
1316
|
-
imports.wbg.
|
|
1316
|
+
imports.wbg.__wbg_remove_48ab8ef2bf887788 = function (arg0, arg1, arg2) {
|
|
1317
1317
|
const ret = arg0.remove(getStringFromWasm0(arg1, arg2));
|
|
1318
1318
|
return ret;
|
|
1319
1319
|
};
|
|
@@ -1327,7 +1327,7 @@ function __wbg_get_imports() {
|
|
|
1327
1327
|
return ret;
|
|
1328
1328
|
}, arguments);
|
|
1329
1329
|
};
|
|
1330
|
-
imports.wbg.
|
|
1330
|
+
imports.wbg.__wbg_sleep_6f4058b67459cecd = function (arg0, arg1) {
|
|
1331
1331
|
const ret = arg0.sleep(arg1);
|
|
1332
1332
|
return ret;
|
|
1333
1333
|
};
|
|
@@ -1347,7 +1347,7 @@ function __wbg_get_imports() {
|
|
|
1347
1347
|
const ret = typeof window === 'undefined' ? null : window;
|
|
1348
1348
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
1349
1349
|
};
|
|
1350
|
-
imports.wbg.
|
|
1350
|
+
imports.wbg.__wbg_storeIdentity_77a87bc19ddddbc0 = function (arg0, arg1) {
|
|
1351
1351
|
const ret = arg1.storeIdentity();
|
|
1352
1352
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1353
1353
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -1368,7 +1368,7 @@ function __wbg_get_imports() {
|
|
|
1368
1368
|
const ret = arg0.then(arg1);
|
|
1369
1369
|
return ret;
|
|
1370
1370
|
};
|
|
1371
|
-
imports.wbg.
|
|
1371
|
+
imports.wbg.__wbg_tool_50b751b1e195c261 = function (arg0, arg1, arg2, arg3) {
|
|
1372
1372
|
let deferred0_0;
|
|
1373
1373
|
let deferred0_1;
|
|
1374
1374
|
try {
|
|
@@ -1381,15 +1381,15 @@ function __wbg_get_imports() {
|
|
|
1381
1381
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1382
1382
|
}
|
|
1383
1383
|
};
|
|
1384
|
-
imports.wbg.
|
|
1384
|
+
imports.wbg.__wbg_unlock_dc85d9ec9f810f34 = function (arg0, arg1, arg2) {
|
|
1385
1385
|
const ret = arg0.unlock(getStringFromWasm0(arg1, arg2));
|
|
1386
1386
|
return ret;
|
|
1387
1387
|
};
|
|
1388
|
-
imports.wbg.
|
|
1388
|
+
imports.wbg.__wbg_utcOffsetMinutes_5c6173afedde38dc = function (arg0, arg1) {
|
|
1389
1389
|
const ret = arg0.utcOffsetMinutes(arg1);
|
|
1390
1390
|
return ret;
|
|
1391
1391
|
};
|
|
1392
|
-
imports.wbg.
|
|
1392
|
+
imports.wbg.__wbg_wake_0ae632fff1f043e5 = function (arg0, arg1) {
|
|
1393
1393
|
arg0.wake(arg1);
|
|
1394
1394
|
};
|
|
1395
1395
|
imports.wbg.__wbg_wasmproject_new = function (arg0) {
|
|
@@ -1428,7 +1428,7 @@ function __wbg_get_imports() {
|
|
|
1428
1428
|
imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function (arg0, arg1) {
|
|
1429
1429
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1430
1430
|
};
|
|
1431
|
-
imports.wbg.
|
|
1431
|
+
imports.wbg.__wbg_writeSecret_8ccdd2b3efc6f6f2 = function (arg0, arg1, arg2, arg3, arg4) {
|
|
1432
1432
|
let deferred0_0;
|
|
1433
1433
|
let deferred0_1;
|
|
1434
1434
|
try {
|
|
@@ -1441,7 +1441,7 @@ function __wbg_get_imports() {
|
|
|
1441
1441
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1442
1442
|
}
|
|
1443
1443
|
};
|
|
1444
|
-
imports.wbg.
|
|
1444
|
+
imports.wbg.__wbg_write_2073bd38037ca3be = function (arg0, arg1, arg2, arg3, arg4) {
|
|
1445
1445
|
let deferred0_0;
|
|
1446
1446
|
let deferred0_1;
|
|
1447
1447
|
try {
|
|
@@ -1461,7 +1461,7 @@ function __wbg_get_imports() {
|
|
|
1461
1461
|
};
|
|
1462
1462
|
imports.wbg.__wbindgen_cast_9bf690dfafdef3b5 = function (arg0, arg1) {
|
|
1463
1463
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 215, function: Function { arguments: [Externref], shim_idx: 216, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1464
|
-
const ret = makeMutClosure(arg0, arg1, 215,
|
|
1464
|
+
const ret = makeMutClosure(arg0, arg1, 215, __wbg_adapter_10);
|
|
1465
1465
|
return ret;
|
|
1466
1466
|
};
|
|
1467
1467
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function (arg0) {
|
package/dist/core-runtime.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { CoreRuntimeOptions, RuntimeTool, RuntimeToolMetadata } from './com
|
|
|
3
3
|
import type { OpenOptions as ProjectOpenOptions } from './project-types.js';
|
|
4
4
|
import { type BudgetAdjustment, type BudgetSnapshot, type DeferredWrite, type DisplayMessage, type RuntimeDebugObserverOptions, type RuntimeStatus, type SendInput, type SendOptions, type TurnResult, type RuntimeMemoryApi, type RuntimeWiki, type UserWikiResult, type WikiDocument } from './types.js';
|
|
5
5
|
export declare const DEFAULT_MODEL = "deepseek/deepseek-v4.1-flash";
|
|
6
|
-
export declare const SDK_VERSION = "0.5.
|
|
6
|
+
export declare const SDK_VERSION = "0.5.2";
|
|
7
7
|
/** What one round of background upkeep did. */
|
|
8
8
|
export interface MaintenanceResult {
|
|
9
9
|
ran: boolean;
|
package/dist/core-runtime.js
CHANGED
|
@@ -4,7 +4,7 @@ import { browserCodec, isToolResult, preparable, prepareImage } from './images.j
|
|
|
4
4
|
import { CrocheError, } from './types.js';
|
|
5
5
|
// Mirrors the protocol default; kept standalone so published SDK imports need no workspace.
|
|
6
6
|
export const DEFAULT_MODEL = 'deepseek/deepseek-v4.1-flash';
|
|
7
|
-
export const SDK_VERSION = '0.5.
|
|
7
|
+
export const SDK_VERSION = '0.5.2';
|
|
8
8
|
const DEFAULT_MAINTENANCE_INTERVAL_MS = 60_000;
|
|
9
9
|
const localOwners = new WeakMap();
|
|
10
10
|
/** The longest delay a JS timer holds (2^31 - 1 ms, about 24.8 days); a longer one fires at once.
|