@tinycloud/operations 0.4.0-beta.8 → 0.4.0

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 (39) hide show
  1. package/coverage.json +6 -0
  2. package/dist/artifacts.cjs +103 -6633
  3. package/dist/artifacts.cjs.map +1 -1
  4. package/dist/artifacts.d.cts +1 -1
  5. package/dist/artifacts.d.ts +1 -1
  6. package/dist/artifacts.js +84 -6614
  7. package/dist/artifacts.js.map +1 -1
  8. package/dist/cli-runtime.cjs +572 -6979
  9. package/dist/cli-runtime.cjs.map +1 -1
  10. package/dist/cli-runtime.d.cts +1 -1
  11. package/dist/cli-runtime.d.ts +1 -1
  12. package/dist/cli-runtime.js +566 -6972
  13. package/dist/cli-runtime.js.map +1 -1
  14. package/dist/{contract-xMIIMtpF.d.cts → contract-BRwWJpPs.d.cts} +24 -2
  15. package/dist/{contract-xMIIMtpF.d.ts → contract-BRwWJpPs.d.ts} +24 -2
  16. package/dist/delegation-binding.cjs +162 -6644
  17. package/dist/delegation-binding.cjs.map +1 -1
  18. package/dist/delegation-binding.d.cts +43 -13
  19. package/dist/delegation-binding.d.ts +43 -13
  20. package/dist/delegation-binding.js +147 -6630
  21. package/dist/delegation-binding.js.map +1 -1
  22. package/dist/index.cjs +571 -6981
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.js +565 -6974
  27. package/dist/index.js.map +1 -1
  28. package/dist/profile.cjs.map +1 -1
  29. package/dist/profile.d.cts +1 -1
  30. package/dist/profile.d.ts +1 -1
  31. package/dist/profile.js.map +1 -1
  32. package/dist/state.cjs +9 -3
  33. package/dist/state.cjs.map +1 -1
  34. package/dist/state.d.cts +7 -0
  35. package/dist/state.d.ts +7 -0
  36. package/dist/state.js +9 -3
  37. package/dist/state.js.map +1 -1
  38. package/generated/operations.json +2727 -4
  39. package/package.json +4 -3
@@ -1,4 +1,4 @@
1
- declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
1
+ declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "AUTH_REQUIRED", "PERMISSION_DENIED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "STORAGE_QUOTA_EXCEEDED", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
2
2
  type OperationErrorCode = (typeof OPERATION_ERROR_CODES)[number];
