@granular-software/sdk 0.4.47 → 0.4.48

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 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 './sandbox-tools';
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": { "type": "object", "properties": { "note": { "type": "string" } } },
401
- "outputSchema": { "type": "object", "properties": { "ok": { "type": "boolean" } } },
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": { "object": { "path": "locked", "operator": "eq", "booleanValue": true } }
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
- { "object": { "path": "risk_score", "operator": "lte", "numberValue": 50 } },
432
- { "stateMachine": { "machine": "lifecycle", "operator": "eq", "stringValue": "active" } }
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** in `./sandbox-tools`:
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, Book, global_search } from "./sandbox-tools";
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 `./sandbox-tools`.
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
 
@@ -1,5 +1,5 @@
1
- import { a as EnvironmentSession, G as Granular } from './client-C1UqPDwe.mjs';
2
- import { G as GranularSpendContext, h as OpenAITokenSpend, P as Prompt, bp as RecordObjectOptions, b$ as ManifestContent, c as SessionHeapSnapshot, T as ToolWithHandler, Z as ConnectOptions, al as CreateEnvironmentData, Q as GranularOptions } from './spend-D2Vy3N1D.mjs';
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';
@@ -1,5 +1,5 @@
1
- import { a as EnvironmentSession, G as Granular } from './client-ButG6ePW.js';
2
- import { G as GranularSpendContext, h as OpenAITokenSpend, P as Prompt, bp as RecordObjectOptions, b$ as ManifestContent, c as SessionHeapSnapshot, T as ToolWithHandler, Z as ConnectOptions, al as CreateEnvironmentData, Q as GranularOptions } from './spend-D2Vy3N1D.js';
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';