@obversa/api 0.1.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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/dist/accepted-result-support.d.ts +1 -0
  4. package/dist/accepted-result-support.js +5 -0
  5. package/dist/accepted-result-support.js.map +1 -0
  6. package/dist/action-decision.d.ts +15 -0
  7. package/dist/approval-support.d.ts +1 -0
  8. package/dist/approval-support.js +5 -0
  9. package/dist/approval-support.js.map +1 -0
  10. package/dist/artifacts/conformance.d.ts +20 -0
  11. package/dist/artifacts/store.d.ts +30 -0
  12. package/dist/budget.d.ts +36 -0
  13. package/dist/callback/approval.d.ts +80 -0
  14. package/dist/callback/client-contract.d.ts +81 -0
  15. package/dist/callback/gate.d.ts +49 -0
  16. package/dist/callback/stored-client.d.ts +22 -0
  17. package/dist/chunk-6NA4RDQ4.js +81 -0
  18. package/dist/chunk-6NA4RDQ4.js.map +1 -0
  19. package/dist/chunk-6NAMCSPJ.js +331 -0
  20. package/dist/chunk-6NAMCSPJ.js.map +1 -0
  21. package/dist/chunk-6ZP73HZN.js +293 -0
  22. package/dist/chunk-6ZP73HZN.js.map +1 -0
  23. package/dist/chunk-AJ353QD5.js +157 -0
  24. package/dist/chunk-AJ353QD5.js.map +1 -0
  25. package/dist/chunk-VWZKI7AG.js +552 -0
  26. package/dist/chunk-VWZKI7AG.js.map +1 -0
  27. package/dist/chunk-WGLWWKF3.js +135 -0
  28. package/dist/chunk-WGLWWKF3.js.map +1 -0
  29. package/dist/contracts.d.ts +122 -0
  30. package/dist/engine-conformance.d.ts +80 -0
  31. package/dist/environment.d.ts +53 -0
  32. package/dist/error.d.ts +36 -0
  33. package/dist/events/conformance.d.ts +20 -0
  34. package/dist/events/envelope.d.ts +26 -0
  35. package/dist/events/store.d.ts +15 -0
  36. package/dist/graph-commands.d.ts +23 -0
  37. package/dist/graph-contract.d.ts +48 -0
  38. package/dist/graph-executor.d.ts +61 -0
  39. package/dist/graph-kernel.d.ts +2 -0
  40. package/dist/graph-plan.d.ts +140 -0
  41. package/dist/graph-type.d.ts +45 -0
  42. package/dist/index.d.ts +33 -0
  43. package/dist/index.js +806 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/json.d.ts +14 -0
  46. package/dist/memory-conformance.d.ts +17 -0
  47. package/dist/memory-types.d.ts +127 -0
  48. package/dist/model-identity.d.ts +28 -0
  49. package/dist/node-data-context.d.ts +11 -0
  50. package/dist/preflight-result.d.ts +17 -0
  51. package/dist/proof/acceptance.d.ts +60 -0
  52. package/dist/proof/artifact.d.ts +2 -0
  53. package/dist/proof/cache.d.ts +46 -0
  54. package/dist/reasoning-record-contract.d.ts +52 -0
  55. package/dist/result-contract.d.ts +16 -0
  56. package/dist/result.d.ts +30 -0
  57. package/dist/run-definition-support.d.ts +1 -0
  58. package/dist/run-definition-support.js +5 -0
  59. package/dist/run-definition-support.js.map +1 -0
  60. package/dist/run-definition.d.ts +73 -0
  61. package/dist/storage/error.d.ts +7 -0
  62. package/dist/storage/id.d.ts +2 -0
  63. package/dist/testing.d.ts +5 -0
  64. package/dist/testing.js +1745 -0
  65. package/dist/testing.js.map +1 -0
  66. package/dist/workspace/conformance.d.ts +30 -0
  67. package/dist/workspace/policy.d.ts +6 -0
  68. package/dist/workspace/provider.d.ts +132 -0
  69. package/package.json +68 -0
