@oddington/sdk 0.1.6 → 0.1.7

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.
@@ -58,12 +58,76 @@ export type HostedSessionSource = {
58
58
  };
59
59
  };
60
60
  };
61
- /** OS-owned HTTPS browser bootstrap. Reinitialization replaces the previous context. */
61
+ /** OS-owned hosted or exact-origin local browser bootstrap. Reinitialization replaces the context. */
62
62
  export declare const os: {
63
63
  init(options: {
64
64
  auth: HostedSessionSource;
65
65
  }): void;
66
66
  };
67
+ /** Customer-owned module augmentation supplies types, never runtime authority. */
68
+ export interface AppRoutineTypes {
69
+ }
70
+ export type AppRoutineErrorReason = 'authority_unavailable' | 'execution_unavailable' | 'invalid_input';
71
+ export declare class AppRoutineError extends Error {
72
+ readonly reason: AppRoutineErrorReason;
73
+ constructor(reason: AppRoutineErrorReason);
74
+ }
75
+ export type AppRoutineEvent<Result, Steps> = {
76
+ type: 'started';
77
+ } | {
78
+ [Key in Extract<keyof Steps, string>]: {
79
+ type: 'step';
80
+ id: Key;
81
+ } & (Steps[Key] extends undefined ? {
82
+ summary?: undefined;
83
+ } : {
84
+ summary: Steps[Key];
85
+ });
86
+ }[Extract<keyof Steps, string>] | ({
87
+ type: 'finished';
88
+ state: 'succeeded';
89
+ } & ([Result] extends [undefined] ? {
90
+ result?: undefined;
91
+ } : {
92
+ result: Result;
93
+ })) | {
94
+ type: 'finished';
95
+ state: 'failed';
96
+ error: 'execution_failed';
97
+ } | {
98
+ type: 'finished';
99
+ state: 'cancelled';
100
+ };
101
+ export type AppRoutineHandle<Result, Steps> = {
102
+ events(): AsyncIterable<AppRoutineEvent<Result, Steps>>;
103
+ cancel(): Promise<void>;
104
+ };
105
+ export type AppRoutineBinding<Input, Result, Steps> = {
106
+ availability(): Promise<{
107
+ available: true;
108
+ steps: Extract<keyof Steps, string>[];
109
+ } | {
110
+ available: false;
111
+ reason: 'authority_unavailable' | 'execution_unavailable';
112
+ }>;
113
+ run(input: Input): Promise<AppRoutineHandle<Result, Steps>>;
114
+ recover(): Promise<AppRoutineHandle<Result, Steps>[]>;
115
+ };
116
+ export declare const app: {
117
+ routines: AppRoutineTypes;
118
+ };
119
+ /** A declared stage without a summary takes no second argument. */
120
+ export type AppRunContext<Input, Result, Steps> = {
121
+ readonly input: AppRunInput<Input>;
122
+ step<Key extends Extract<keyof Steps, string>>(id: Key, ...summary: Steps[Key] extends undefined ? [] : [summary: Steps[Key]]): Promise<void>;
123
+ finish(...result: [Result] extends [undefined] ? [] : [result: Result]): Promise<void>;
124
+ };
125
+ export type AppRunInput<Value> = Value extends object ? {
126
+ readonly [Key in keyof Value]: AppRunInput<Value[Key]>;
127
+ } : Value;
128
+ export declare const appRun: {
129
+ current<Input = unknown, Result = undefined, Steps = Record<string, undefined>>(): AppRunContext<Input, Result, Steps> | undefined;
130
+ };
67
131
  export type InboxRequester = (path: string, init?: RequestInit) => Promise<Response>;
68
132
  export type RoutinePublicationClientOptions = {
69
133
  workspace?: string;
@@ -61,6 +61,8 @@ export declare class FileOperationError extends Error {
61
61
  constructor(code: FileErrorCode, status: number, retryable?: boolean);
62
62
  }
63
63
  export declare const FILE_ID_PATTERN: RegExp;
64
+ /** Descriptor admission is independent of each runtime's supported writes. */
65
+ export declare const FILE_ORIGINAL_MAX_BYTES: number;
64
66
  /** Treat descriptor transport as untrusted; no provider fields escape the boundary. */
65
67
  export declare function parseFileDescriptor(value: unknown): File;
66
68
  export declare function parseEnrichmentDescriptor(value: unknown): FileEnrichment;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oddington/sdk",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Oddington routine and response-handler SDK",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",