@tinycloud/operations 0.1.0-beta.1

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 (41) hide show
  1. package/coverage.json +136 -0
  2. package/dist/artifacts.cjs +7072 -0
  3. package/dist/artifacts.cjs.map +1 -0
  4. package/dist/artifacts.d.cts +391 -0
  5. package/dist/artifacts.d.ts +391 -0
  6. package/dist/artifacts.js +7054 -0
  7. package/dist/artifacts.js.map +1 -0
  8. package/dist/cli-runtime.cjs +9604 -0
  9. package/dist/cli-runtime.cjs.map +1 -0
  10. package/dist/cli-runtime.d.cts +9 -0
  11. package/dist/cli-runtime.d.ts +9 -0
  12. package/dist/cli-runtime.js +9609 -0
  13. package/dist/cli-runtime.js.map +1 -0
  14. package/dist/contract-mCY8LFFI.d.cts +97 -0
  15. package/dist/contract-mCY8LFFI.d.ts +97 -0
  16. package/dist/index.cjs +9381 -0
  17. package/dist/index.cjs.map +1 -0
  18. package/dist/index.d.cts +6 -0
  19. package/dist/index.d.ts +6 -0
  20. package/dist/index.js +9386 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/profile.cjs +194 -0
  23. package/dist/profile.cjs.map +1 -0
  24. package/dist/profile.d.cts +61 -0
  25. package/dist/profile.d.ts +61 -0
  26. package/dist/profile.js +171 -0
  27. package/dist/profile.js.map +1 -0
  28. package/dist/secret-capabilities.cjs +36 -0
  29. package/dist/secret-capabilities.cjs.map +1 -0
  30. package/dist/secret-capabilities.d.cts +6 -0
  31. package/dist/secret-capabilities.d.ts +6 -0
  32. package/dist/secret-capabilities.js +10 -0
  33. package/dist/secret-capabilities.js.map +1 -0
  34. package/dist/state.cjs +381 -0
  35. package/dist/state.cjs.map +1 -0
  36. package/dist/state.d.cts +79 -0
  37. package/dist/state.d.ts +79 -0
  38. package/dist/state.js +337 -0
  39. package/dist/state.js.map +1 -0
  40. package/generated/operations.json +6082 -0
  41. package/package.json +76 -0
