@granular-software/sdk 0.4.47 → 0.4.49
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 +36 -12
- package/dist/agent-evals.d.mts +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/agent-evals.js +498 -208
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +498 -208
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/agent-harness.d.mts +1 -1
- package/dist/agent-harness.d.ts +1 -1
- package/dist/agent-harness.js +204 -142
- package/dist/agent-harness.js.map +1 -1
- package/dist/agent-harness.mjs +204 -142
- package/dist/agent-harness.mjs.map +1 -1
- package/dist/cli/index.js +547 -182
- package/dist/{client-C1UqPDwe.d.mts → client-B-MPVvDr.d.mts} +24 -3
- package/dist/{client-ButG6ePW.d.ts → client-zihxkDDs.d.ts} +24 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +452 -194
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +452 -194
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-D2Vy3N1D.d.mts → spend-CStuOBXb.d.mts} +83 -3
- package/dist/{spend-D2Vy3N1D.d.ts → spend-CStuOBXb.d.ts} +83 -3
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -169,7 +169,7 @@ await granular.ontology(env.sandboxId).effects.registerMany([
|
|
|
169
169
|
// 6. Submit a job — the sandbox gets fully typed OOP classes!
|
|
170
170
|
const session = await env.sessions.create();
|
|
171
171
|
const job = await session.submitJob(`
|
|
172
|
-
import { Customer } from
|
|
172
|
+
import { Customer } from "@granular/domain/Customer";
|
|
173
173
|
|
|
174
174
|
// list() discovers instances; get({ path }) hydrates a specific graph object
|
|
175
175
|
const customers = await Customer.list();
|
|
@@ -397,14 +397,26 @@ Manifest-level logic policies live on effects and apply to every profile:
|
|
|
397
397
|
"withEffect": {
|
|
398
398
|
"name": "approve_ticket",
|
|
399
399
|
"attachedClass": "ticket",
|
|
400
|
-
"inputSchema": {
|
|
401
|
-
|
|
400
|
+
"inputSchema": {
|
|
401
|
+
"type": "object",
|
|
402
|
+
"properties": { "note": { "type": "string" } }
|
|
403
|
+
},
|
|
404
|
+
"outputSchema": {
|
|
405
|
+
"type": "object",
|
|
406
|
+
"properties": { "ok": { "type": "boolean" } }
|
|
407
|
+
},
|
|
402
408
|
"metamodels": {
|
|
403
409
|
"policies": {
|
|
404
410
|
"denyWhen": [
|
|
405
411
|
{
|
|
406
412
|
"reason": "Locked tickets cannot be approved",
|
|
407
|
-
"when": {
|
|
413
|
+
"when": {
|
|
414
|
+
"object": {
|
|
415
|
+
"path": "locked",
|
|
416
|
+
"operator": "eq",
|
|
417
|
+
"booleanValue": true
|
|
418
|
+
}
|
|
419
|
+
}
|
|
408
420
|
}
|
|
409
421
|
]
|
|
410
422
|
}
|
|
@@ -428,15 +440,25 @@ Permission profile files define role-specific access:
|
|
|
428
440
|
"reason": "Active low-risk tickets can be approved",
|
|
429
441
|
"when": {
|
|
430
442
|
"all": [
|
|
431
|
-
{
|
|
432
|
-
|
|
443
|
+
{
|
|
444
|
+
"object": {
|
|
445
|
+
"path": "risk_score",
|
|
446
|
+
"operator": "lte",
|
|
447
|
+
"numberValue": 50
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"stateMachine": {
|
|
452
|
+
"machine": "lifecycle",
|
|
453
|
+
"operator": "eq",
|
|
454
|
+
"stringValue": "active"
|
|
455
|
+
}
|
|
456
|
+
}
|
|
433
457
|
]
|
|
434
458
|
}
|
|
435
459
|
}
|
|
436
460
|
],
|
|
437
|
-
"actions": [
|
|
438
|
-
{ "action": "comment_ticket", "on": "ticket", "allow": "always" }
|
|
439
|
-
]
|
|
461
|
+
"actions": [{ "action": "comment_ticket", "on": "ticket", "allow": "always" }]
|
|
440
462
|
}
|
|
441
463
|
```
|
|
442
464
|
|
|
@@ -462,7 +484,7 @@ granular permissions preview --profile reviewer --action approve_ticket --on tic
|
|
|
462
484
|
|
|
463
485
|
## Domain Synthesis (Auto-Generated Types)
|
|
464
486
|
|
|
465
|
-
After applying the manifest and publishing tools, the sandbox gets **auto-generated TypeScript classes**
|
|
487
|
+
After applying the manifest and publishing tools, the sandbox gets **auto-generated TypeScript classes** through Harness v3 imports such as `@granular/domain/<Class>`:
|
|
466
488
|
|
|
467
489
|
```typescript
|
|
468
490
|
// What the sandbox sees (auto-generated):
|
|
@@ -576,7 +598,9 @@ export declare function global_search(input: {
|
|
|
576
598
|
The LLM or user writes code against these typed classes:
|
|
577
599
|
|
|
578
600
|
```typescript
|
|
579
|
-
import { Author
|
|
601
|
+
import { Author } from "@granular/domain/Author";
|
|
602
|
+
import { Book } from "@granular/domain/Book";
|
|
603
|
+
import { global_search } from "@granular/actions/backend";
|
|
580
604
|
|
|
581
605
|
const totalAuthors = await Author.count();
|
|
582
606
|
const firstPage = await Author.page({ page: 1, perPage: 25 });
|
|
@@ -672,7 +696,7 @@ Registers ontology-scoped live handlers for effects declared in the ontology man
|
|
|
672
696
|
|
|
673
697
|
### `environment.sessions.create(options?)` / `session.submitJob(code)`
|
|
674
698
|
|
|
675
|
-
Open a live runtime session for the environment, then submit code to the sandbox. The code imports typed classes from
|
|
699
|
+
Open a live runtime session for the environment, then submit code to the sandbox. The code imports typed classes from Harness v3 modules such as `@granular/domain/<Class>`.
|
|
676
700
|
|
|
677
701
|
### Live Session State And Durable Collections
|
|
678
702
|
|
package/dist/agent-evals.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import { G as GranularSpendContext, h as OpenAITokenSpend, P as Prompt,
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-B-MPVvDr.mjs';
|
|
2
|
+
import { G as GranularSpendContext, h as OpenAITokenSpend, P as Prompt, bv as RecordObjectOptions, c5 as ManifestContent, c as SessionHeapSnapshot, T as ToolWithHandler, Z as ConnectOptions, al as CreateEnvironmentData, Q as GranularOptions } from './spend-CStuOBXb.mjs';
|
|
3
3
|
import { GranularAgentToolInfo, GeneratedJobCodeIssue, BuildGranularAgentSystemPromptInput, HarnessRenderedPrompt, HarnessRenderedContinuation, HarnessControllerBudgets } from './agent-harness.mjs';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
package/dist/agent-evals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import { G as GranularSpendContext, h as OpenAITokenSpend, P as Prompt,
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-zihxkDDs.js';
|
|
2
|
+
import { G as GranularSpendContext, h as OpenAITokenSpend, P as Prompt, bv as RecordObjectOptions, c5 as ManifestContent, c as SessionHeapSnapshot, T as ToolWithHandler, Z as ConnectOptions, al as CreateEnvironmentData, Q as GranularOptions } from './spend-CStuOBXb.js';
|
|
3
3
|
import { GranularAgentToolInfo, GeneratedJobCodeIssue, BuildGranularAgentSystemPromptInput, HarnessRenderedPrompt, HarnessRenderedContinuation, HarnessControllerBudgets } from './agent-harness.js';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|