@oddington/sdk 0.1.66 → 0.1.67
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/README.md +7 -0
- package/dist/browser.js +4924 -4
- package/dist/index.js +4 -4
- package/dist/types/packages/sdk/src/public.d.ts +2 -2
- package/dist/types/packages/sdk/src/routine-definition-types.d.ts +3 -0
- package/dist/types/shared/local-routine-contract.d.ts +23 -0
- package/dist/types/shared/routine-definition-contract.d.ts +3 -0
- package/dist/types/shared/routine-schedule.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AskInput, DigestInput, PublicationRequest, PublishedAsk, PublishedDigest, ResolutionInput } from '../../../shared/inbox-contract.js';
|
|
2
|
-
export type { RoutineSchema, RoutineSchemaValue, RoutineDefinition, RoutineInput, RoutineRuntime, RoutineAccess, RoutineCapabilities, SharedRoutineCapabilities, ResponseCapabilities, ResponseAction, RoutineStep, RoutineSteps, RoutineStepInput, RoutineStepResult, RoutineStepOutput, RoutineArtifactInput, RoutineArtifact, RoutineAI } from './routine-definition-types.js';
|
|
2
|
+
export type { RoutineSchema, RoutineSchemaValue, RoutineDefinition, RoutineInput, RoutineRuntime, RoutineAccess, RoutineSchedule, RoutineCapabilities, SharedRoutineCapabilities, ResponseCapabilities, ResponseAction, RoutineStep, RoutineSteps, RoutineStepInput, RoutineStepResult, RoutineStepOutput, RoutineArtifactInput, RoutineArtifact, RoutineAI } from './routine-definition-types.js';
|
|
3
3
|
export declare const defineResponse: import('./routine-definition-types.js').DefineResponse;
|
|
4
4
|
export declare const defineRoutine: import('./routine-definition-types.js').DefineRoutine;
|
|
5
5
|
export declare const schema: import('./routine-definition-types.js').RoutineSchemaBuilders;
|
|
@@ -198,7 +198,7 @@ export type RunSummary = {
|
|
|
198
198
|
id: string;
|
|
199
199
|
routine: string;
|
|
200
200
|
placement: 'local' | 'remote';
|
|
201
|
-
status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
201
|
+
status: 'queued' | 'running' | 'succeeded' | 'failed' | 'legacy';
|
|
202
202
|
createdAt: string;
|
|
203
203
|
startedAt?: string;
|
|
204
204
|
finishedAt?: string;
|
|
@@ -7,6 +7,8 @@ import type { Handler, HandlerRuntime, HandlerTransition, JsonValue } from '../.
|
|
|
7
7
|
import type { files, RoutinePublicationClient } from './public.js';
|
|
8
8
|
import type { RoutineAccess } from '../../../shared/routine-definition-contract.js';
|
|
9
9
|
import type { RoutineAIInput } from '../../../shared/routine-ai-contract.js';
|
|
10
|
+
import type { RoutineSchedule } from '../../../shared/routine-schedule.js';
|
|
11
|
+
export type { RoutineSchedule } from '../../../shared/routine-schedule.js';
|
|
10
12
|
export type { RoutineAccess } from '../../../shared/routine-definition-contract.js';
|
|
11
13
|
declare const valueType: unique symbol;
|
|
12
14
|
/** Serializable declaration; the phantom type never carries authority. */
|
|
@@ -122,6 +124,7 @@ export type RoutineDefinition<Input extends RoutineSchema<unknown> | undefined =
|
|
|
122
124
|
readonly id: Id;
|
|
123
125
|
readonly title?: string;
|
|
124
126
|
readonly input?: Input;
|
|
127
|
+
readonly schedule?: RoutineSchedule;
|
|
125
128
|
readonly steps?: Steps;
|
|
126
129
|
readonly result?: Result;
|
|
127
130
|
readonly access?: Access;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type AppValueSchema } from './app-routine-contract.js';
|
|
2
|
+
import { type File } from './files-contract.js';
|
|
3
|
+
export declare const LOCAL_ROUTINE_VALUE_BYTES: number;
|
|
4
|
+
export type LocalRoutineContract = {
|
|
5
|
+
id?: string;
|
|
6
|
+
input: AppValueSchema;
|
|
7
|
+
steps: Array<{
|
|
8
|
+
id: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
summary?: AppValueSchema;
|
|
11
|
+
}>;
|
|
12
|
+
result?: AppValueSchema;
|
|
13
|
+
};
|
|
14
|
+
export declare function parseLocalRoutineContract(value: unknown): LocalRoutineContract;
|
|
15
|
+
export declare function validateLocalRoutineValue(schema: AppValueSchema, value: unknown): void;
|
|
16
|
+
/** Only declared File leaves are authority inputs; arbitrary IDs are ordinary data. */
|
|
17
|
+
export declare function localRoutineInputFiles(schema: AppValueSchema, value: unknown): File[];
|
|
18
|
+
/** Placement follows the declaration, including nested and repeated File leaves. */
|
|
19
|
+
export declare function routineInputFilePlacements(schema: AppValueSchema, value: unknown, host: 'local' | 'remote'): Array<{
|
|
20
|
+
file: File;
|
|
21
|
+
storage: 'local' | 'remote' | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function hasLocalRoutineFileInput(schema: AppValueSchema): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AppValueSchema } from './app-routine-contract.js';
|
|
2
|
+
import { type RoutineSchedule } from './routine-schedule.js';
|
|
2
3
|
export type RoutineAccess = {
|
|
3
4
|
readonly repositories?: Readonly<Record<string, 'read' | 'write'>>;
|
|
4
5
|
readonly connections?: readonly string[];
|
|
@@ -9,6 +10,7 @@ export type RoutineAccess = {
|
|
|
9
10
|
export type RoutineContract = {
|
|
10
11
|
id: string;
|
|
11
12
|
title?: string;
|
|
13
|
+
schedule?: RoutineSchedule;
|
|
12
14
|
input: AppValueSchema;
|
|
13
15
|
inputDefault?: unknown;
|
|
14
16
|
access: RoutineAccess;
|
|
@@ -28,6 +30,7 @@ export declare function assertRoutineJson(value: unknown, ancestors?: Set<object
|
|
|
28
30
|
/** Inspect property descriptors before reading authored metadata or functions. */
|
|
29
31
|
export declare function assertRoutineFields(value: unknown, allowed?: string[]): asserts value is Record<string, any>;
|
|
30
32
|
export declare function parseRoutineAccess(value: unknown): RoutineAccess;
|
|
33
|
+
export declare function routineScheduleMetadata(value: unknown, input: AppValueSchema, hasDefault: boolean): RoutineSchedule;
|
|
31
34
|
/** Inert report/admission grammar shared with authoring; imports no runtime or
|
|
32
35
|
* capability modules and never constructs executable customer functions. */
|
|
33
36
|
export declare function parseRoutineDefinitionContract(value: unknown): RoutineContract;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type RoutineSchedule = {
|
|
2
|
+
readonly cron: string;
|
|
3
|
+
readonly timezone: string;
|
|
4
|
+
};
|
|
5
|
+
/** One occurrence evaluator for authored validation and activation/tick projection.
|
|
6
|
+
* The parser jumps calendar fields rather than walking elapsed minutes. Its own
|
|
7
|
+
* iteration ceiling plus this eight-year horizon bound even sparse schedules
|
|
8
|
+
* (including Feb 29 across a non-leap century). No missed times are enumerated. */
|
|
9
|
+
export declare function nextRoutineScheduleOccurrence(schedule: RoutineSchedule, after: Date): Date;
|