@oddington/sdk 0.1.21 → 0.1.22

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.
@@ -4,6 +4,8 @@ import type { Connections } from '../../../shared/airtable-contract.js';
4
4
  import type { DataRepository } from '../../../shared/data-contract.js';
5
5
  import type { Handler } from '../../../shared/inbox-contract.js';
6
6
  import type { files, RoutinePublicationClient } from './public.js';
7
+ import type { RoutineAccess } from '../../../shared/routine-definition-contract.js';
8
+ export type { RoutineAccess } from '../../../shared/routine-definition-contract.js';
7
9
  declare const valueType: unique symbol;
8
10
  /** Serializable declaration; the phantom type never carries authority. */
9
11
  export type RoutineSchema<Value, Defaulted extends boolean = boolean> = AppValueSchema & {
@@ -12,13 +14,6 @@ export type RoutineSchema<Value, Defaulted extends boolean = boolean> = AppValue
12
14
  readonly hasDefault?: Defaulted;
13
15
  };
14
16
  export type RoutineSchemaValue<Schema> = Schema extends RoutineSchema<infer Value> ? Value : undefined;
15
- export type RoutineAccess = {
16
- readonly repositories?: Readonly<Record<string, 'read' | 'write'>>;
17
- readonly connections?: readonly string[];
18
- readonly models?: readonly string[];
19
- readonly files?: 'read' | 'read-write';
20
- readonly publish?: readonly ('asks' | 'digests')[];
21
- };
22
17
  export type RoutineStepOutput = {
23
18
  summary: unknown;
24
19
  data: unknown;
@@ -104,4 +99,3 @@ export type RoutineSchemaBuilders = {
104
99
  boolean(): RoutineSchema<boolean, false>;
105
100
  };
106
101
  export type RoutineFileSchema = () => RoutineSchema<File, false>;
107
- export {};
@@ -11,8 +11,8 @@ export declare const INBOX_LOCAL_INPUT_BYTES: number;
11
11
  export declare const INBOX_UUID: RegExp;
12
12
  export type InboxOperation = 'current' | 'items.list' | 'items.read' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.list' | 'questions.answer' | 'questions.searchRecords' | 'files.read';
13
13
  export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
14
- /** Closed wire vocabulary. Hosts select the listing mode; input cannot select it. */
15
- export declare function parseInboxRequest(value: unknown, questionListContext?: 'local' | 'hosted'): {
14
+ /** Closed wire vocabulary; both placements require an explicit relevance filter. */
15
+ export declare function parseInboxRequest(value: unknown): {
16
16
  operation: InboxOperation;
17
17
  input: Record<string, unknown>;
18
18
  };
@@ -64,6 +64,7 @@ export type LinkedAskSnapshot = {
64
64
  done: boolean;
65
65
  };
66
66
  export interface InboxItem {
67
+ canonicalRoutineId?: string | null;
67
68
  id: string;
68
69
  workspaceId: string;
69
70
  number: number;
@@ -116,23 +117,20 @@ export interface ResponseAcceptance {
116
117
  acceptanceOrder?: number;
117
118
  }
118
119
  export interface AnswerableQuestion {
119
- item: {
120
- id: string;
121
- number: number;
122
- revision: number;
123
- title: string;
124
- href: string;
125
- };
126
- origin: {
127
- routine: string;
128
- };
129
- question: {
120
+ itemId: string;
121
+ revision: number;
122
+ title: string;
123
+ inboxUrl: string;
124
+ questionId: string;
125
+ routine: string;
126
+ prompt: string;
127
+ instructions?: string;
128
+ response: ResponseDefinition;
129
+ answerable: boolean;
130
+ recordRefs: Array<{
131
+ repository: string;
130
132
  id: string;
131
- prompt: string;
132
- instructions: string | null;
133
- response: ResponseDefinition;
134
- };
135
- recordRefs: string[];
133
+ }>;
136
134
  }
137
135
  export interface AskUpdate {
138
136
  item: InboxItem;
@@ -185,7 +183,7 @@ export interface InboxMember {
185
183
  }): Promise<RecipientAddition>;
186
184
  };
187
185
  questions: {
188
- list(input?: InboxQuestionListInput): Promise<AnswerableQuestion[]>;
186
+ list(input: InboxQuestionListInput): Promise<AnswerableQuestion[]>;
189
187
  answer(input: InboxAnswerInput): Promise<ResponseAcceptance>;
190
188
  searchRecords(input: InboxSearchInput): Promise<RecordSelectionResult>;
191
189
  };
@@ -0,0 +1,33 @@
1
+ import { type AppValueSchema } from './app-routine-contract.js';
2
+ export type RoutineAccess = {
3
+ readonly repositories?: Readonly<Record<string, 'read' | 'write'>>;
4
+ readonly connections?: readonly string[];
5
+ readonly models?: readonly string[];
6
+ readonly files?: 'read' | 'read-write';
7
+ readonly publish?: readonly ('asks' | 'digests')[];
8
+ };
9
+ export type RoutineContract = {
10
+ id: string;
11
+ title?: string;
12
+ input: AppValueSchema;
13
+ inputDefault?: unknown;
14
+ access: RoutineAccess;
15
+ responses: {
16
+ id: string;
17
+ }[];
18
+ steps: {
19
+ id: string;
20
+ title: string;
21
+ }[];
22
+ result?: AppValueSchema;
23
+ };
24
+ export declare const routineTitle: (value: unknown) => value is string;
25
+ export declare function freezeRoutineMetadata<Value>(value: Value): Value;
26
+ /** Reject values JSON would drop, rewrite, or obtain by invoking authored code. */
27
+ export declare function assertRoutineJson(value: unknown, ancestors?: Set<object>): void;
28
+ /** Inspect property descriptors before reading authored metadata or functions. */
29
+ export declare function assertRoutineFields(value: unknown, allowed?: string[]): asserts value is Record<string, any>;
30
+ export declare function parseRoutineAccess(value: unknown): RoutineAccess;
31
+ /** Inert report/admission grammar shared with authoring; imports no runtime or
32
+ * capability modules and never constructs executable customer functions. */
33
+ export declare function parseRoutineDefinitionContract(value: unknown): RoutineContract;
@@ -0,0 +1,47 @@
1
+ import type { RoutineSourceProvenance } from './routine-source-provenance.js';
2
+ import type { RoutineContract } from './routine-definition-contract.js';
3
+ export declare const ROUTINE_DECLARATION_SCHEMA = "https://schemas.oddington.ai/routine/v1.json";
4
+ export declare const ROUTINE_SOURCE_LIMITS: {
5
+ files: number;
6
+ bytes: number;
7
+ declarationBytes: number;
8
+ };
9
+ export type RoutineDeclaration = {
10
+ $schema: typeof ROUTINE_DECLARATION_SCHEMA;
11
+ access: {
12
+ repositories: Record<string, 'read' | 'write'>;
13
+ connections: string[];
14
+ models: string[];
15
+ files?: 'read' | 'read-write';
16
+ publish: Array<'asks' | 'digests'>;
17
+ };
18
+ runtime: {
19
+ features: Array<'python' | 'documents' | 'browser'>;
20
+ resources: 'standard' | 'large';
21
+ maxDuration: string;
22
+ };
23
+ retry: {
24
+ maxAttempts: number;
25
+ };
26
+ assets: string[];
27
+ };
28
+ export type RoutineDeploymentSource = {
29
+ digest: string;
30
+ declaration: RoutineDeclaration;
31
+ definition?: {
32
+ entry: string;
33
+ contract: RoutineContract;
34
+ };
35
+ files: Array<{
36
+ path: string;
37
+ sha256: string;
38
+ size: number;
39
+ }>;
40
+ provenance?: RoutineSourceProvenance;
41
+ };
42
+ /** An authored definition has one fixed, private execution profile. */
43
+ export declare function routineDefinitionDeclaration(contract: RoutineContract): RoutineDeclaration;
44
+ export declare function routineDefinitionDirectory(entry: string): string;
45
+ export declare const routineAlias: (value: unknown) => value is string;
46
+ export declare function routineAssetPattern(value: unknown): value is string;
47
+ export declare function parseRoutineDeclaration(value: unknown): RoutineDeclaration;
@@ -0,0 +1,6 @@
1
+ export declare const isRoutineSourceDirectory: (value: string) => boolean;
2
+ /** Both the collector and untrusted upload/build admission use this boundary. */
3
+ export declare function eligibleDeploymentPath(path: string): boolean;
4
+ /** Package metadata is admitted only at the root and selected direct child.
5
+ * Inventory parsing has no selection yet; sealing supplies the exact name. */
6
+ export declare function eligibleDeploymentInputPath(path: string, routine?: string): boolean;
@@ -0,0 +1,7 @@
1
+ /** Checkout evidence is descriptive and never selects routine authority. */
2
+ export type RoutineSourceProvenance = {
3
+ branch?: string;
4
+ commit?: string;
5
+ dirty: boolean;
6
+ };
7
+ export declare function parseRoutineSourceProvenance(value: unknown): RoutineSourceProvenance;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oddington/sdk",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Oddington routine and response-handler SDK",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",