@infernetprotocol/liquid-agent 0.0.0-stage → 0.1.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +15 -2
  3. package/fixtures/contract.json +6 -0
  4. package/fixtures/invalid/episode-extra-field.json +275 -0
  5. package/fixtures/invalid/episode-no-capture.json +265 -0
  6. package/fixtures/invalid/episode-unknown-action.json +274 -0
  7. package/fixtures/invalid/model-manifest-bad-hash.json +92 -0
  8. package/fixtures/invalid/predict-negative-seq.json +48 -0
  9. package/fixtures/invalid/proposal-bad-abstain.json +31 -0
  10. package/fixtures/invalid/proposal-confidence-range.json +31 -0
  11. package/fixtures/invalid/session-bad-seq.json +17 -0
  12. package/fixtures/invalid/train-job-bad-family.json +44 -0
  13. package/fixtures/invalid/train-job-zero-lr.json +44 -0
  14. package/fixtures/valid/action-proposal.json +27 -0
  15. package/fixtures/valid/dataset-bundle.json +3747 -0
  16. package/fixtures/valid/dataset-manifest.json +126 -0
  17. package/fixtures/valid/episode.json +270 -0
  18. package/fixtures/valid/inference-session.json +13 -0
  19. package/fixtures/valid/model-manifest.json +88 -0
  20. package/fixtures/valid/predict-request.json +44 -0
  21. package/fixtures/valid/train-job.json +40 -0
  22. package/package.json +28 -3
  23. package/runtime/infernet_liquid/__init__.py +6 -0
  24. package/runtime/infernet_liquid/__main__.py +95 -0
  25. package/runtime/infernet_liquid/bench.py +125 -0
  26. package/runtime/infernet_liquid/bundle.py +63 -0
  27. package/runtime/infernet_liquid/canonical.py +75 -0
  28. package/runtime/infernet_liquid/data.py +121 -0
  29. package/runtime/infernet_liquid/errors.py +13 -0
  30. package/runtime/infernet_liquid/evaluate.py +145 -0
  31. package/runtime/infernet_liquid/export.py +136 -0
  32. package/runtime/infernet_liquid/features.py +105 -0
  33. package/runtime/infernet_liquid/models.py +63 -0
  34. package/runtime/infernet_liquid/schema.py +155 -0
  35. package/runtime/infernet_liquid/secretscan.py +64 -0
  36. package/runtime/infernet_liquid/server.py +251 -0
  37. package/runtime/infernet_liquid/sessions.py +279 -0
  38. package/runtime/infernet_liquid/synth.py +194 -0
  39. package/runtime/infernet_liquid/train.py +136 -0
  40. package/runtime/pyproject.toml +14 -0
  41. package/runtime/requirements-cuda.lock +461 -0
  42. package/runtime/requirements.lock +344 -0
  43. package/schemas/action-proposal.schema.json +40 -0
  44. package/schemas/common.schema.json +88 -0
  45. package/schemas/dataset-bundle.schema.json +15 -0
  46. package/schemas/dataset-manifest.schema.json +100 -0
  47. package/schemas/episode.schema.json +71 -0
  48. package/schemas/inference-session.schema.json +23 -0
  49. package/schemas/model-manifest.schema.json +103 -0
  50. package/schemas/predict-request.schema.json +20 -0
  51. package/schemas/train-job.schema.json +75 -0
  52. package/src/canonical.js +49 -0
  53. package/src/contract.js +62 -0
  54. package/src/dataset.js +133 -0
  55. package/src/index.js +13 -0
  56. package/src/runtime.js +206 -0
  57. package/src/secrets.js +79 -0
  58. package/src/validate.js +161 -0