@@ -0,0 +1,97 @@
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", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
2
+ type OperationErrorCode = (typeof OPERATION_ERROR_CODES)[number];
3
+ interface OperationError {
4
+ readonly code: OperationErrorCode;
5
+ readonly message: string;
6
+ readonly retryable: boolean;
7
+ readonly details?: Readonly<Record<string, unknown>>;
8
+ }
9
+
10
+ /** A stable, cross-surface operation identifier. */
11
+ type OperationId = string;
12
+ type TinyCloudPosture = "owner-openkey" | "delegate-session" | "local-owner-key" | "unauthenticated";
13
+ type OperationOperatorType = "human" | "agent";
14
+ /**
15
+ * Safe identity reported with every result. This deliberately excludes keys,
16
+ * tokens, delegations, grants, and operation inputs or outputs.
17
+ */
18
+ interface OperationContextSummary {
19
+ readonly profile: string;
20
+ readonly host: string;
21
+ readonly posture: TinyCloudPosture;
22
+ readonly operatorType?: OperationOperatorType;
23
+ readonly principalDid?: string;
24
+ readonly sessionDid?: string;
25
+ readonly ownerDid?: string;
26
+ readonly space?: string;
27
+ }
28
+ /**
29
+ * Capability details are finalized by the authority/artifacts increment. The
30
+ * kernel intentionally preserves them as canonical operation-owned data.
31
+ */
32
+ type CapabilityRequirement = Readonly<Record<string, unknown>>;
33
+ interface PermissionRequestArtifact {
34
+ readonly requestId: string;
35
+ readonly [key: string]: unknown;
36
+ }
37
+ interface ApprovalAction {
38
+ readonly kind: "openkey";
39
+ readonly requestId: string;
40
+ readonly url?: string;
41
+ readonly fallback: string;
42
+ }
43
+ interface SetupAction {
44
+ readonly kind: string;
45
+ readonly [key: string]: unknown;
46
+ }
47
+ interface OperationRef {
48
+ readonly operationId: OperationId;
49
+ readonly operationVersion: number;
50
+ }
51
+ interface RetryDescriptor extends OperationRef {
52
+ readonly inputDigest: string;
53
+ readonly safeInput?: Readonly<Record<string, unknown>>;
54
+ readonly requiresCallerInput: boolean;
55
+ }
56
+ interface OperationOkResult<O> {
57
+ readonly status: "ok";
58
+ readonly operation: OperationRef;
59
+ readonly context: OperationContextSummary;
60
+ readonly output: O;
61
+ }
62
+ interface OperationAuthorityRequiredResult {
63
+ readonly status: "authority_required";
64
+ readonly operation: OperationRef;
65
+ readonly context: OperationContextSummary;
66
+ readonly missing: readonly CapabilityRequirement[];
67
+ readonly request: PermissionRequestArtifact;
68
+ readonly approval: ApprovalAction;
69
+ readonly retry: RetryDescriptor;
70
+ }
71
+ interface OperationSetupRequiredResult {
72
+ readonly status: "setup_required";
73
+ readonly operation: OperationRef;
74
+ readonly context: OperationContextSummary;
75
+ readonly setup: SetupAction;
76
+ readonly retry: RetryDescriptor;
77
+ }
78
+ interface OperationErrorResult {
79
+ readonly status: "error";
80
+ readonly operation: OperationRef;
81
+ readonly context: OperationContextSummary;
82
+ readonly error: OperationError;
83
+ }
84
+ type OperationResult<O> = OperationOkResult<O> | OperationAuthorityRequiredResult | OperationSetupRequiredResult | OperationErrorResult;
85
+ /**
86
+ * The only caller-controlled invocation settings. `privateKey` is a CLI-only,
87
+ * nonpersistable override; it is deliberately excluded from result metadata,
88
+ * retry descriptors, diagnostics, and all state written by this package.
89
+ */
90
+ interface InvocationTarget {
91
+ readonly profile?: string;
92
+ readonly host?: string;
93
+ readonly allowOwnerProfile?: boolean;
94
+ readonly privateKey?: string;
95
+ }
96
+
97
+ export type { InvocationTarget as I, OperationOperatorType as O, TinyCloudPosture as T, OperationResult as a, OperationContextSummary as b };
@@ -0,0 +1,97 @@
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", "SECRET_READ_FAILED", "SECRET_DECRYPT_FAILED", "OUTPUT_INVALID", "INTERNAL_ERROR"];
2
+ type OperationErrorCode = (typeof OPERATION_ERROR_CODES)[number];
3
+ interface OperationError {
4
+ readonly code: OperationErrorCode;
5
+ readonly message: string;
6
+ readonly retryable: boolean;
7
+ readonly details?: Readonly<Record<string, unknown>>;
8
+ }
9
+
10
+ /** A stable, cross-surface operation identifier. */
11
+ type OperationId = string;
12
+ type TinyCloudPosture = "owner-openkey" | "delegate-session" | "local-owner-key" | "unauthenticated";
13
+ type OperationOperatorType = "human" | "agent";
14
+ /**
15
+ * Safe identity reported with every result. This deliberately excludes keys,
16
+ * tokens, delegations, grants, and operation inputs or outputs.
17
+ */
18
+ interface OperationContextSummary {
19
+ readonly profile: string;
20
+ readonly host: string;
21
+ readonly posture: TinyCloudPosture;
22
+ readonly operatorType?: OperationOperatorType;
23
+ readonly principalDid?: string;
24
+ readonly sessionDid?: string;
25
+ readonly ownerDid?: string;
26
+ readonly space?: string;
27
+ }
28
+ /**
29
+ * Capability details are finalized by the authority/artifacts increment. The
30
+ * kernel intentionally preserves them as canonical operation-owned data.
31
+ */
32
+ type CapabilityRequirement = Readonly<Record<string, unknown>>;
33
+ interface PermissionRequestArtifact {
34
+ readonly requestId: string;
35
+ readonly [key: string]: unknown;
36
+ }
37
+ interface ApprovalAction {
38
+ readonly kind: "openkey";
39
+ readonly requestId: string;
40
+ readonly url?: string;
41
+ readonly fallback: string;
42
+ }
43
+ interface SetupAction {
44
+ readonly kind: string;
45
+ readonly [key: string]: unknown;
46
+ }
47
+ interface OperationRef {
48
+ readonly operationId: OperationId;
49
+ readonly operationVersion: number;
50
+ }
51
+ interface RetryDescriptor extends OperationRef {
52
+ readonly inputDigest: string;
53
+ readonly safeInput?: Readonly<Record<string, unknown>>;
54
+ readonly requiresCallerInput: boolean;
55
+ }
56
+ interface OperationOkResult<O> {
57
+ readonly status: "ok";
58
+ readonly operation: OperationRef;
59
+ readonly context: OperationContextSummary;
60
+ readonly output: O;
61
+ }
62
+ interface OperationAuthorityRequiredResult {
63
+ readonly status: "authority_required";
64
+ readonly operation: OperationRef;
65
+ readonly context: OperationContextSummary;
66
+ readonly missing: readonly CapabilityRequirement[];
67
+ readonly request: PermissionRequestArtifact;
68
+ readonly approval: ApprovalAction;
69
+ readonly retry: RetryDescriptor;
70
+ }
71
+ interface OperationSetupRequiredResult {
72
+ readonly status: "setup_required";
73
+ readonly operation: OperationRef;
74
+ readonly context: OperationContextSummary;
75
+ readonly setup: SetupAction;
76
+ readonly retry: RetryDescriptor;
77
+ }
78
+ interface OperationErrorResult {
79
+ readonly status: "error";
80
+ readonly operation: OperationRef;
81
+ readonly context: OperationContextSummary;
82
+ readonly error: OperationError;
83
+ }
84
+ type OperationResult<O> = OperationOkResult<O> | OperationAuthorityRequiredResult | OperationSetupRequiredResult | OperationErrorResult;
85
+ /**
86
+ * The only caller-controlled invocation settings. `privateKey` is a CLI-only,
87
+ * nonpersistable override; it is deliberately excluded from result metadata,
88
+ * retry descriptors, diagnostics, and all state written by this package.
89
+ */
90
+ interface InvocationTarget {
91
+ readonly profile?: string;
92
+ readonly host?: string;
93
+ readonly allowOwnerProfile?: boolean;
94
+ readonly privateKey?: string;
95
+ }
96
+
97
+ export type { InvocationTarget as I, OperationOperatorType as O, TinyCloudPosture as T, OperationResult as a, OperationContextSummary as b };