@granular-software/sdk 0.4.26 → 0.4.27

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.
@@ -9,7 +9,7 @@ import { Doc } from '@automerge/automerge/slim';
9
9
  * Configuration for the Granular client
10
10
  */
11
11
  type AccessTokenProvider = () => Promise<string | null | undefined> | string | null | undefined;
12
- type EndpointMode = 'auto' | 'local' | 'production';
12
+ type EndpointMode = "auto" | "local" | "production";
13
13
  interface GranularOptions {
14
14
  /** Your Granular API key (for service/CLI auth; use with GRANULAR_API_KEY) */
15
15
  apiKey?: string;
@@ -131,7 +131,7 @@ interface ConversationSessionInfo {
131
131
  environmentId: string;
132
132
  versionId?: string | null;
133
133
  docId: string;
134
- status: 'active' | 'closed' | 'expired';
134
+ status: "active" | "closed" | "expired";
135
135
  createdAt: string;
136
136
  lastSeenAt: string;
137
137
  summary?: string | null;
@@ -239,7 +239,7 @@ interface AssignmentListResponse {
239
239
  * pin themselves to one immutable ontology version.
240
240
  */
241
241
  interface BuildPolicy {
242
- mode: 'tag' | 'current' | 'pinned';
242
+ mode: "tag" | "current" | "pinned";
243
243
  buildId?: string;
244
244
  versionId?: string;
245
245
  tagId?: string;
@@ -250,7 +250,7 @@ interface VersionTag {
250
250
  tagId: string;
251
251
  sandboxId: string;
252
252
  name: string;
253
- kind: 'channel' | 'release' | 'system';
253
+ kind: "channel" | "release" | "system";
254
254
  targetBuildId?: string | null;
255
255
  targetVersionId?: string | null;
256
256
  description?: string | null;
@@ -275,7 +275,7 @@ interface EnvironmentData {
275
275
  tag?: VersionTag | null;
276
276
  tracking?: BuildPolicy;
277
277
  buildPolicy: BuildPolicy;
278
- updateState?: 'up_to_date' | 'update_available' | 'upgrading' | 'failed';
278
+ updateState?: "up_to_date" | "update_available" | "upgrading" | "failed";
279
279
  createdAt: number;
280
280
  updatedAt: number;
281
281
  }
@@ -324,7 +324,7 @@ interface Manifest {
324
324
  interface ManifestListResponse {
325
325
  items: Manifest[];
326
326
  }
327
- type BuildStatus = 'queued' | 'building' | 'completed' | 'failed' | 'canceled';
327
+ type BuildStatus = "queued" | "building" | "completed" | "failed" | "canceled";
328
328
  /**
329
329
  * An immutable ontology version derived from a specific manifest revision.
330
330
  *
@@ -359,8 +359,8 @@ interface BuildListResponse {
359
359
  }
360
360
  interface SemanticVersionDiffEntry {
361
361
  operationId: string;
362
- kind: 'create' | 'update' | 'relationship' | 'effect' | 'eventStream' | 'unknown';
363
- changeType: 'added' | 'removed' | 'changed';
362
+ kind: "create" | "update" | "relationship" | "effect" | "eventStream" | "unknown";
363
+ changeType: "added" | "removed" | "changed";
364
364
  label: string;
365
365
  additive: boolean;
366
366
  breaking: boolean;
@@ -422,7 +422,7 @@ interface ResolvedEffectBehaviors {
422
422
  reverse?: ResolvedEffectReverse;
423
423
  approvalRequired?: ResolvedEffectApprovalRequired;
424
424
  }
425
- type EffectInvocationMode = 'execute' | 'dryRun' | 'reverse';
425
+ type EffectInvocationMode = "execute" | "dryRun" | "reverse";
426
426
  interface EffectInvocationMetadata {
427
427
  mode?: EffectInvocationMode;
428
428
  reverseHandler?: string;
@@ -479,9 +479,9 @@ interface ToolSchema {
479
479
  * ```
480
480
  */
481
481
  outputSchema?: Record<string, unknown>;
482
- stability?: 'stable' | 'experimental' | 'deprecated';
482
+ stability?: "stable" | "experimental" | "deprecated";
483
483
  provenance?: {
484
- source: 'mcp' | 'custom';
484
+ source: "mcp" | "custom";
485
485
  };
486
486
  tags?: string[];
487
487
  /**
@@ -588,8 +588,8 @@ interface EffectsChangedEvent extends ToolsChangedEvent {
588
588
  }
589
589
  type EffectHandler = ToolHandler;
590
590
  type InstanceEffectHandler = InstanceToolHandler;
591
- type JobStatus = 'queued' | 'running' | 'awaitingTool' | 'awaitingHuman' | 'succeeded' | 'failed' | 'timeout' | 'canceled';
592
- type JobFeedbackSentiment = 'good' | 'bad';
591
+ type JobStatus = "queued" | "running" | "awaitingTool" | "awaitingHuman" | "succeeded" | "failed" | "timeout" | "canceled";
592
+ type JobFeedbackSentiment = "good" | "bad";
593
593
  interface JobFeedbackToolCall {
594
594
  callId?: string;
595
595
  toolName?: string;
@@ -601,7 +601,7 @@ interface JobFeedbackToolCall {
601
601
  durationMs?: number | null;
602
602
  }
603
603
  interface JobFeedbackMetadata {
604
- source: 'sdk';
604
+ source: "sdk";
605
605
  status: JobStatus;
606
606
  code: string;
607
607
  domainRevision?: string;
@@ -657,7 +657,7 @@ interface Job {
657
657
  }
658
658
  interface Prompt {
659
659
  id: string;
660
- type: 'confirm' | 'choice' | 'input';
660
+ type: "confirm" | "choice" | "input";
661
661
  title: string;
662
662
  message: string;
663
663
  options?: Array<string | {
@@ -676,7 +676,7 @@ interface ConversationMessageShowRefs {
676
676
  variableNames?: string[];
677
677
  }
678
678
  interface ConversationMessageInput {
679
- role: 'user' | 'assistant';
679
+ role: "user" | "assistant";
680
680
  content?: string;
681
681
  show?: ConversationMessageShowRefs;
682
682
  jobId?: string;
@@ -692,7 +692,7 @@ interface ConversationAppendResult {
692
692
  }
693
693
  interface SessionTranscriptEntry {
694
694
  id: string;
695
- role: 'user' | 'assistant';
695
+ role: "user" | "assistant";
696
696
  content: string;
697
697
  timestamp: number;
698
698
  jobId?: string;
@@ -703,9 +703,9 @@ interface SessionTranscriptEntry {
703
703
  error?: string;
704
704
  show?: ConversationMessageShowRefs;
705
705
  historyContent?: string;
706
- source: 'conversation' | 'job_code' | 'job_result' | 'job_prompt' | 'job_agent_message';
706
+ source: "conversation" | "job_code" | "job_result" | "job_prompt" | "job_agent_message";
707
707
  }
708
- type SessionHeapFieldType = 'string' | 'number' | 'boolean' | 'null' | 'unknown';
708
+ type SessionHeapFieldType = "string" | "number" | "boolean" | "null" | "unknown";
709
709
  interface SessionHeapFieldValue {
710
710
  name: string;
711
711
  type: SessionHeapFieldType;
@@ -733,7 +733,7 @@ interface SessionHeapList {
733
733
  }
734
734
  interface SessionHeapVariable {
735
735
  name: string;
736
- kind: 'entry' | 'list' | 'scalar';
736
+ kind: "entry" | "list" | "scalar";
737
737
  entryPath?: string;
738
738
  listName?: string;
739
739
  value?: string | number | boolean | null;
@@ -770,13 +770,13 @@ interface WSClientOptions {
770
770
  onReconnectError?: (info: WSReconnectErrorInfo) => void;
771
771
  }
772
772
  interface RPCRequest {
773
- type: 'rpc';
773
+ type: "rpc";
774
774
  method: string;
775
775
  params: unknown;
776
776
  id: string;
777
777
  }
778
778
  interface RPCResponse {
779
- type: 'rpc_result' | 'rpc_error';
779
+ type: "rpc_result" | "rpc_error";
780
780
  id: string;
781
781
  result?: unknown;
782
782
  error?: {
@@ -786,12 +786,12 @@ interface RPCResponse {
786
786
  };
787
787
  }
788
788
  interface SyncMessage {
789
- type: 'sync';
789
+ type: "sync";
790
790
  message?: string | number[] | Uint8Array;
791
791
  data?: number[];
792
792
  }
793
793
  interface RPCRequestFromServer {
794
- type: 'rpc';
794
+ type: "rpc";
795
795
  method: string;
796
796
  params: unknown;
797
797
  id: string;
@@ -835,7 +835,7 @@ interface RelationshipInfo {
835
835
  /** The foreign model type */
836
836
  foreign_model: ModelRef;
837
837
  /** Computed relationship kind: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many" */
838
- relationship_kind: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
838
+ relationship_kind: "one_to_one" | "one_to_many" | "many_to_one" | "many_to_many";
839
839
  }
840
840
  /**
841
841
  * Options for defining a relationship between two model types
@@ -934,8 +934,8 @@ interface RecordObjectsOptions {
934
934
  */
935
935
  onChunkComplete?: (info: RecordObjectsChunkInfo) => void | Promise<void>;
936
936
  }
937
- type RecordImportStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'canceled';
938
- type RecordImportItemStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'canceled';
937
+ type RecordImportStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
938
+ type RecordImportItemStatus = "queued" | "processing" | "completed" | "failed" | "canceled";
939
939
  interface RecordImportStats {
940
940
  totalRecords: number;
941
941
  queuedRecords: number;
@@ -1000,10 +1000,14 @@ interface ManifestPropertySpec {
1000
1000
  required?: boolean;
1001
1001
  note?: string | string[];
1002
1002
  enum?: string[] | ManifestEnumRuleSpec;
1003
+ searchable?: boolean | {
1004
+ enabled?: boolean;
1005
+ phonetic?: boolean;
1006
+ };
1003
1007
  filterBy?: boolean | string[] | ManifestFilterBySpec;
1004
1008
  validate?: ManifestValidationRuleSpec[];
1005
1009
  }
1006
- type ManifestValidationOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'true' | 'false' | 'regex' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with';
1010
+ type ManifestValidationOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "true" | "false" | "regex" | "contains" | "not_contains" | "starts_with" | "ends_with";
1007
1011
  interface ManifestEnumRuleSpec {
1008
1012
  values: string[];
1009
1013
  message?: string;
@@ -1092,7 +1096,7 @@ interface ManifestEffectDeclaration {
1092
1096
  isStatic?: boolean;
1093
1097
  inputSchema: ManifestEffectSchema;
1094
1098
  outputSchema?: ManifestEffectSchema;
1095
- stability?: 'stable' | 'experimental' | 'deprecated';
1099
+ stability?: "stable" | "experimental" | "deprecated";
1096
1100
  tags?: string[];
1097
1101
  metamodels?: ManifestEffectMetamodelSpec;
1098
1102
  }
@@ -1153,7 +1157,7 @@ interface ManifestImport {
1153
1157
  }
1154
1158
  interface ManifestVolume {
1155
1159
  name: string;
1156
- scope: 'sandbox' | 'build' | 'user';
1160
+ scope: "sandbox" | "build" | "user";
1157
1161
  imports?: ManifestImport[];
1158
1162
  operations: ManifestOperation[];
1159
1163
  }
@@ -1196,7 +1200,7 @@ interface StreamEvent {
1196
1200
  environmentId: string;
1197
1201
  sessionId?: string;
1198
1202
  subjectId?: string;
1199
- source: 'sandbox' | 'api';
1203
+ source: "sandbox" | "api";
1200
1204
  isAcked: boolean;
1201
1205
  createdAt: number;
1202
1206
  }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-Zoo8YITZ.mjs';
2
- export { b5 as APIError, A as AccessTokenProvider, v as Assignment, w as AssignmentListResponse, L as Build, O as BuildListResponse, B as BuildPolicy, K as BuildStatus, C as ConnectOptions, al as ConversationAppendResult, ak as ConversationMessageInput, aj as ConversationMessageShowRefs, n as ConversationSessionInfo, z as CreateEnvironmentData, t as CreatePermissionProfileData, p as CreateSandboxData, aA as DefineRelationshipOptions, b6 as DeleteResponse, D as DomainState, a9 as EffectHandler, a6 as EffectInfo, a1 as EffectInvocationMetadata, a0 as EffectInvocationMode, a2 as EffectSchema, a3 as EffectWithHandler, a8 as EffectsChangedEvent, e as Environment, y as EnvironmentData, F as EnvironmentListResponse, aK as EnvironmentRecordImportSummary, G as Granular, k as GranularAuth, j as GranularOptions, b4 as GraphQLResult, aa as InstanceEffectHandler, I as InstanceToolHandler, ai as Job, af as JobFeedbackInput, ae as JobFeedbackMetadata, ag as JobFeedbackRecord, ac as JobFeedbackSentiment, ad as JobFeedbackToolCall, ab as JobStatus, ah as JobSubmitResult, H as Manifest, aW as ManifestApprovalRequiredSpec, b3 as ManifestContent, aU as ManifestDryRunSpec, aZ as ManifestEffectDeclaration, aY as ManifestEffectSchema, aN as ManifestEnumRuleSpec, a$ as ManifestEventStreamDef, a_ as ManifestEventTypeDef, aO as ManifestFilterBySpec, b1 as ManifestImport, J as ManifestListResponse, b0 as ManifestOperation, aT as ManifestPostConditionSpec, aL as ManifestPropertySpec, aX as ManifestRelationshipDef, aV as ManifestReverseSpec, aS as ManifestStateMachineSpec, aQ as ManifestStateMachineStateSpec, aR as ManifestStateMachineTransitionSpec, aM as ManifestValidationOperator, aP as ManifestValidationRuleSpec, b2 as ManifestVolume, ay as ModelRef, s as PermissionProfile, u as PermissionProfileListResponse, r as PermissionRules, a4 as PublishEffectsResult, h as PublishToolsResult, as as RPCRequest, av as RPCRequestFromServer, at as RPCResponse, aJ as RecordImport, aI as RecordImportItem, aG as RecordImportItemStatus, aH as RecordImportStats, aF as RecordImportStatus, aB as RecordObjectOptions, aC as RecordObjectResult, aD as RecordObjectsChunkInfo, aE as RecordObjectsOptions, l as RecordUserOptions, az as RelationshipInfo, $ as ResolvedEffectApprovalRequired, Z as ResolvedEffectDryRun, Y as ResolvedEffectPostCondition, _ as ResolvedEffectReverse, o as Sandbox, q as SandboxListResponse, X as SemanticVersionDiff, Q as SemanticVersionDiffEntry, f as Session, am as SessionHeapFieldType, an as SessionHeapFieldValue, ao as SessionHeapVariable, b7 as StreamEvent, b9 as StreamStats, b8 as StreamSubscription, m as Subject, au as SyncMessage, i as ToolHandler, a5 as ToolInfo, aw as ToolInvokeParams, ax as ToolResultParams, g as ToolSchema, a7 as ToolsChangedEvent, U as User, N as Version, x as VersionTag, V as VersionTracking, W as WSClient, ar as WSClientOptions, ap as WSDisconnectInfo, aq as WSReconnectErrorInfo } from './client-Zoo8YITZ.mjs';
1
+ import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-CigjaeO8.mjs';
2
+ export { b5 as APIError, A as AccessTokenProvider, v as Assignment, w as AssignmentListResponse, L as Build, O as BuildListResponse, B as BuildPolicy, K as BuildStatus, C as ConnectOptions, al as ConversationAppendResult, ak as ConversationMessageInput, aj as ConversationMessageShowRefs, n as ConversationSessionInfo, z as CreateEnvironmentData, t as CreatePermissionProfileData, p as CreateSandboxData, aA as DefineRelationshipOptions, b6 as DeleteResponse, D as DomainState, a9 as EffectHandler, a6 as EffectInfo, a1 as EffectInvocationMetadata, a0 as EffectInvocationMode, a2 as EffectSchema, a3 as EffectWithHandler, a8 as EffectsChangedEvent, e as Environment, y as EnvironmentData, F as EnvironmentListResponse, aK as EnvironmentRecordImportSummary, G as Granular, k as GranularAuth, j as GranularOptions, b4 as GraphQLResult, aa as InstanceEffectHandler, I as InstanceToolHandler, ai as Job, af as JobFeedbackInput, ae as JobFeedbackMetadata, ag as JobFeedbackRecord, ac as JobFeedbackSentiment, ad as JobFeedbackToolCall, ab as JobStatus, ah as JobSubmitResult, H as Manifest, aW as ManifestApprovalRequiredSpec, b3 as ManifestContent, aU as ManifestDryRunSpec, aZ as ManifestEffectDeclaration, aY as ManifestEffectSchema, aN as ManifestEnumRuleSpec, a$ as ManifestEventStreamDef, a_ as ManifestEventTypeDef, aO as ManifestFilterBySpec, b1 as ManifestImport, J as ManifestListResponse, b0 as ManifestOperation, aT as ManifestPostConditionSpec, aL as ManifestPropertySpec, aX as ManifestRelationshipDef, aV as ManifestReverseSpec, aS as ManifestStateMachineSpec, aQ as ManifestStateMachineStateSpec, aR as ManifestStateMachineTransitionSpec, aM as ManifestValidationOperator, aP as ManifestValidationRuleSpec, b2 as ManifestVolume, ay as ModelRef, s as PermissionProfile, u as PermissionProfileListResponse, r as PermissionRules, a4 as PublishEffectsResult, h as PublishToolsResult, as as RPCRequest, av as RPCRequestFromServer, at as RPCResponse, aJ as RecordImport, aI as RecordImportItem, aG as RecordImportItemStatus, aH as RecordImportStats, aF as RecordImportStatus, aB as RecordObjectOptions, aC as RecordObjectResult, aD as RecordObjectsChunkInfo, aE as RecordObjectsOptions, l as RecordUserOptions, az as RelationshipInfo, $ as ResolvedEffectApprovalRequired, Z as ResolvedEffectDryRun, Y as ResolvedEffectPostCondition, _ as ResolvedEffectReverse, o as Sandbox, q as SandboxListResponse, X as SemanticVersionDiff, Q as SemanticVersionDiffEntry, f as Session, am as SessionHeapFieldType, an as SessionHeapFieldValue, ao as SessionHeapVariable, b7 as StreamEvent, b9 as StreamStats, b8 as StreamSubscription, m as Subject, au as SyncMessage, i as ToolHandler, a5 as ToolInfo, aw as ToolInvokeParams, ax as ToolResultParams, g as ToolSchema, a7 as ToolsChangedEvent, U as User, N as Version, x as VersionTag, V as VersionTracking, W as WSClient, ar as WSClientOptions, ap as WSDisconnectInfo, aq as WSReconnectErrorInfo } from './client-CigjaeO8.mjs';
3
3
  export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.mjs';
4
4
  import '@automerge/automerge';
5
5
  import '@automerge/automerge/slim';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-Zoo8YITZ.js';
2
- export { b5 as APIError, A as AccessTokenProvider, v as Assignment, w as AssignmentListResponse, L as Build, O as BuildListResponse, B as BuildPolicy, K as BuildStatus, C as ConnectOptions, al as ConversationAppendResult, ak as ConversationMessageInput, aj as ConversationMessageShowRefs, n as ConversationSessionInfo, z as CreateEnvironmentData, t as CreatePermissionProfileData, p as CreateSandboxData, aA as DefineRelationshipOptions, b6 as DeleteResponse, D as DomainState, a9 as EffectHandler, a6 as EffectInfo, a1 as EffectInvocationMetadata, a0 as EffectInvocationMode, a2 as EffectSchema, a3 as EffectWithHandler, a8 as EffectsChangedEvent, e as Environment, y as EnvironmentData, F as EnvironmentListResponse, aK as EnvironmentRecordImportSummary, G as Granular, k as GranularAuth, j as GranularOptions, b4 as GraphQLResult, aa as InstanceEffectHandler, I as InstanceToolHandler, ai as Job, af as JobFeedbackInput, ae as JobFeedbackMetadata, ag as JobFeedbackRecord, ac as JobFeedbackSentiment, ad as JobFeedbackToolCall, ab as JobStatus, ah as JobSubmitResult, H as Manifest, aW as ManifestApprovalRequiredSpec, b3 as ManifestContent, aU as ManifestDryRunSpec, aZ as ManifestEffectDeclaration, aY as ManifestEffectSchema, aN as ManifestEnumRuleSpec, a$ as ManifestEventStreamDef, a_ as ManifestEventTypeDef, aO as ManifestFilterBySpec, b1 as ManifestImport, J as ManifestListResponse, b0 as ManifestOperation, aT as ManifestPostConditionSpec, aL as ManifestPropertySpec, aX as ManifestRelationshipDef, aV as ManifestReverseSpec, aS as ManifestStateMachineSpec, aQ as ManifestStateMachineStateSpec, aR as ManifestStateMachineTransitionSpec, aM as ManifestValidationOperator, aP as ManifestValidationRuleSpec, b2 as ManifestVolume, ay as ModelRef, s as PermissionProfile, u as PermissionProfileListResponse, r as PermissionRules, a4 as PublishEffectsResult, h as PublishToolsResult, as as RPCRequest, av as RPCRequestFromServer, at as RPCResponse, aJ as RecordImport, aI as RecordImportItem, aG as RecordImportItemStatus, aH as RecordImportStats, aF as RecordImportStatus, aB as RecordObjectOptions, aC as RecordObjectResult, aD as RecordObjectsChunkInfo, aE as RecordObjectsOptions, l as RecordUserOptions, az as RelationshipInfo, $ as ResolvedEffectApprovalRequired, Z as ResolvedEffectDryRun, Y as ResolvedEffectPostCondition, _ as ResolvedEffectReverse, o as Sandbox, q as SandboxListResponse, X as SemanticVersionDiff, Q as SemanticVersionDiffEntry, f as Session, am as SessionHeapFieldType, an as SessionHeapFieldValue, ao as SessionHeapVariable, b7 as StreamEvent, b9 as StreamStats, b8 as StreamSubscription, m as Subject, au as SyncMessage, i as ToolHandler, a5 as ToolInfo, aw as ToolInvokeParams, ax as ToolResultParams, g as ToolSchema, a7 as ToolsChangedEvent, U as User, N as Version, x as VersionTag, V as VersionTracking, W as WSClient, ar as WSClientOptions, ap as WSDisconnectInfo, aq as WSReconnectErrorInfo } from './client-Zoo8YITZ.js';
1
+ import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-CigjaeO8.js';
2
+ export { b5 as APIError, A as AccessTokenProvider, v as Assignment, w as AssignmentListResponse, L as Build, O as BuildListResponse, B as BuildPolicy, K as BuildStatus, C as ConnectOptions, al as ConversationAppendResult, ak as ConversationMessageInput, aj as ConversationMessageShowRefs, n as ConversationSessionInfo, z as CreateEnvironmentData, t as CreatePermissionProfileData, p as CreateSandboxData, aA as DefineRelationshipOptions, b6 as DeleteResponse, D as DomainState, a9 as EffectHandler, a6 as EffectInfo, a1 as EffectInvocationMetadata, a0 as EffectInvocationMode, a2 as EffectSchema, a3 as EffectWithHandler, a8 as EffectsChangedEvent, e as Environment, y as EnvironmentData, F as EnvironmentListResponse, aK as EnvironmentRecordImportSummary, G as Granular, k as GranularAuth, j as GranularOptions, b4 as GraphQLResult, aa as InstanceEffectHandler, I as InstanceToolHandler, ai as Job, af as JobFeedbackInput, ae as JobFeedbackMetadata, ag as JobFeedbackRecord, ac as JobFeedbackSentiment, ad as JobFeedbackToolCall, ab as JobStatus, ah as JobSubmitResult, H as Manifest, aW as ManifestApprovalRequiredSpec, b3 as ManifestContent, aU as ManifestDryRunSpec, aZ as ManifestEffectDeclaration, aY as ManifestEffectSchema, aN as ManifestEnumRuleSpec, a$ as ManifestEventStreamDef, a_ as ManifestEventTypeDef, aO as ManifestFilterBySpec, b1 as ManifestImport, J as ManifestListResponse, b0 as ManifestOperation, aT as ManifestPostConditionSpec, aL as ManifestPropertySpec, aX as ManifestRelationshipDef, aV as ManifestReverseSpec, aS as ManifestStateMachineSpec, aQ as ManifestStateMachineStateSpec, aR as ManifestStateMachineTransitionSpec, aM as ManifestValidationOperator, aP as ManifestValidationRuleSpec, b2 as ManifestVolume, ay as ModelRef, s as PermissionProfile, u as PermissionProfileListResponse, r as PermissionRules, a4 as PublishEffectsResult, h as PublishToolsResult, as as RPCRequest, av as RPCRequestFromServer, at as RPCResponse, aJ as RecordImport, aI as RecordImportItem, aG as RecordImportItemStatus, aH as RecordImportStats, aF as RecordImportStatus, aB as RecordObjectOptions, aC as RecordObjectResult, aD as RecordObjectsChunkInfo, aE as RecordObjectsOptions, l as RecordUserOptions, az as RelationshipInfo, $ as ResolvedEffectApprovalRequired, Z as ResolvedEffectDryRun, Y as ResolvedEffectPostCondition, _ as ResolvedEffectReverse, o as Sandbox, q as SandboxListResponse, X as SemanticVersionDiff, Q as SemanticVersionDiffEntry, f as Session, am as SessionHeapFieldType, an as SessionHeapFieldValue, ao as SessionHeapVariable, b7 as StreamEvent, b9 as StreamStats, b8 as StreamSubscription, m as Subject, au as SyncMessage, i as ToolHandler, a5 as ToolInfo, aw as ToolInvokeParams, ax as ToolResultParams, g as ToolSchema, a7 as ToolsChangedEvent, U as User, N as Version, x as VersionTag, V as VersionTracking, W as WSClient, ar as WSClientOptions, ap as WSDisconnectInfo, aq as WSReconnectErrorInfo } from './client-CigjaeO8.js';
3
3
  export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.js';
4
4
  import '@automerge/automerge';
5
5
  import '@automerge/automerge/slim';
package/dist/index.js CHANGED
@@ -4929,9 +4929,24 @@ var Session = class {
4929
4929
  * Get domain documentation for LLMs. Returns types (preferred) or fallback.
4930
4930
  */
4931
4931
  async getDomainDocumentation() {
4932
- const types = await this.getDomainTypes();
4933
- if (types && (types.includes("export declare class") || types.includes("export async function"))) {
4934
- return types;
4932
+ const [types, docs] = await Promise.all([
4933
+ this.getDomainTypes(),
4934
+ this.getDomainDocs()
4935
+ ]);
4936
+ const normalizedTypes = types.trim();
4937
+ const normalizedDocs = docs.trim();
4938
+ if (normalizedTypes && (normalizedTypes.includes("export declare class") || normalizedTypes.includes("export async function"))) {
4939
+ if (!normalizedDocs) {
4940
+ return normalizedTypes;
4941
+ }
4942
+ return [
4943
+ normalizedTypes,
4944
+ "Generated usage notes from ./sandbox-tools docs:",
4945
+ normalizedDocs
4946
+ ].join("\n\n");
4947
+ }
4948
+ if (normalizedDocs) {
4949
+ return normalizedDocs;
4935
4950
  }
4936
4951
  const summary = await this.getDomain();
4937
4952
  return this.generateFallbackDocs(summary);
@@ -9741,10 +9756,15 @@ external_exports.union([
9741
9756
  scalarType: external_exports.string().optional()
9742
9757
  }).strict()
9743
9758
  ]);
9759
+ external_exports.union([
9760
+ external_exports.boolean(),
9761
+ external_exports.object({
9762
+ enabled: external_exports.boolean().optional(),
9763
+ phonetic: external_exports.boolean().optional()
9764
+ }).strict()
9765
+ ]);
9744
9766
  external_exports.object({
9745
- operator: external_exports.enum(
9746
- [...VALIDATION_RULE_OPERATORS]
9747
- ),
9767
+ operator: external_exports.enum([...VALIDATION_RULE_OPERATORS]),
9748
9768
  stringValue: external_exports.string().optional(),
9749
9769
  numberValue: external_exports.number().optional(),
9750
9770
  booleanValue: external_exports.boolean().optional(),
@@ -9837,12 +9857,18 @@ function collectMetamodelSummarySelections(packages) {
9837
9857
  const propertyFields = [];
9838
9858
  const methodFields = [];
9839
9859
  for (const metamodelPackage of packages) {
9840
- pushUnique(classFields, metamodelPackage.summary.selections?.classFields || []);
9860
+ pushUnique(
9861
+ classFields,
9862
+ metamodelPackage.summary.selections?.classFields || []
9863
+ );
9841
9864
  pushUnique(
9842
9865
  propertyFields,
9843
9866
  metamodelPackage.summary.selections?.propertyFields || []
9844
9867
  );
9845
- pushUnique(methodFields, metamodelPackage.summary.selections?.methodFields || []);
9868
+ pushUnique(
9869
+ methodFields,
9870
+ metamodelPackage.summary.selections?.methodFields || []
9871
+ );
9846
9872
  }
9847
9873
  return {
9848
9874
  classFields: unique(classFields),
@@ -9930,7 +9956,11 @@ function createMetamodelRegistry(metamodelPackages) {
9930
9956
  return collectMetamodelSummarySelections(packages);
9931
9957
  },
9932
9958
  applyClassSummaryReaders(rawClass, classSummary) {
9933
- return applyMetamodelSummaryReadersToClass(packages, rawClass, classSummary);
9959
+ return applyMetamodelSummaryReadersToClass(
9960
+ packages,
9961
+ rawClass,
9962
+ classSummary
9963
+ );
9934
9964
  },
9935
9965
  applyPropertySummaryReaders(rawProperty, propertySummary) {
9936
9966
  return applyMetamodelSummaryReadersToProperty(
@@ -9940,7 +9970,11 @@ function createMetamodelRegistry(metamodelPackages) {
9940
9970
  );
9941
9971
  },
9942
9972
  applyMethodSummaryReaders(rawMethod, methodSummary) {
9943
- return applyMetamodelSummaryReadersToMethod(packages, rawMethod, methodSummary);
9973
+ return applyMetamodelSummaryReadersToMethod(
9974
+ packages,
9975
+ rawMethod,
9976
+ methodSummary
9977
+ );
9944
9978
  },
9945
9979
  applyClassIR(classIR, classSummary) {
9946
9980
  return applyMetamodelClassIR(packages, classIR, classSummary);
@@ -9988,6 +10022,10 @@ function mergeClassSummaryPatch(target, patch) {
9988
10022
  }
9989
10023
  function mergePropertySummaryPatch(target, patch) {
9990
10024
  pushUnique(target.notes, patch.notes || []);
10025
+ if (patch.searchable !== void 0) target.searchable = patch.searchable;
10026
+ if (patch.searchablePhonetic !== void 0) {
10027
+ target.searchablePhonetic = patch.searchablePhonetic;
10028
+ }
9991
10029
  if (patch.required !== void 0) target.required = patch.required;
9992
10030
  if (patch.enumRule !== void 0) target.enumRule = patch.enumRule;
9993
10031
  if (patch.filterBy !== void 0) target.filterBy = patch.filterBy;
@@ -9999,9 +10037,11 @@ function mergeMethodSummaryPatch(target, patch) {
9999
10037
  if (patch.effectKey !== void 0) target.effectKey = patch.effectKey;
10000
10038
  if (patch.description !== void 0) target.description = patch.description;
10001
10039
  if (patch.inputSchema !== void 0) target.inputSchema = patch.inputSchema;
10002
- if (patch.outputSchema !== void 0) target.outputSchema = patch.outputSchema;
10040
+ if (patch.outputSchema !== void 0)
10041
+ target.outputSchema = patch.outputSchema;
10003
10042
  if (patch.metamodels !== void 0) target.metamodels = patch.metamodels;
10004
- if (patch.effectBehaviors !== void 0) target.effectBehaviors = patch.effectBehaviors;
10043
+ if (patch.effectBehaviors !== void 0)
10044
+ target.effectBehaviors = patch.effectBehaviors;
10005
10045
  if (patch.static !== void 0) target.static = patch.static;
10006
10046
  }
10007
10047
  function toPascalCase(value) {
@@ -10507,12 +10547,20 @@ function defaultFilterOperators(scalarType) {
10507
10547
  switch ((scalarType || "").toLowerCase()) {
10508
10548
  case "number":
10509
10549
  case "date":
10510
- return ["equal_to", "greater_than", "less_than", "not_null"];
10550
+ return [
10551
+ "equal_to",
10552
+ "greater_than",
10553
+ "greater_than_or_equal_to",
10554
+ "less_than",
10555
+ "less_than_or_equal_to",
10556
+ "not_null"
10557
+ ];
10511
10558
  case "boolean":
10512
- return ["equal_to", "not_null"];
10559
+ return ["equal_to", "true", "false", "not_null"];
10513
10560
  default:
10514
10561
  return [
10515
10562
  "equal_to",
10563
+ "in",
10516
10564
  "contains",
10517
10565
  "not_contains",
10518
10566
  "starts_with",
@@ -10521,16 +10569,26 @@ function defaultFilterOperators(scalarType) {
10521
10569
  ];
10522
10570
  }
10523
10571
  }
10572
+ function supportsDefaultFilterBy(scalarType) {
10573
+ return ["string", "number", "boolean", "date"].includes(
10574
+ String(scalarType || "").toLowerCase()
10575
+ );
10576
+ }
10524
10577
  function normalizeFilterByInput(filterBy, scalarType) {
10525
- if (!filterBy) return null;
10578
+ if (filterBy === false) return null;
10579
+ if (filterBy === void 0) {
10580
+ if (!supportsDefaultFilterBy(scalarType)) return null;
10581
+ return { operators: defaultFilterOperators(scalarType), scalarType };
10582
+ }
10526
10583
  if (filterBy === true) {
10527
- return { operators: defaultFilterOperators(scalarType) };
10584
+ return { operators: defaultFilterOperators(scalarType), scalarType };
10528
10585
  }
10529
10586
  if (Array.isArray(filterBy)) {
10530
- return { operators: filterBy };
10587
+ return { operators: filterBy, scalarType };
10531
10588
  }
10532
10589
  return {
10533
- operators: filterBy.operators
10590
+ operators: filterBy.operators,
10591
+ scalarType: filterBy.scalarType || scalarType
10534
10592
  };
10535
10593
  }
10536
10594
  function buildFilterByFieldMutations(fieldPath, filterBy, scalarType) {
@@ -10541,7 +10599,7 @@ function buildFilterByFieldMutations(fieldPath, filterBy, scalarType) {
10541
10599
  label: `set filterBy on ${fieldPath}`,
10542
10600
  query: `mutation { at(path: ${JSON.stringify(fieldPath)}) { set_filter_by(operators: ${JSON.stringify(
10543
10601
  normalized.operators
10544
- )}) { operators } } }`
10602
+ )}${normalized.scalarType ? `, scalar_type: ${JSON.stringify(normalized.scalarType)}` : ""}) { operators } } }`
10545
10603
  }
10546
10604
  ];
10547
10605
  }
@@ -10551,7 +10609,7 @@ var filterByMetamodelPackage = defineMetamodelPackage({
10551
10609
  fieldRows: [
10552
10610
  {
10553
10611
  key: "filterBy",
10554
- description: "Exposes filter operators for generated query surfaces. Accepts `true`, an operator array, or `{ operators, scalarType }`."
10612
+ description: "Exposes filter operators for generated query surfaces. Scalar fields are filterable by default; set `filterBy: false` to opt out, or override with `true`, an operator array, or `{ operators, scalarType }`."
10555
10613
  }
10556
10614
  ]
10557
10615
  },
@@ -10815,6 +10873,123 @@ var requiredMetamodelPackage = defineMetamodelPackage({
10815
10873
  }
10816
10874
  });
10817
10875
 
10876
+ // ../metamodel-searchable/src/index.ts
10877
+ function supportsDefaultSearchable(scalarType) {
10878
+ return String(scalarType || "").toLowerCase() === "string";
10879
+ }
10880
+ function normalizeSearchableInput(searchable, scalarType) {
10881
+ if (!supportsDefaultSearchable(scalarType)) return null;
10882
+ if (typeof searchable === "boolean" || searchable === void 0) {
10883
+ return {
10884
+ enabled: searchable !== false,
10885
+ phonetic: false
10886
+ };
10887
+ }
10888
+ const enabled = searchable.enabled !== false;
10889
+ return {
10890
+ enabled,
10891
+ phonetic: enabled && searchable.phonetic === true
10892
+ };
10893
+ }
10894
+ function buildSearchableFieldMutations(fieldPath, searchable, scalarType) {
10895
+ const normalized = normalizeSearchableInput(searchable, scalarType);
10896
+ if (normalized === null) return [];
10897
+ return [
10898
+ {
10899
+ label: `set searchable on ${fieldPath}`,
10900
+ query: `mutation { at(path: ${JSON.stringify(fieldPath)}) { set_searchable(enabled: ${normalized.enabled}, phonetic: ${normalized.phonetic}) { enabled phonetic } } }`
10901
+ }
10902
+ ];
10903
+ }
10904
+ var searchableMetamodelPackage = defineMetamodelPackage({
10905
+ id: "searchable",
10906
+ docs: {
10907
+ fieldRows: [
10908
+ {
10909
+ key: "searchable",
10910
+ description: "Controls full-text search exposure for string fields. String fields are searchable by default; set `searchable: false` to opt out, or use `searchable: { phonetic: true }` to keep the field searchable while enabling FalkorDB phonetic matching for class-wide search."
10911
+ }
10912
+ ]
10913
+ },
10914
+ graphql: {
10915
+ typeDefs: [
10916
+ `
10917
+ type SearchableMetamodel {
10918
+ model: Model!
10919
+ enabled: Boolean!
10920
+ phonetic: Boolean!
10921
+ }
10922
+
10923
+ extend type Model {
10924
+ searchable: SearchableMetamodel
10925
+ }
10926
+
10927
+ extend type ModelMutation {
10928
+ set_searchable(enabled: Boolean!, phonetic: Boolean): SearchableMetamodel
10929
+ }
10930
+ `
10931
+ ],
10932
+ createResolvers({ run }) {
10933
+ return {
10934
+ SearchableMetamodel: {
10935
+ model: (value) => value.model,
10936
+ enabled: (value) => value.enabled !== false,
10937
+ phonetic: (value) => value.phonetic === true
10938
+ },
10939
+ Model: {
10940
+ searchable: async (ant) => await run(ant.searchable())
10941
+ },
10942
+ ModelMutation: {
10943
+ set_searchable: async (ant, { enabled, phonetic }) => {
10944
+ return {
10945
+ model: await run(ant.set_searchable(enabled, phonetic === true)),
10946
+ enabled,
10947
+ phonetic: phonetic === true
10948
+ };
10949
+ }
10950
+ }
10951
+ };
10952
+ }
10953
+ },
10954
+ manifest: {
10955
+ buildFieldMutations(fieldPath, spec) {
10956
+ return buildSearchableFieldMutations(
10957
+ fieldPath,
10958
+ spec.searchable,
10959
+ spec.type
10960
+ );
10961
+ }
10962
+ },
10963
+ summary: {
10964
+ selections: {
10965
+ propertyFields: [`searchable { enabled phonetic }`]
10966
+ },
10967
+ readPropertySummary(rawProperty) {
10968
+ if (typeof rawProperty.searchable?.enabled !== "boolean") {
10969
+ return {};
10970
+ }
10971
+ return {
10972
+ searchable: rawProperty.searchable.enabled,
10973
+ searchablePhonetic: rawProperty.searchable.phonetic === true
10974
+ };
10975
+ }
10976
+ },
10977
+ domain: {
10978
+ applyToPropertyIR(propertyIR, propertySummary) {
10979
+ if (String(propertySummary.type || "").toLowerCase() !== "string" || propertySummary.searchable === false) {
10980
+ return propertyIR;
10981
+ }
10982
+ return {
10983
+ ...propertyIR,
10984
+ docs: [
10985
+ ...propertyIR.docs,
10986
+ propertySummary.searchablePhonetic ? "Searchable via `search` using FalkorDB full-text query syntax with phonetic matching enabled." : "Searchable via `search` using FalkorDB full-text query syntax."
10987
+ ]
10988
+ };
10989
+ }
10990
+ }
10991
+ });
10992
+
10818
10993
  // ../metamodel-state-machine/src/index.ts
10819
10994
  function normalizeStateMachines(values) {
10820
10995
  return (values || []).map((machine) => {
@@ -11395,6 +11570,7 @@ var DEFAULT_METAMODEL_PACKAGES = [
11395
11570
  requiredMetamodelPackage,
11396
11571
  enumMetamodelPackage,
11397
11572
  filterByMetamodelPackage,
11573
+ searchableMetamodelPackage,
11398
11574
  validationRuleMetamodelPackage,
11399
11575
  stateMachineMetamodelPackage,
11400
11576
  effectBehaviorsMetamodelPackage