@@ -0,0 +1,126 @@
1
+ {
2
+ "consent": {
3
+ "consent_id": "synthetic",
4
+ "granted_at": "2026-10-25T12:00:00Z",
5
+ "purposes": [
6
+ "model_training",
7
+ "evaluation"
8
+ ]
9
+ },
10
+ "created_at": "2026-10-25T12:00:00Z",
11
+ "dataset_hash": "sha256:dce2e7d70920e254b3b04e633dd2ad1383f41d592e2d79506fb42e0c9336c6ec",
12
+ "dataset_id": "ds_syn_3_4",
13
+ "episodes": [
14
+ {
15
+ "content_hash": "sha256:252f9609047a61f694e0bba93740e561277ed10a59372fb7a6f8f7dc8a118e13",
16
+ "episode_id": "ep_syn_email_3_0000",
17
+ "split": "train",
18
+ "split_group": "email-s0",
19
+ "task": "email.reply_draft"
20
+ },
21
+ {
22
+ "content_hash": "sha256:63462c8edd2d5627bea7318db8687334821397850dff10a923b2b708a612d72a",
23
+ "episode_id": "ep_syn_email_3_0001",
24
+ "split": "train",
25
+ "split_group": "email-s0",
26
+ "task": "email.reply_draft"
27
+ },
28
+ {
29
+ "content_hash": "sha256:7b088d03d6cb1255198e70696a3c243f86bf430350fb2d3894d3652e874eaa1a",
30
+ "episode_id": "ep_syn_email_3_0002",
31
+ "split": "train",
32
+ "split_group": "email-s0",
33
+ "task": "email.reply_draft"
34
+ },
35
+ {
36
+ "content_hash": "sha256:1fa97d4de7b6f142648fd7ad6d8b3eba1d2c77f3007c395ea0bef0dd9535760a",
37
+ "episode_id": "ep_syn_email_3_0003",
38
+ "split": "train",
39
+ "split_group": "email-s0",
40
+ "task": "email.reply_draft"
41
+ },
42
+ {
43
+ "content_hash": "sha256:7c5a85d86398f2a9f47189bb6b8bc54769ae417640a24c27523c458e1f528e86",
44
+ "episode_id": "ep_syn_reddit_3_0000",
45
+ "split": "train",
46
+ "split_group": "reddit-s0",
47
+ "task": "reddit.post_compose"
48
+ },
49
+ {
50
+ "content_hash": "sha256:a48a28621dbec4048ad3452cb85f7aba274edb1b65daf5bc625e657666b0a9f2",
51
+ "episode_id": "ep_syn_reddit_3_0001",
52
+ "split": "train",
53
+ "split_group": "reddit-s0",
54
+ "task": "reddit.post_compose"
55
+ },
56
+ {
57
+ "content_hash": "sha256:cac89cc4a373e056af096a638240054a6d1037b131bec8bd74ed6941178dd3d1",
58
+ "episode_id": "ep_syn_reddit_3_0002",
59
+ "split": "train",
60
+ "split_group": "reddit-s0",
61
+ "task": "reddit.post_compose"
62
+ },
63
+ {
64
+ "content_hash": "sha256:47db4567c3d888b41821eb305989d446da85d76fda9728e27cbd12177b376e4e",
65
+ "episode_id": "ep_syn_reddit_3_0003",
66
+ "split": "train",
67
+ "split_group": "reddit-s0",
68
+ "task": "reddit.post_compose"
69
+ },
70
+ {
71
+ "content_hash": "sha256:0b6b3b593b1276dc3f1c6d166b6068a983089556925b828cb54341b5f557f6c3",
72
+ "episode_id": "ep_syn_linkedin_3_0000",
73
+ "split": "validation",
74
+ "split_group": "linkedin-s0",
75
+ "task": "linkedin.notifications_review"
76
+ },
77
+ {
78
+ "content_hash": "sha256:9973221a778516739a0e4ce833de9f74220825937e3aad518de943d81f3e9b21",
79
+ "episode_id": "ep_syn_linkedin_3_0001",
80
+ "split": "validation",
81
+ "split_group": "linkedin-s0",
82
+ "task": "linkedin.notifications_review"
83
+ },
84
+ {
85
+ "content_hash": "sha256:b0dc03a1c2d536d55f5ab90e967a90bd9e92a885d95ecfbb05b22e8106b77cb7",
86
+ "episode_id": "ep_syn_linkedin_3_0002",
87
+ "split": "validation",
88
+ "split_group": "linkedin-s0",
89
+ "task": "linkedin.notifications_review"
90
+ },
91
+ {
92
+ "content_hash": "sha256:1dd5ca683ab10c494f2440bb6ae97bb3f13cbd5f4d0e40c30032cf29e06da9f5",
93
+ "episode_id": "ep_syn_linkedin_3_0003",
94
+ "split": "validation",
95
+ "split_group": "linkedin-s0",
96
+ "task": "linkedin.notifications_review"
97
+ }
98
+ ],
99
+ "kind": "dataset_manifest",
100
+ "license": "CC0-1.0",
101
+ "name": "Synthetic mock desktop traces",
102
+ "provenance": {
103
+ "generator": "infernet-liquid synth",
104
+ "source": "synthetic"
105
+ },
106
+ "redaction": {
107
+ "profile": "strict",
108
+ "scanner_version": "1",
109
+ "secret_scan": "passed"
110
+ },
111
+ "retention": {
112
+ "days": null,
113
+ "delete_on_revoke": true
114
+ },
115
+ "schema_version": "liquid-agent/v1",
116
+ "splits": {
117
+ "counts": {
118
+ "test": 0,
119
+ "train": 8,
120
+ "validation": 4
121
+ },
122
+ "seed": 3,
123
+ "strategy": "by_session"
124
+ },
125
+ "version": 1
126
+ }
@@ -0,0 +1,270 @@
1
+ {
2
+ "capture": {
3
+ "app_scope": [
4
+ "mail"
5
+ ],
6
+ "consent_id": "synthetic",
7
+ "device_local": true,
8
+ "redaction_profile": "strict",
9
+ "source": "synthetic"
10
+ },
11
+ "content_hash": "sha256:252f9609047a61f694e0bba93740e561277ed10a59372fb7a6f8f7dc8a118e13",
12
+ "created_at": "2026-10-25T12:00:00Z",
13
+ "episode_id": "ep_syn_email_3_0000",
14
+ "kind": "episode",
15
+ "labels": {
16
+ "goal": "Reply to the unread message and save the reply as a draft",
17
+ "reviewed": true,
18
+ "risk": "low",
19
+ "success": true
20
+ },
21
+ "schema_version": "liquid-agent/v1",
22
+ "split_group": "email-s0",
23
+ "steps": [
24
+ {
25
+ "action": {
26
+ "target": {
27
+ "name": "Inbox",
28
+ "role": "link"
29
+ },
30
+ "type": "click"
31
+ },
32
+ "observation": {
33
+ "app": "mail",
34
+ "elements": [
35
+ {
36
+ "name": "Calendar",
37
+ "role": "link"
38
+ },
39
+ {
40
+ "name": "Drafts",
41
+ "role": "link"
42
+ },
43
+ {
44
+ "name": "Spam",
45
+ "role": "link"
46
+ },
47
+ {
48
+ "name": "Settings",
49
+ "role": "link"
50
+ },
51
+ {
52
+ "name": "Sent",
53
+ "role": "link"
54
+ },
55
+ {
56
+ "name": "Compose",
57
+ "role": "button"
58
+ },
59
+ {
60
+ "name": "Inbox",
61
+ "role": "link"
62
+ }
63
+ ],
64
+ "url_pattern": "mail://home"
65
+ },
66
+ "result": {
67
+ "status": "ok"
68
+ },
69
+ "t_ms": 0
70
+ },
71
+ {
72
+ "action": {
73
+ "target": {
74
+ "name": "Unread · From Ari: Contract draft",
75
+ "role": "row"
76
+ },
77
+ "type": "click"
78
+ },
79
+ "observation": {
80
+ "app": "mail",
81
+ "elements": [
82
+ {
83
+ "name": "From Jo: Lunch?",
84
+ "role": "row"
85
+ },
86
+ {
87
+ "name": "From Dana: Re: roadmap",
88
+ "role": "row"
89
+ },
90
+ {
91
+ "name": "Unread · From Ari: Contract draft",
92
+ "role": "row"
93
+ },
94
+ {
95
+ "name": "From Noor: Team offsite",
96
+ "role": "row"
97
+ },
98
+ {
99
+ "name": "Compose",
100
+ "role": "button"
101
+ },
102
+ {
103
+ "name": "Inbox",
104
+ "role": "link"
105
+ }
106
+ ],
107
+ "url_pattern": "mail://inbox"
108
+ },
109
+ "result": {
110
+ "status": "ok"
111
+ },
112
+ "t_ms": 664
113
+ },
114
+ {
115
+ "action": {
116
+ "target": {
117
+ "name": "Reply",
118
+ "role": "button"
119
+ },
120
+ "type": "click"
121
+ },
122
+ "observation": {
123
+ "app": "mail",
124
+ "elements": [
125
+ {
126
+ "name": "Delete",
127
+ "role": "button"
128
+ },
129
+ {
130
+ "name": "Mark unread",
131
+ "role": "button"
132
+ },
133
+ {
134
+ "name": "Reply",
135
+ "role": "button"
136
+ },
137
+ {
138
+ "name": "Forward",
139
+ "role": "button"
140
+ },
141
+ {
142
+ "name": "Archive",
143
+ "role": "button"
144
+ },
145
+ {
146
+ "name": "From Ari",
147
+ "role": "text"
148
+ }
149
+ ],
150
+ "url_pattern": "mail://message"
151
+ },
152
+ "result": {
153
+ "status": "ok"
154
+ },
155
+ "t_ms": 1878
156
+ },
157
+ {
158
+ "action": {
159
+ "target": {
160
+ "name": "Message body",
161
+ "role": "textbox"
162
+ },
163
+ "text_redacted": true,
164
+ "type": "type"
165
+ },
166
+ "observation": {
167
+ "app": "mail",
168
+ "elements": [
169
+ {
170
+ "name": "Save draft",
171
+ "role": "button"
172
+ },
173
+ {
174
+ "name": "Message body",
175
+ "role": "textbox"
176
+ },
177
+ {
178
+ "name": "Send",
179
+ "role": "button"
180
+ },
181
+ {
182
+ "name": "Discard",
183
+ "role": "button"
184
+ },
185
+ {
186
+ "name": "Attach",
187
+ "role": "button"
188
+ }
189
+ ],
190
+ "focus": {
191
+ "name": "Message body",
192
+ "role": "textbox"
193
+ },
194
+ "url_pattern": "mail://compose"
195
+ },
196
+ "result": {
197
+ "status": "ok"
198
+ },
199
+ "t_ms": 2516
200
+ },
201
+ {
202
+ "action": {
203
+ "target": {
204
+ "name": "Save draft",
205
+ "role": "button"
206
+ },
207
+ "type": "click"
208
+ },
209
+ "observation": {
210
+ "app": "mail",
211
+ "elements": [
212
+ {
213
+ "name": "Save draft",
214
+ "role": "button"
215
+ },
216
+ {
217
+ "name": "Message body",
218
+ "role": "textbox"
219
+ },
220
+ {
221
+ "name": "Send",
222
+ "role": "button"
223
+ },
224
+ {
225
+ "name": "Discard",
226
+ "role": "button"
227
+ },
228
+ {
229
+ "name": "Attach",
230
+ "role": "button"
231
+ }
232
+ ],
233
+ "focus": {
234
+ "name": "Message body",
235
+ "role": "textbox"
236
+ },
237
+ "url_pattern": "mail://compose"
238
+ },
239
+ "result": {
240
+ "status": "ok"
241
+ },
242
+ "t_ms": 8648
243
+ },
244
+ {
245
+ "action": {
246
+ "type": "done"
247
+ },
248
+ "observation": {
249
+ "app": "mail",
250
+ "elements": [
251
+ {
252
+ "name": "Draft saved",
253
+ "role": "text"
254
+ },
255
+ {
256
+ "name": "Inbox",
257
+ "role": "link"
258
+ }
259
+ ],
260
+ "url_pattern": "mail://compose"
261
+ },
262
+ "result": {
263
+ "status": "ok"
264
+ },
265
+ "t_ms": 9161
266
+ }
267
+ ],
268
+ "task": "email.reply_draft",
269
+ "variant": "v0"
270
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "checkpoint_ref": null,
3
+ "created_at": "2026-10-25T12:00:00.000Z",
4
+ "expires_at": "2026-10-25T12:10:00.000Z",
5
+ "kind": "inference_session",
6
+ "model_hash": "sha256:f4daee3297421b9155d7cb0e198c10f21911cfe38d10f4ff3adec9a401d5ba6d",
7
+ "schema_version": "liquid-agent/v1",
8
+ "sequence_index": -1,
9
+ "session_id": "sess-fixture-1",
10
+ "state": "active",
11
+ "ttl_s": 600,
12
+ "worker": "local"
13
+ }
@@ -0,0 +1,88 @@
1
+ {
2
+ "architecture": {
3
+ "backbone_units": 64,
4
+ "family": "cfc",
5
+ "feature_dim": 64,
6
+ "hidden_units": 16,
7
+ "params": 16095,
8
+ "research": false
9
+ },
10
+ "created_at": "2026-10-26T07:22:09.542Z",
11
+ "eval": {
12
+ "episodes": 4,
13
+ "metrics": {
14
+ "action_accuracy": 0.375,
15
+ "episode_success": 0.0,
16
+ "episodes": 4,
17
+ "external_write_recall": 1.0,
18
+ "latency_ms_p50": 0.0744,
19
+ "latency_ms_p95": 0.1179,
20
+ "step_accuracy": 0.125,
21
+ "steps": 24,
22
+ "target_accuracy": 0.25
23
+ },
24
+ "split": "validation"
25
+ },
26
+ "input_schema": {
27
+ "encoding": "hashed-bag/v1",
28
+ "feature_dim": 64,
29
+ "tasks": [
30
+ "email.reply_draft",
31
+ "linkedin.notifications_review",
32
+ "reddit.post_compose"
33
+ ],
34
+ "time_delta": "log1p_seconds"
35
+ },
36
+ "kind": "model_manifest",
37
+ "license": "UNLICENSED-private",
38
+ "manifest_hash": "sha256:69709bf527cc061bd780ea428d571f1f140d573999fca3bb2a7e77338e3bd6f9",
39
+ "model_id": "lm_f4daee3297421b91",
40
+ "output_schema": {
41
+ "action_types": [
42
+ "click",
43
+ "double_click",
44
+ "type",
45
+ "key",
46
+ "scroll",
47
+ "navigate",
48
+ "select",
49
+ "focus",
50
+ "wait",
51
+ "submit",
52
+ "send",
53
+ "post",
54
+ "publish",
55
+ "delete",
56
+ "done"
57
+ ],
58
+ "targets": [
59
+ "pointer:visible-elements"
60
+ ]
61
+ },
62
+ "runtime": {
63
+ "lock_hash": "sha256:682b7a9c048b1e899e82eac2b5cb0437607ea6bce8528eb330a72b96aa936b96",
64
+ "name": "infernet-liquid",
65
+ "ncps": "1.0.1",
66
+ "python": "3.12.13",
67
+ "torch": "2.14.1+cpu",
68
+ "version": "0.1.0"
69
+ },
70
+ "schema_version": "liquid-agent/v1",
71
+ "training": {
72
+ "dataset_hash": "sha256:dce2e7d70920e254b3b04e633dd2ad1383f41d592e2d79506fb42e0c9336c6ec",
73
+ "device": "cpu",
74
+ "epochs": 2,
75
+ "finished_at": "2026-10-26T07:22:09.535Z",
76
+ "learning_rate": 0.005,
77
+ "seed": 0,
78
+ "started_at": "2026-10-26T07:22:09.509Z",
79
+ "train_job_id": "tj_fixture_0001",
80
+ "train_seconds": 0.026
81
+ },
82
+ "weights": {
83
+ "file": "model.safetensors",
84
+ "format": "safetensors",
85
+ "size_bytes": 65836,
86
+ "weights_hash": "sha256:f4daee3297421b9155d7cb0e198c10f21911cfe38d10f4ff3adec9a401d5ba6d"
87
+ }
88
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "dt_ms": 0,
3
+ "kind": "predict_request",
4
+ "model_hash": "sha256:f4daee3297421b9155d7cb0e198c10f21911cfe38d10f4ff3adec9a401d5ba6d",
5
+ "observation": {
6
+ "app": "mail",
7
+ "elements": [
8
+ {
9
+ "name": "Calendar",
10
+ "role": "link"
11
+ },
12
+ {
13
+ "name": "Drafts",
14
+ "role": "link"
15
+ },
16
+ {
17
+ "name": "Spam",
18
+ "role": "link"
19
+ },
20
+ {
21
+ "name": "Settings",
22
+ "role": "link"
23
+ },
24
+ {
25
+ "name": "Sent",
26
+ "role": "link"
27
+ },
28
+ {
29
+ "name": "Compose",
30
+ "role": "button"
31
+ },
32
+ {
33
+ "name": "Inbox",
34
+ "role": "link"
35
+ }
36
+ ],
37
+ "url_pattern": "mail://home"
38
+ },
39
+ "prev_action": null,
40
+ "schema_version": "liquid-agent/v1",
41
+ "sequence_index": 0,
42
+ "session_id": "sess-fixture-1",
43
+ "task": "email.reply_draft"
44
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "baselines": [
3
+ "gru"
4
+ ],
5
+ "created_at": "2026-10-25T12:00:00Z",
6
+ "dataset_hash": "sha256:dce2e7d70920e254b3b04e633dd2ad1383f41d592e2d79506fb42e0c9336c6ec",
7
+ "dataset_ref": "dataset-bundle.json",
8
+ "hyperparameters": {
9
+ "batch_size": 8,
10
+ "epochs": 2,
11
+ "feature_dim": 64,
12
+ "hidden_units": 16,
13
+ "learning_rate": 0.005,
14
+ "seed": 0
15
+ },
16
+ "idempotency_key": "fixture-0001-idem",
17
+ "job_id": "tj_fixture_0001",
18
+ "kind": "train_job",
19
+ "limits": {
20
+ "max_budget_usd": 0,
21
+ "max_retries": 1,
22
+ "timeout_s": 600
23
+ },
24
+ "model_type": "cfc",
25
+ "privacy": {
26
+ "mode": "local_only",
27
+ "upload_approved": false
28
+ },
29
+ "resources": {
30
+ "device": "cpu",
31
+ "gpu_required": false,
32
+ "max_threads": 2,
33
+ "min_ram_mb": 512
34
+ },
35
+ "retention": {
36
+ "artifact_days": 30,
37
+ "delete_dataset_after": true
38
+ },
39
+ "schema_version": "liquid-agent/v1"
40
+ }
package/package.json CHANGED
@@ -1,6 +1,31 @@
1
1
  {
2
2
  "name": "@infernetprotocol/liquid-agent",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.67",
4
+ "description": "liquid-agent/v1 contract and runtime client for Infernet's temporal-policy family: CfC/LTC liquid neural networks (ncps) with a GRU baseline, trained and served through an isolated, version-locked Python subprocess.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./src/index.js",
8
+ "exports": {
9
+ ".": "./src/index.js",
10
+ "./schemas/*": "./schemas/*"
11
+ },
12
+ "files": [
13
+ "src/**/*.js",
14
+ "schemas/*.json",
15
+ "fixtures/**/*.json",
16
+ "runtime/pyproject.toml",
17
+ "runtime/requirements.lock",
18
+ "runtime/requirements-cuda.lock",
19
+ "runtime/infernet_liquid/*.py",
20
+ "README.md"
21
+ ],
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/InfernetProtocol/infernet-protocol.git",
28
+ "directory": "packages/liquid-agent"
29
+ },
30
+ "homepage": "https://github.com/InfernetProtocol/infernet-protocol#readme"
6
31
  }
@@ -0,0 +1,6 @@
1
+ """infernet-liquid: the isolated Python runtime behind Infernet's temporal-policy family."""
2
+
3
+ __version__ = "0.1.0"
4
+ RUNTIME_NAME = "infernet-liquid"
5
+ SCHEMA_VERSION = "liquid-agent/v1"
6
+ PROTOCOL_VERSION = 1