3
3
  interface OperationError {
4
4
  readonly code: OperationErrorCode;
@@ -25,6 +25,24 @@ interface OperationContextSummary {
25
25
  readonly ownerDid?: string;
26
26
  readonly space?: string;
27
27
  }
28
+ /**
29
+ * Why a stored grant was not used. A fixed vocabulary: diagnostics never
30
+ * carry exception text, node responses, URLs or other stored transport data.
31
+ * `unbound`: the record has no valid request binding where one is required;
32
+ * `outside_request`: its signed authority exceeds its binding.
33
+ */
34
+ declare const STORED_GRANT_SKIP_REASONS: readonly ["malformed", "unbound", "outside_request", "host_mismatch", "expired", "cid_mismatch", "authority_invalid", "proof_missing", "proof_invalid", "owner_mismatch", "audience_mismatch", "resources_mismatch", "unsupported", "activation_rejected", "invalid"];
35
+ type StoredGrantSkipReason = typeof STORED_GRANT_SKIP_REASONS[number];
36
+ /**
37
+ * A non-fatal diagnostic attached to a result. `STORED_GRANT_SKIPPED`: a
38
+ * stored grant failed validation and gave no authority; `grantCid` is present
39
+ * only when the stored CID is the CID of the stored authorization bytes.
40
+ */
41
+ interface OperationWarning {
42
+ readonly code: "STORED_GRANT_SKIPPED";
43
+ readonly reason: StoredGrantSkipReason;
44
+ readonly grantCid?: string;
45
+ }
28
46
  /**
29
47
  * Capability details are finalized by the authority/artifacts increment. The
30
48
  * kernel intentionally preserves them as canonical operation-owned data.
@@ -58,6 +76,7 @@ interface OperationOkResult<O> {
58
76
  readonly operation: OperationRef;
59
77
  readonly context: OperationContextSummary;
60
78
  readonly output: O;
79
+ readonly warnings?: readonly OperationWarning[];
61
80
  }
62
81
  interface OperationAuthorityRequiredResult {
63
82
  readonly status: "authority_required";
@@ -67,6 +86,7 @@ interface OperationAuthorityRequiredResult {
67
86
  readonly request: PermissionRequestArtifact;
68
87
  readonly approval: ApprovalAction;
69
88
  readonly retry: RetryDescriptor;
89
+ readonly warnings?: readonly OperationWarning[];
70
90
  }
71
91
  interface OperationSetupRequiredResult {
72
92
  readonly status: "setup_required";
@@ -74,12 +94,14 @@ interface OperationSetupRequiredResult {
74
94
  readonly context: OperationContextSummary;
75
95
  readonly setup: SetupAction;
76
96
  readonly retry: RetryDescriptor;
97
+ readonly warnings?: readonly OperationWarning[];
77
98
  }
78
99
  interface OperationErrorResult {
79
100
  readonly status: "error";
80
101
  readonly operation: OperationRef;
81
102
  readonly context: OperationContextSummary;
82
103
  readonly error: OperationError;
104
+ readonly warnings?: readonly OperationWarning[];
83
105
  }
84
106
  type OperationResult<O> = OperationOkResult<O> | OperationAuthorityRequiredResult | OperationSetupRequiredResult | OperationErrorResult;
85
107
  /**
@@ -100,4 +122,4 @@ interface InvocationTarget {
100
122
  readonly privateKey?: string;
101
123
  }
102
124
 
103
- export type { InvocationTarget as I, OperationOperatorType as O, TinyCloudPosture as T, OperationResult as a, OperationContextSummary as b };
125
+ export type { InvocationTarget as I, OperationOperatorType as O, StoredGrantSkipReason as S, TinyCloudPosture as T, OperationResult as a, OperationContextSummary as b };
@@ -1,4 +1,4 @@
1
- declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
1
+ declare const OPERATION_ERROR_CODES: readonly ["INPUT_INVALID", "OPERATION_NOT_FOUND", "OPERATION_VERSION_UNSUPPORTED", "PROFILE_NOT_FOUND", "PROFILE_POSTURE_NOT_ALLOWED", "PROFILE_OWNER_OPT_IN_REQUIRED", "AUTH_REQUIRED", "PERMISSION_DENIED", "SESSION_NOT_FOUND", "PERMISSION_HINT_INVALID", "DELEGATION_ARTIFACT_INVALID", "DELEGATION_EXPIRED", "DELEGATION_AUDIENCE_MISMATCH", "DELEGATION_HOST_MISMATCH", "DELEGATION_REJECTED", "ENCRYPTION_NETWORK_UNRESOLVED", "NODE_UNREACHABLE", "NODE_ERROR", "STORAGE_QUOTA_EXCEEDED", "KV_NOT_FOUND", "KV_PRECONDITION_FAILED", "KV_CONFLICT", "KV_RESPONSE_TOO_LARGE", "SQL_QUERY_INVALID", "SQL_EXECUTION_FAILED", "SQL_RESULT_LIMIT_EXCEEDED", "SQL_VALUE_UNSAFE", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
2
2
  type OperationErrorCode = (typeof OPERATION_ERROR_CODES)[number];
3
3
  interface OperationError {
4
4
  readonly code: OperationErrorCode;
@@ -25,6 +25,24 @@ interface OperationContextSummary {
25
25
  readonly ownerDid?: string;
26
26
  readonly space?: string;
27
27
  }
28
+ /**
29
+ * Why a stored grant was not used. A fixed vocabulary: diagnostics never
30
+ * carry exception text, node responses, URLs or other stored transport data.
31
+ * `unbound`: the record has no valid request binding where one is required;
32
+ * `outside_request`: its signed authority exceeds its binding.
33
+ */
34
+ declare const STORED_GRANT_SKIP_REASONS: readonly ["malformed", "unbound", "outside_request", "host_mismatch", "expired", "cid_mismatch", "authority_invalid", "proof_missing", "proof_invalid", "owner_mismatch", "audience_mismatch", "resources_mismatch", "unsupported", "activation_rejected", "invalid"];
35
+ type StoredGrantSkipReason = typeof STORED_GRANT_SKIP_REASONS[number];
36
+ /**
37
+ * A non-fatal diagnostic attached to a result. `STORED_GRANT_SKIPPED`: a
38
+ * stored grant failed validation and gave no authority; `grantCid` is present
39
+ * only when the stored CID is the CID of the stored authorization bytes.
40
+ */
41
+ interface OperationWarning {
42
+ readonly code: "STORED_GRANT_SKIPPED";
43
+ readonly reason: StoredGrantSkipReason;
44
+ readonly grantCid?: string;
45
+ }
28
46
  /**
29
47
  * Capability details are finalized by the authority/artifacts increment. The
30
48
  * kernel intentionally preserves them as canonical operation-owned data.
@@ -58,6 +76,7 @@ interface OperationOkResult<O> {
58
76
  readonly operation: OperationRef;
59
77
  readonly context: OperationContextSummary;
60
78
  readonly output: O;
79
+ readonly warnings?: readonly OperationWarning[];
61
80
  }
62
81
  interface OperationAuthorityRequiredResult {
63
82
  readonly status: "authority_required";
@@ -67,6 +86,7 @@ interface OperationAuthorityRequiredResult {
67
86
  readonly request: PermissionRequestArtifact;
68
87
  readonly approval: ApprovalAction;
69
88
  readonly retry: RetryDescriptor;
89
+ readonly warnings?: readonly OperationWarning[];
70
90
  }
71
91
  interface OperationSetupRequiredResult {
72
92
  readonly status: "setup_required";
@@ -74,12 +94,14 @@ interface OperationSetupRequiredResult {
74
94
  readonly context: OperationContextSummary;
75
95
  readonly setup: SetupAction;
76
96
  readonly retry: RetryDescriptor;
97
+ readonly warnings?: readonly OperationWarning[];
77
98
  }
78
99
  interface OperationErrorResult {
79
100
  readonly status: "error";
80
101
  readonly operation: OperationRef;
81
102
  readonly context: OperationContextSummary;
82
103
  readonly error: OperationError;
104
+ readonly warnings?: readonly OperationWarning[];
83
105
  }
84
106
  type OperationResult<O> = OperationOkResult<O> | OperationAuthorityRequiredResult | OperationSetupRequiredResult | OperationErrorResult;
85
107
  /**
@@ -100,4 +122,4 @@ interface InvocationTarget {
100
122
  readonly privateKey?: string;
101
123
  }
102
124
 
103
- export type { InvocationTarget as I, OperationOperatorType as O, TinyCloudPosture as T, OperationResult as a, OperationContextSummary as b };
125
+ export type { InvocationTarget as I, OperationOperatorType as O, StoredGrantSkipReason as S, TinyCloudPosture as T, OperationResult as a, OperationContextSummary as b };