@granular-software/sdk 0.4.49 → 0.4.50
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/dist/agent-evals.d.mts +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/agent-evals.js +1107 -103
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +1107 -103
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/agent-harness.d.mts +19 -2
- package/dist/agent-harness.d.ts +19 -2
- package/dist/agent-harness.js +79 -26
- package/dist/agent-harness.js.map +1 -1
- package/dist/agent-harness.mjs +78 -27
- package/dist/agent-harness.mjs.map +1 -1
- package/dist/cli/index.js +1008 -66
- package/dist/{client-B-MPVvDr.d.mts → client-BbI7ThzU.d.ts} +62 -1
- package/dist/{client-zihxkDDs.d.ts → client-DaYFTHG8.d.mts} +62 -1
- package/dist/index.d.mts +104 -5
- package/dist/index.d.ts +104 -5
- package/dist/index.js +1189 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1186 -95
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-CStuOBXb.d.mts → spend-RpJikX9w.d.mts} +383 -11
- package/dist/{spend-CStuOBXb.d.ts → spend-RpJikX9w.d.ts} +383 -11
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +2 -1
|
@@ -50,15 +50,6 @@ interface MatchedPolicy {
|
|
|
50
50
|
reason?: string;
|
|
51
51
|
summary: string;
|
|
52
52
|
}
|
|
53
|
-
interface PolicyDecision {
|
|
54
|
-
outcome: PolicyOutcome;
|
|
55
|
-
matches: MatchedPolicy[];
|
|
56
|
-
}
|
|
57
|
-
interface PolicyEvaluationContext {
|
|
58
|
-
input?: Record<string, unknown> | null;
|
|
59
|
-
object?: Record<string, unknown> | null;
|
|
60
|
-
stateMachines?: Record<string, string | null | undefined> | null;
|
|
61
|
-
}
|
|
62
53
|
interface PermissionProfileFile {
|
|
63
54
|
schemaVersion?: number;
|
|
64
55
|
name: string;
|
|
@@ -920,6 +911,16 @@ interface ConversationMessageShowRefs {
|
|
|
920
911
|
listNames?: string[];
|
|
921
912
|
variableNames?: string[];
|
|
922
913
|
fileIds?: string[];
|
|
914
|
+
sessionArtifactIds?: string[];
|
|
915
|
+
actionSuggestions?: ConversationActionSuggestion[];
|
|
916
|
+
}
|
|
917
|
+
interface ConversationActionSuggestion {
|
|
918
|
+
suggestionId?: string;
|
|
919
|
+
label: string;
|
|
920
|
+
description?: string | null;
|
|
921
|
+
artifact?: Record<string, unknown>;
|
|
922
|
+
target?: Record<string, unknown> | null;
|
|
923
|
+
metadata?: Record<string, unknown>;
|
|
923
924
|
}
|
|
924
925
|
interface ConversationMessageInput {
|
|
925
926
|
role: "user" | "assistant";
|
|
@@ -995,6 +996,244 @@ interface SessionFileRecord {
|
|
|
995
996
|
outputPath?: string;
|
|
996
997
|
metadata?: Record<string, unknown>;
|
|
997
998
|
}
|
|
999
|
+
type SessionArtifactStatus = "draft" | "ready" | "needs_edit" | "blocked" | "running" | "awaiting_human" | "completed" | "partially_completed" | "failed" | "canceled" | "stale";
|
|
1000
|
+
type SessionArtifactKind = "effect" | "batch" | "state_path";
|
|
1001
|
+
interface SessionArtifactRecord {
|
|
1002
|
+
artifactId: string;
|
|
1003
|
+
sessionId?: string | null;
|
|
1004
|
+
environmentId?: string | null;
|
|
1005
|
+
subjectId?: string | null;
|
|
1006
|
+
buildId?: string | null;
|
|
1007
|
+
buildVersionNumber?: number | null;
|
|
1008
|
+
createdByJobId?: string | null;
|
|
1009
|
+
kind: SessionArtifactKind;
|
|
1010
|
+
label: string;
|
|
1011
|
+
description?: string | null;
|
|
1012
|
+
status: SessionArtifactStatus;
|
|
1013
|
+
target?: {
|
|
1014
|
+
className: string;
|
|
1015
|
+
id: string;
|
|
1016
|
+
path?: string | null;
|
|
1017
|
+
label?: string | null;
|
|
1018
|
+
} | null;
|
|
1019
|
+
inputValues?: Record<string, unknown>;
|
|
1020
|
+
inputSchema?: {
|
|
1021
|
+
fields?: Array<Record<string, unknown>>;
|
|
1022
|
+
[key: string]: unknown;
|
|
1023
|
+
} | null;
|
|
1024
|
+
relationships?: Record<string, string | string[] | null>;
|
|
1025
|
+
validation?: Record<string, unknown> | null;
|
|
1026
|
+
policy?: Record<string, unknown> | null;
|
|
1027
|
+
metadata?: Record<string, unknown>;
|
|
1028
|
+
parentArtifactId?: string | null;
|
|
1029
|
+
subArtifactIds?: string[];
|
|
1030
|
+
createdAt: number;
|
|
1031
|
+
updatedAt: number;
|
|
1032
|
+
executedAt?: number | null;
|
|
1033
|
+
completedAt?: number | null;
|
|
1034
|
+
canceledAt?: number | null;
|
|
1035
|
+
}
|
|
1036
|
+
interface SessionArtifactListOptions extends SessionCollectionListOptions {
|
|
1037
|
+
jobId?: string | null;
|
|
1038
|
+
latestJob?: boolean | null;
|
|
1039
|
+
kind?: SessionArtifactKind | SessionArtifactKind[] | null;
|
|
1040
|
+
status?: SessionArtifactStatus | SessionArtifactStatus[] | "all" | null;
|
|
1041
|
+
target?: {
|
|
1042
|
+
className?: string | null;
|
|
1043
|
+
id?: string | null;
|
|
1044
|
+
} | null;
|
|
1045
|
+
}
|
|
1046
|
+
interface SessionArtifactValidationResult {
|
|
1047
|
+
ok: boolean;
|
|
1048
|
+
status: SessionArtifactStatus;
|
|
1049
|
+
artifact: SessionArtifactRecord;
|
|
1050
|
+
errors: Array<Record<string, unknown>>;
|
|
1051
|
+
}
|
|
1052
|
+
interface SessionArtifactExecutionResult {
|
|
1053
|
+
ok: boolean;
|
|
1054
|
+
status: SessionArtifactStatus;
|
|
1055
|
+
artifact: SessionArtifactRecord;
|
|
1056
|
+
result?: Record<string, unknown> | null;
|
|
1057
|
+
error?: string | null;
|
|
1058
|
+
}
|
|
1059
|
+
interface SessionArtifactExecutionOptions {
|
|
1060
|
+
idempotencyKey: string;
|
|
1061
|
+
}
|
|
1062
|
+
interface SessionArtifactApprovalOptions extends SessionArtifactExecutionOptions {
|
|
1063
|
+
approved: boolean;
|
|
1064
|
+
reason?: string | null;
|
|
1065
|
+
}
|
|
1066
|
+
type ArtifactApprovalTaskStatus = "awaiting" | "approved" | "denied" | "canceled" | "completed";
|
|
1067
|
+
interface ArtifactApprovalTask {
|
|
1068
|
+
approvalTaskId: string;
|
|
1069
|
+
tenantId: string;
|
|
1070
|
+
sandboxId: string | null;
|
|
1071
|
+
environmentId: string;
|
|
1072
|
+
sessionId: string;
|
|
1073
|
+
artifactId: string;
|
|
1074
|
+
status: ArtifactApprovalTaskStatus;
|
|
1075
|
+
requesterSubjectId: string | null;
|
|
1076
|
+
requiredSubjectId: string | null;
|
|
1077
|
+
requiredPermissionProfileId: string | null;
|
|
1078
|
+
requiredPermissionProfileName: string | null;
|
|
1079
|
+
actorSubjectId: string | null;
|
|
1080
|
+
actorPermissionProfileId: string | null;
|
|
1081
|
+
actorPermissionProfileName: string | null;
|
|
1082
|
+
label: string | null;
|
|
1083
|
+
reason: string | null;
|
|
1084
|
+
decisionReason: string | null;
|
|
1085
|
+
target: {
|
|
1086
|
+
className: string | null;
|
|
1087
|
+
id: string | null;
|
|
1088
|
+
path: string | null;
|
|
1089
|
+
label: string | null;
|
|
1090
|
+
};
|
|
1091
|
+
machineName: string;
|
|
1092
|
+
targetState: string;
|
|
1093
|
+
pendingTransition: string;
|
|
1094
|
+
metadata: Record<string, unknown>;
|
|
1095
|
+
createdAt: number;
|
|
1096
|
+
updatedAt: number;
|
|
1097
|
+
decidedAt: number | null;
|
|
1098
|
+
}
|
|
1099
|
+
interface ArtifactApprovalTaskListOptions extends SessionCollectionListOptions {
|
|
1100
|
+
status?: ArtifactApprovalTaskStatus | ArtifactApprovalTaskStatus[] | null;
|
|
1101
|
+
sessionId?: string | null;
|
|
1102
|
+
artifactId?: string | null;
|
|
1103
|
+
subjectId?: string | null;
|
|
1104
|
+
permissionProfileId?: string | null;
|
|
1105
|
+
permissionProfileName?: string | null;
|
|
1106
|
+
includeUnassigned?: boolean | null;
|
|
1107
|
+
}
|
|
1108
|
+
interface ArtifactApprovalDecisionInput {
|
|
1109
|
+
approved: boolean;
|
|
1110
|
+
reason?: string | null;
|
|
1111
|
+
idempotencyKey?: string | null;
|
|
1112
|
+
}
|
|
1113
|
+
interface ArtifactApprovalDecisionResult {
|
|
1114
|
+
item: ArtifactApprovalTask;
|
|
1115
|
+
runtime?: SessionArtifactExecutionResult;
|
|
1116
|
+
alreadyDecided?: boolean;
|
|
1117
|
+
}
|
|
1118
|
+
type ManualActionStatus = "completed" | "failed" | "canceled" | "started";
|
|
1119
|
+
type ManualActionSource = "app_sdk" | "dock" | "customer_backend" | "manual_import";
|
|
1120
|
+
interface ManualActionTarget {
|
|
1121
|
+
className?: string | null;
|
|
1122
|
+
id?: string | null;
|
|
1123
|
+
path?: string | null;
|
|
1124
|
+
label?: string | null;
|
|
1125
|
+
}
|
|
1126
|
+
interface ManualActionRelatedRecord extends ManualActionTarget {
|
|
1127
|
+
role?: string | null;
|
|
1128
|
+
}
|
|
1129
|
+
interface RecordManualActionInput {
|
|
1130
|
+
/**
|
|
1131
|
+
* Stable idempotency key for this occurrence. Reusing it makes recording safe
|
|
1132
|
+
* across app retries and page reloads.
|
|
1133
|
+
*/
|
|
1134
|
+
idempotencyKey?: string;
|
|
1135
|
+
/** Backwards-compatible explicit occurrence id alias. */
|
|
1136
|
+
actionOccurrenceId?: string;
|
|
1137
|
+
actionKey: string;
|
|
1138
|
+
label?: string | null;
|
|
1139
|
+
status?: ManualActionStatus | null;
|
|
1140
|
+
target?: ManualActionTarget | null;
|
|
1141
|
+
related?: ManualActionRelatedRecord[];
|
|
1142
|
+
input?: Record<string, unknown>;
|
|
1143
|
+
result?: Record<string, unknown> | null;
|
|
1144
|
+
metadata?: Record<string, unknown>;
|
|
1145
|
+
source?: ManualActionSource;
|
|
1146
|
+
actorId?: string | null;
|
|
1147
|
+
occurredAt?: number | string | Date | null;
|
|
1148
|
+
sessionId?: string | null;
|
|
1149
|
+
/**
|
|
1150
|
+
* Optional graph projection for customers who model manual actions as
|
|
1151
|
+
* first-class graph records. Durable audit recording succeeds even if this
|
|
1152
|
+
* best-effort projection fails.
|
|
1153
|
+
*/
|
|
1154
|
+
graphProjection?: boolean | {
|
|
1155
|
+
className?: string;
|
|
1156
|
+
id?: string;
|
|
1157
|
+
label?: string;
|
|
1158
|
+
fields?: Record<string, string | number | boolean | null>;
|
|
1159
|
+
relationships?: Record<string, string | string[]>;
|
|
1160
|
+
};
|
|
1161
|
+
}
|
|
1162
|
+
interface ManualActionOccurrence {
|
|
1163
|
+
actionOccurrenceId: string;
|
|
1164
|
+
tenantId: string;
|
|
1165
|
+
sandboxId: string | null;
|
|
1166
|
+
environmentId: string;
|
|
1167
|
+
sessionId: string | null;
|
|
1168
|
+
subjectId: string | null;
|
|
1169
|
+
actionKey: string;
|
|
1170
|
+
label: string | null;
|
|
1171
|
+
status: ManualActionStatus;
|
|
1172
|
+
target: {
|
|
1173
|
+
className: string | null;
|
|
1174
|
+
id: string | null;
|
|
1175
|
+
path: string | null;
|
|
1176
|
+
label: string | null;
|
|
1177
|
+
};
|
|
1178
|
+
related: ManualActionRelatedRecord[];
|
|
1179
|
+
input: Record<string, unknown>;
|
|
1180
|
+
result: Record<string, unknown> | null;
|
|
1181
|
+
metadata: Record<string, unknown>;
|
|
1182
|
+
source: ManualActionSource;
|
|
1183
|
+
actorId: string | null;
|
|
1184
|
+
occurredAt: number;
|
|
1185
|
+
createdAt: number;
|
|
1186
|
+
updatedAt: number;
|
|
1187
|
+
}
|
|
1188
|
+
interface ManualActionRecordResult {
|
|
1189
|
+
item: ManualActionOccurrence;
|
|
1190
|
+
created: boolean;
|
|
1191
|
+
graphProjection?: {
|
|
1192
|
+
attempted: boolean;
|
|
1193
|
+
ok: boolean;
|
|
1194
|
+
path?: string | null;
|
|
1195
|
+
id?: string | null;
|
|
1196
|
+
className?: string | null;
|
|
1197
|
+
error?: string | null;
|
|
1198
|
+
};
|
|
1199
|
+
}
|
|
1200
|
+
interface ManualActionListOptions extends SessionCollectionListOptions {
|
|
1201
|
+
sessionId?: string | null;
|
|
1202
|
+
subjectId?: string | null;
|
|
1203
|
+
actionKey?: string | null;
|
|
1204
|
+
status?: ManualActionStatus | ManualActionStatus[] | null;
|
|
1205
|
+
source?: ManualActionSource | null;
|
|
1206
|
+
targetClassName?: string | null;
|
|
1207
|
+
targetId?: string | null;
|
|
1208
|
+
relatedClassName?: string | null;
|
|
1209
|
+
relatedId?: string | null;
|
|
1210
|
+
relatedRole?: string | null;
|
|
1211
|
+
since?: number | string | Date | null;
|
|
1212
|
+
until?: number | string | Date | null;
|
|
1213
|
+
}
|
|
1214
|
+
interface ManualActionSuggestion {
|
|
1215
|
+
actionKey: string;
|
|
1216
|
+
label: string | null;
|
|
1217
|
+
targetClassName: string | null;
|
|
1218
|
+
count: number;
|
|
1219
|
+
lastOccurredAt: number;
|
|
1220
|
+
subjectCount: number;
|
|
1221
|
+
successCount: number;
|
|
1222
|
+
failureCount: number;
|
|
1223
|
+
sources: string[];
|
|
1224
|
+
sampleTargetIds: string[];
|
|
1225
|
+
}
|
|
1226
|
+
interface ManualActionSuggestionOptions {
|
|
1227
|
+
subjectId?: string | null;
|
|
1228
|
+
actionKey?: string | null;
|
|
1229
|
+
targetClassName?: string | null;
|
|
1230
|
+
relatedClassName?: string | null;
|
|
1231
|
+
relatedId?: string | null;
|
|
1232
|
+
relatedRole?: string | null;
|
|
1233
|
+
since?: number | string | Date | null;
|
|
1234
|
+
minCount?: number | null;
|
|
1235
|
+
limit?: number | null;
|
|
1236
|
+
}
|
|
998
1237
|
interface SessionFileUploadOptions {
|
|
999
1238
|
filename?: string;
|
|
1000
1239
|
contentType?: string;
|
|
@@ -1108,6 +1347,7 @@ interface SessionCollectionListOptions {
|
|
|
1108
1347
|
}
|
|
1109
1348
|
interface SessionJobListOptions extends SessionCollectionListOptions {
|
|
1110
1349
|
status?: string | null;
|
|
1350
|
+
latest?: boolean | null;
|
|
1111
1351
|
}
|
|
1112
1352
|
interface SessionCollectionListResult<T = unknown> {
|
|
1113
1353
|
items: T[];
|
|
@@ -1317,7 +1557,59 @@ interface RecordObjectOptions {
|
|
|
1317
1557
|
* - For a "many" side: pass an array of target IDs
|
|
1318
1558
|
*/
|
|
1319
1559
|
relationships?: Record<string, string | string[]>;
|
|
1560
|
+
/**
|
|
1561
|
+
* Optional product-owned state observations, keyed by state-machine name.
|
|
1562
|
+
*
|
|
1563
|
+
* A plain string is the observed state name. The object form carries audit
|
|
1564
|
+
* and causality metadata for richer workflow/state-machine integrations.
|
|
1565
|
+
*/
|
|
1566
|
+
states?: Record<string, RecordObjectStateValue>;
|
|
1567
|
+
}
|
|
1568
|
+
type RecordObjectStateValue = string | {
|
|
1569
|
+
state: string;
|
|
1570
|
+
source?: "customer_backend" | "external_sync" | "granular_effect" | "manual";
|
|
1571
|
+
cause?: {
|
|
1572
|
+
kind: "backend_method" | "effect" | "event" | "manual" | "unknown";
|
|
1573
|
+
name?: string;
|
|
1574
|
+
id?: string;
|
|
1575
|
+
};
|
|
1576
|
+
actorId?: string;
|
|
1577
|
+
observedAt?: string | number;
|
|
1578
|
+
force?: boolean;
|
|
1579
|
+
metadata?: Record<string, unknown>;
|
|
1580
|
+
};
|
|
1581
|
+
interface EnvironmentStateTarget {
|
|
1582
|
+
className: string;
|
|
1583
|
+
id: string;
|
|
1584
|
+
label?: string;
|
|
1585
|
+
fields?: Record<string, string | number | boolean | null>;
|
|
1586
|
+
relationships?: Record<string, string | string[]>;
|
|
1587
|
+
}
|
|
1588
|
+
interface EnvironmentStateObservationInput {
|
|
1589
|
+
state?: string;
|
|
1590
|
+
observedState?: string;
|
|
1591
|
+
source?: "customer_backend" | "external_sync" | "granular_effect" | "manual";
|
|
1592
|
+
cause?: {
|
|
1593
|
+
kind: "backend_method" | "effect" | "event" | "manual" | "unknown";
|
|
1594
|
+
name?: string;
|
|
1595
|
+
id?: string;
|
|
1596
|
+
};
|
|
1597
|
+
actorId?: string;
|
|
1598
|
+
observedAt?: string | number;
|
|
1599
|
+
force?: boolean;
|
|
1600
|
+
metadata?: Record<string, unknown>;
|
|
1601
|
+
}
|
|
1602
|
+
interface EnvironmentStateUpdateInput extends EnvironmentStateTarget, Omit<EnvironmentStateObservationInput, "observedState"> {
|
|
1603
|
+
machine: string;
|
|
1604
|
+
state: string;
|
|
1320
1605
|
}
|
|
1606
|
+
type EnvironmentStateMachineProxy = {
|
|
1607
|
+
to(state: string, input?: Omit<EnvironmentStateObservationInput, "state" | "observedState">): Promise<RecordObjectResult>;
|
|
1608
|
+
[stateMethod: string]: any;
|
|
1609
|
+
};
|
|
1610
|
+
type EnvironmentStateProxy = {
|
|
1611
|
+
[machineName: string]: EnvironmentStateMachineProxy;
|
|
1612
|
+
};
|
|
1321
1613
|
/**
|
|
1322
1614
|
* Return value from `recordObject()`
|
|
1323
1615
|
*/
|
|
@@ -1503,15 +1795,87 @@ interface ManifestValidationRuleSpec {
|
|
|
1503
1795
|
}
|
|
1504
1796
|
interface ManifestStateMachineStateSpec {
|
|
1505
1797
|
name: string;
|
|
1798
|
+
label?: string;
|
|
1799
|
+
description?: string;
|
|
1506
1800
|
isFinal?: boolean;
|
|
1507
1801
|
}
|
|
1802
|
+
type ManifestStateTransitionInputBinding = null | string | number | boolean | ManifestStateTransitionInputBinding[] | {
|
|
1803
|
+
[key: string]: ManifestStateTransitionInputBinding;
|
|
1804
|
+
} | {
|
|
1805
|
+
const: unknown;
|
|
1806
|
+
} | {
|
|
1807
|
+
from: "object";
|
|
1808
|
+
path: string;
|
|
1809
|
+
editable?: boolean;
|
|
1810
|
+
} | {
|
|
1811
|
+
from: "field";
|
|
1812
|
+
name: string;
|
|
1813
|
+
editable?: boolean;
|
|
1814
|
+
} | {
|
|
1815
|
+
from: "relationship";
|
|
1816
|
+
name: string;
|
|
1817
|
+
path?: string;
|
|
1818
|
+
many?: boolean;
|
|
1819
|
+
editable?: boolean;
|
|
1820
|
+
} | {
|
|
1821
|
+
from: "session";
|
|
1822
|
+
path: string;
|
|
1823
|
+
editable?: boolean;
|
|
1824
|
+
} | {
|
|
1825
|
+
from: "actor";
|
|
1826
|
+
path: string;
|
|
1827
|
+
editable?: boolean;
|
|
1828
|
+
};
|
|
1829
|
+
interface ManifestStateTransitionActionSpec {
|
|
1830
|
+
effect: string;
|
|
1831
|
+
input?: Record<string, ManifestStateTransitionInputBinding>;
|
|
1832
|
+
}
|
|
1833
|
+
interface ManifestStateTransitionAssigneeSpec {
|
|
1834
|
+
kind: string;
|
|
1835
|
+
from?: ManifestStateTransitionInputBinding;
|
|
1836
|
+
role?: string;
|
|
1837
|
+
label?: string;
|
|
1838
|
+
}
|
|
1839
|
+
interface ManifestStateTransitionRelatedStateRequirementSpec {
|
|
1840
|
+
relationship: string;
|
|
1841
|
+
machine: string;
|
|
1842
|
+
state: string;
|
|
1843
|
+
className?: string;
|
|
1844
|
+
label?: string;
|
|
1845
|
+
mode?: "every" | "some" | "any";
|
|
1846
|
+
}
|
|
1847
|
+
interface ManifestStateTransitionRequirementsSpec {
|
|
1848
|
+
fields?: string[];
|
|
1849
|
+
relationships?: string[];
|
|
1850
|
+
relatedStates?: ManifestStateTransitionRelatedStateRequirementSpec[];
|
|
1851
|
+
}
|
|
1852
|
+
interface ManifestStateTransitionPermissionSpec {
|
|
1853
|
+
profile?: string;
|
|
1854
|
+
profileId?: string;
|
|
1855
|
+
label?: string;
|
|
1856
|
+
reason?: string;
|
|
1857
|
+
}
|
|
1858
|
+
interface ManifestStateTransitionExpectedOutcomeSpec {
|
|
1859
|
+
machine?: string;
|
|
1860
|
+
state: string;
|
|
1861
|
+
summary?: string;
|
|
1862
|
+
}
|
|
1508
1863
|
interface ManifestStateMachineTransitionSpec {
|
|
1509
1864
|
name: string;
|
|
1510
1865
|
from: string;
|
|
1511
1866
|
to: string;
|
|
1867
|
+
label?: string;
|
|
1868
|
+
description?: string;
|
|
1869
|
+
action?: ManifestStateTransitionActionSpec;
|
|
1870
|
+
assignee?: ManifestStateTransitionAssigneeSpec;
|
|
1871
|
+
requirements?: ManifestStateTransitionRequirementsSpec;
|
|
1872
|
+
permission?: ManifestStateTransitionPermissionSpec | string;
|
|
1873
|
+
risk?: "low" | "medium" | "high";
|
|
1874
|
+
expectedOutcome?: ManifestStateTransitionExpectedOutcomeSpec | string;
|
|
1512
1875
|
}
|
|
1513
1876
|
interface ManifestStateMachineSpec {
|
|
1514
1877
|
name: string;
|
|
1878
|
+
stateField?: string;
|
|
1515
1879
|
entryState: string;
|
|
1516
1880
|
states: Array<string | ManifestStateMachineStateSpec>;
|
|
1517
1881
|
transitions: ManifestStateMachineTransitionSpec[];
|
|
@@ -1534,15 +1898,23 @@ interface ManifestApprovalRequiredSpec {
|
|
|
1534
1898
|
reason?: string;
|
|
1535
1899
|
mode?: string;
|
|
1536
1900
|
}
|
|
1901
|
+
type ManifestCreatesSpec = string | {
|
|
1902
|
+
className: string;
|
|
1903
|
+
idPath?: string;
|
|
1904
|
+
pathPath?: string;
|
|
1905
|
+
statePath?: string;
|
|
1906
|
+
classStateHandle?: boolean;
|
|
1907
|
+
};
|
|
1537
1908
|
interface ManifestEffectMetamodelSpec {
|
|
1538
1909
|
postCondition?: string | ManifestPostConditionSpec;
|
|
1539
1910
|
dryRun?: boolean | ManifestDryRunSpec;
|
|
1540
1911
|
reverse?: string | ManifestReverseSpec;
|
|
1541
1912
|
approvalRequired?: boolean | ManifestApprovalRequiredSpec;
|
|
1913
|
+
creates?: ManifestCreatesSpec;
|
|
1542
1914
|
/**
|
|
1543
1915
|
* Declarative effect category used by orchestration/validation.
|
|
1544
1916
|
*
|
|
1545
|
-
* `read` means the
|
|
1917
|
+
* `read` means the effect observes or explains current state without
|
|
1546
1918
|
* changing product state. `write` means it can mutate product state or call an
|
|
1547
1919
|
* external side-effect. `ui` is reserved for frontend-only UI effects.
|
|
1548
1920
|
*/
|
|
@@ -1779,4 +2151,4 @@ declare function toGranularHttpBase(apiUrl: string): string;
|
|
|
1779
2151
|
declare function buildOpenAISpendEventId(usage: Pick<OpenAIUsageSpendEvent, "requestId">, context?: GranularSpendContext): string | undefined;
|
|
1780
2152
|
declare function recordOpenAIUsageSpend(options: RecordOpenAIUsageSpendOptions): Promise<RecordOpenAIUsageSpendResult>;
|
|
1781
2153
|
|
|
1782
|
-
export { type
|
|
2154
|
+
export { type GranularQuotaProgress as $, type AccessTokenProvider as A, type RecordUserOptions as B, type ConditionIR as C, type DomainState as D, type EndpointMode as E, type Subject as F, type GranularSpendContext as G, type OpenEnvironmentOptions as H, type InstanceToolHandler as I, type ConnectOptions as J, type CreateSessionOptions as K, type ConversationSessionInfo as L, type ManifestEffectMetamodelSpec as M, type NormalizedOpenAIUsage as N, type OpenAIModelPricing as O, type Prompt as P, type SpendLineItemType as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type QuotaScopeType as V, type QuotaPeriod as W, type QuotaStatus as X, type SpendSummary as Y, type QuotaLineItemFilter as Z, type GranularQuotaPolicy as _, type EffectHandlerContext as a, type SessionArtifactExecutionResult as a$, type Sandbox as a0, type CreateSandboxData as a1, type SandboxListResponse as a2, type PermissionRules as a3, type PermissionProfile as a4, type CreatePermissionProfileData as a5, type PermissionProfileListResponse as a6, type Assignment as a7, type AssignmentListResponse as a8, type BuildPolicy as a9, type EffectsChangedEvent as aA, type EffectHandler as aB, type InstanceEffectHandler as aC, type JobStatus as aD, type JobFeedbackSentiment as aE, type JobFeedbackToolCall as aF, type JobFeedbackMetadata as aG, type JobFeedbackInput as aH, type JobFeedbackRecord as aI, type EnvironmentFeedbackRecord as aJ, type JobSubmitResult as aK, type Job as aL, type ConversationMessageShowRefs as aM, type ConversationActionSuggestion as aN, type ConversationMessageInput as aO, type ConversationAppendResult as aP, type SessionConversationMessage as aQ, type SessionTimelineEvent as aR, type SessionFileSource as aS, type SessionFileKind as aT, type SessionFileStatus as aU, type SessionFileRecord as aV, type SessionArtifactStatus as aW, type SessionArtifactKind as aX, type SessionArtifactRecord as aY, type SessionArtifactListOptions as aZ, type SessionArtifactValidationResult as a_, type VersionTracking as aa, type VersionTag as ab, type EnvironmentData as ac, type CreateEnvironmentData as ad, type EnvironmentListResponse as ae, type Manifest as af, type ManifestListResponse as ag, type BuildStatus as ah, type Build as ai, type Version as aj, type BuildListResponse as ak, type SemanticVersionDiffEntry as al, type SemanticVersionDiff as am, type ResolvedEffectPostCondition as an, type ResolvedEffectDryRun as ao, type ResolvedEffectReverse as ap, type ResolvedEffectApprovalRequired as aq, type EffectInvocationMode as ar, type EffectInvocationMetadata as as, type EffectSchema as at, type EffectWithHandler as au, type PublishEffectsResult as av, type EffectVersionSelector as aw, type ToolInfo as ax, type EffectInfo as ay, type ToolsChangedEvent as az, type SessionHeapList as b, type RecordImport as b$, type SessionArtifactExecutionOptions as b0, type SessionArtifactApprovalOptions as b1, type ArtifactApprovalTaskStatus as b2, type ArtifactApprovalTask as b3, type ArtifactApprovalTaskListOptions as b4, type ArtifactApprovalDecisionInput as b5, type ArtifactApprovalDecisionResult as b6, type ManualActionStatus as b7, type ManualActionSource as b8, type ManualActionTarget as b9, type WSReconnectErrorInfo as bA, type WSClientOptions as bB, type RPCRequest as bC, type RPCResponse as bD, type SyncMessage as bE, type RPCRequestFromServer as bF, type ToolInvokeParams as bG, type ToolResultParams as bH, type ModelRef as bI, type RelationshipInfo as bJ, type DefineRelationshipOptions as bK, type RecordObjectOptions as bL, type RecordObjectStateValue as bM, type EnvironmentStateTarget as bN, type EnvironmentStateObservationInput as bO, type EnvironmentStateUpdateInput as bP, type EnvironmentStateMachineProxy as bQ, type EnvironmentStateProxy as bR, type RecordObjectResult as bS, type RecordObjectsChunkInfo as bT, type RecordObjectsOptions as bU, type RecordImportWriteMode as bV, type RecordImportOptions as bW, type RecordImportStatus as bX, type RecordImportItemStatus as bY, type RecordImportStats as bZ, type RecordImportItem as b_, type ManualActionRelatedRecord as ba, type RecordManualActionInput as bb, type ManualActionOccurrence as bc, type ManualActionRecordResult as bd, type ManualActionListOptions as be, type ManualActionSuggestion as bf, type ManualActionSuggestionOptions as bg, type SessionFileUploadOptions as bh, type SessionJobRecord as bi, type SessionHeapFieldType as bj, type SessionHeapFieldValue as bk, type SessionHeapVariable as bl, type RecordSearchResult as bm, type RecordSearchOptions as bn, type RecordMentionInput as bo, type SessionDocumentResult as bp, type SessionCollectionListOptions as bq, type SessionJobListOptions as br, type SessionCollectionListResult as bs, type UserEnvironmentPrompt as bt, type UserEnvironmentMessagePreview as bu, type UserEnvironmentSessionState as bv, type UserEnvironmentState as bw, type UserEnvironmentStateOptions as bx, type MarkUserEnvironmentReadOptions as by, type WSDisconnectInfo as bz, type SessionHeapSnapshot as c, type EnvironmentRecordImportSummary as c0, type EnvironmentSetupTriggerReason as c1, type RunEnvironmentImporterOptions as c2, type EnvironmentSetupLifecycleStatus as c3, type EnvironmentSetupSummary as c4, type EnvironmentImporterImportOptions as c5, type EnvironmentImporter as c6, type ManifestPropertySpec as c7, type ManifestValidationOperator as c8, type ManifestEnumRuleSpec as c9, type GraphQLResult as cA, type APIError as cB, type DeleteResponse as cC, type StreamEvent as cD, type StreamSubscription as cE, type StreamStats as cF, type ManifestFilterBySpec as ca, type ManifestValidationRuleSpec as cb, type ManifestStateMachineStateSpec as cc, type ManifestStateTransitionInputBinding as cd, type ManifestStateTransitionActionSpec as ce, type ManifestStateTransitionAssigneeSpec as cf, type ManifestStateTransitionRelatedStateRequirementSpec as cg, type ManifestStateTransitionRequirementsSpec as ch, type ManifestStateTransitionPermissionSpec as ci, type ManifestStateTransitionExpectedOutcomeSpec as cj, type ManifestStateMachineTransitionSpec as ck, type ManifestStateMachineSpec as cl, type ManifestPostConditionSpec as cm, type ManifestDryRunSpec as cn, type ManifestReverseSpec as co, type ManifestApprovalRequiredSpec as cp, type ManifestCreatesSpec as cq, type ManifestRelationshipDef as cr, type ManifestEffectSchema as cs, type ManifestEffectDeclaration as ct, type ManifestEventTypeDef as cu, type ManifestEventStreamDef as cv, type ManifestOperation as cw, type ManifestImport as cx, type ManifestVolume as cy, type ManifestContent as cz, type SessionTranscriptEntry as d, type ToolSchema as e, type PublishToolsResult as f, type ToolHandler as g, type OpenAITokenSpend as h, OPENAI_MODEL_PRICING_USD_PER_MILLION as i, getOpenAIModelPricing as j, calculateOpenAITokenSpend as k, type OpenAIUsageSpendEvent as l, type RecordOpenAIUsageSpendOptions as m, normalizeOpenAIUsage as n, type RecordOpenAIUsageSpendResult as o, buildOpenAISpendEventId as p, type PolicySource as q, recordOpenAIUsageSpend as r, type PolicyPredicateSource as s, toGranularHttpBase as t, type PolicyOperator as u, type PolicyOrigin as v, type PolicyRuleIR as w, type MatchedPolicy as x, type GranularOptions as y, type GranularAuth as z };
|
package/dist/spend.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-
|
|
1
|
+
export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-RpJikX9w.mjs';
|
package/dist/spend.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-
|
|
1
|
+
export { G as GranularSpendContext, l as OpenAIUsageSpendEvent, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, p as buildOpenAISpendEventId, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-RpJikX9w.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@granular-software/sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.50",
|
|
4
4
|
"description": "TypeScript SDK and CLI for Granular - define, build, and deploy AI sandboxes",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@granular-software/metamodel-effect-behaviors": "workspace:*",
|
|
77
77
|
"@granular-software/metamodel-core": "workspace:*",
|
|
78
|
+
"@granular-software/metamodel-validation-rule": "workspace:*",
|
|
78
79
|
"@granular-software/metamodel-preset-default": "workspace:*",
|
|
79
80
|
"@granular-software/policy-engine": "workspace:*",
|
|
80
81
|
"@types/commander": "^2.12.5",
|