@@ -0,0 +1,30 @@
1
+ import type { AgentResult, AgentResultPart, EngineIncompleteResultEvidence, EngineSelectionRecord, EngineTransportFailure, UsageReceipt } from './contracts.js';
2
+ export declare function validateIncompleteResultEvidence(result: EngineIncompleteResultEvidence): EngineIncompleteResultEvidence;
3
+ export declare function validateAgentResult(result: AgentResult): AgentResult;
4
+ export declare function engineSelection(input: {
5
+ adapter: string;
6
+ adapterVersion?: string | null;
7
+ provider?: string | null;
8
+ modelFamily?: string | null;
9
+ model?: string | null;
10
+ executable?: string | null;
11
+ capabilities?: readonly string[];
12
+ }): EngineSelectionRecord;
13
+ export declare function reportedUsage(usage: {
14
+ inputTokens: number;
15
+ outputTokens: number;
16
+ cacheCreationInputTokens?: number;
17
+ cacheReadInputTokens?: number;
18
+ }): UsageReceipt;
19
+ export declare function assistantResult(input: {
20
+ text: string;
21
+ usage: UsageReceipt;
22
+ requested: EngineSelectionRecord;
23
+ effective?: EngineSelectionRecord;
24
+ stopReason?: string;
25
+ transportFailure?: EngineTransportFailure;
26
+ raw?: unknown;
27
+ }): AgentResult;
28
+ export declare function finalResultPart(result: AgentResult): AgentResultPart;
29
+ export declare function finalResultText(result: AgentResult): string | undefined;
30
+ export declare function requireFinalResultText(result: AgentResult): string;
@@ -0,0 +1 @@
1
+ export { runDefinitionSupport } from './run-definition.js';
@@ -0,0 +1,5 @@
1
+ export { runDefinitionSupport } from './chunk-VWZKI7AG.js';
2
+ import './chunk-WGLWWKF3.js';
3
+ import './chunk-AJ353QD5.js';
4
+ //# sourceMappingURL=run-definition-support.js.map
5
+ //# sourceMappingURL=run-definition-support.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"run-definition-support.js"}
@@ -0,0 +1,73 @@
1
+ import type { CompiledGraphDefinition, RunBrief } from './graph-contract.js';
2
+ import { type JsonObject, type JsonValue, type Sha256Digest } from './json.js';
3
+ import { type ArtifactReference, type ArtifactStore } from './artifacts/store.js';
4
+ import { type DomainEventEnvelope, type NewDomainEvent } from './events/envelope.js';
5
+ import type { EventStore } from './events/store.js';
6
+ export interface StorageProviderRecord extends JsonObject {
7
+ readonly schemaVersion: 1;
8
+ readonly name: string;
9
+ readonly version: string;
10
+ readonly configDigest: Sha256Digest;
11
+ }
12
+ export interface SensitiveContentPolicy extends JsonObject {
13
+ readonly marked: 'reject';
14
+ readonly exact: 'reject';
15
+ readonly freeText: 'redact-before-hash';
16
+ }
17
+ export interface RunStoragePolicy extends JsonObject {
18
+ readonly schemaVersion: 1;
19
+ readonly maxEventPayloadBytes: number;
20
+ readonly maxAppendBatchBytes: number;
21
+ readonly maxArtifactBytes: number;
22
+ readonly maxTotalArtifactBytesPerRun: number;
23
+ readonly retention: 'until-run-delete';
24
+ readonly sensitiveContent: SensitiveContentPolicy;
25
+ }
26
+ export interface RunStorageRecord extends JsonObject {
27
+ readonly schemaVersion: 1;
28
+ readonly namespace: string;
29
+ readonly eventStore: StorageProviderRecord;
30
+ readonly artifactStore: StorageProviderRecord;
31
+ readonly policy: RunStoragePolicy;
32
+ }
33
+ export interface RunDefinition extends JsonObject {
34
+ readonly schemaVersion: 1;
35
+ readonly runId: string;
36
+ readonly graphDefinition: CompiledGraphDefinition;
37
+ readonly resolvedPlan: ArtifactReference<'resolved-plan'>;
38
+ readonly resolvedInputs: RunBrief;
39
+ readonly storage: RunStorageRecord;
40
+ readonly workspaceBinding: JsonObject | null;
41
+ readonly hostBinding: ArtifactReference<'host-binding'> | null;
42
+ }
43
+ export interface RunStartedPayload extends JsonObject {
44
+ readonly definition: RunDefinition;
45
+ }
46
+ export type NewRunStartedEvent = NewDomainEvent<'graph:run-started', 1, RunStartedPayload>;
47
+ export type RunStartRecord = DomainEventEnvelope<'graph:run-started', 1, RunStartedPayload>;
48
+ export interface RunStorageBinding {
49
+ readonly record: RunStorageRecord;
50
+ readonly eventStore: EventStore;
51
+ readonly artifactStore: ArtifactStore;
52
+ readonly knownSecrets: readonly string[];
53
+ }
54
+ type RecordValue = Readonly<Record<string, JsonValue>>;
55
+ declare function fail(path: string, message: string): never;
56
+ declare function json(value: unknown, path: string): JsonValue;
57
+ declare function record(value: unknown, path: string, label: string): RecordValue;
58
+ declare function text(value: unknown, path: string, label: string): string;
59
+ declare function digest(value: unknown, path: string): Sha256Digest;
60
+ export declare function validateRunStoragePolicy(value: unknown): RunStoragePolicy;
61
+ export declare function validateRunStorageRecord(value: unknown): RunStorageRecord;
62
+ declare function validateCompiledDefinition(value: unknown): CompiledGraphDefinition;
63
+ export declare function validateRunDefinition(value: unknown): RunDefinition;
64
+ export declare function validateRunStartRecord(value: unknown): RunStartRecord;
65
+ export declare const runDefinitionSupport: Readonly<{
66
+ fail: typeof fail;
67
+ json: typeof json;
68
+ record: typeof record;
69
+ text: typeof text;
70
+ digest: typeof digest;
71
+ validateCompiledDefinition: typeof validateCompiledDefinition;
72
+ }>;
73
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type JsonObject } from '../json.js';
2
+ export type StorageErrorCode = 'INVALID_STORED_VALUE' | 'UNSUPPORTED_ENVELOPE_VERSION' | 'REVISION_CONFLICT' | 'DUPLICATE_EVENT_ID' | 'CORRUPT_EVENT_STREAM' | 'ARTIFACT_NOT_FOUND' | 'ARTIFACT_NOT_ADMITTED' | 'ARTIFACT_INTEGRITY' | 'STORAGE_LIMIT_EXCEEDED' | 'SENSITIVE_CONTENT' | 'KNOWN_SECRET' | 'UNSAFE_STORAGE_PATH';
3
+ export declare class StorageError extends Error {
4
+ readonly code: StorageErrorCode;
5
+ readonly details: JsonObject;
6
+ constructor(code: StorageErrorCode, message: string, details?: JsonObject);
7
+ }
@@ -0,0 +1,2 @@
1
+ /** Validate one namespace, stream, or run identity used by a storage port. */
2
+ export declare function validateStorageId(value: unknown, path: string): string;
@@ -0,0 +1,5 @@
1
+ export * from './engine-conformance.js';
2
+ export * from './memory-conformance.js';
3
+ export * from './events/conformance.js';
4
+ export * from './artifacts/conformance.js';
5
+ export * from './workspace/conformance.js';