@minionry/sdk 0.4.23 → 0.5.2

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/dist/types.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- export declare const SCOPES: readonly ["identity", "storage", "files:app", "pm:read", "agents:run", "pm:write", "files:workspace:read", "files:workspace:write", "notifications", "pm:execute", "pm:schedule", "agents:sessions", "browser:read", "browser:control", "settings:read", "git:read", "git:write", "git:remote", "terminal:read", "terminal:exec", "tools:serve", "quality:read", "quality:run", "inference:run", "endpoints:register"];
1
+ export declare const SCOPES: readonly ["identity", "storage", "files:app", "pm:read", "agents:run", "pm:write", "files:workspace:read", "files:workspace:write", "notifications", "pm:execute", "pm:schedule", "agents:sessions", "browser:read", "browser:control", "settings:read", "git:read", "git:write", "git:remote", "terminal:read", "terminal:exec", "tools:serve", "quality:read", "quality:run", "inference:run", "endpoints:register", "pm:chain", "agents:schedule"];
2
2
  export type Scope = (typeof SCOPES)[number];
3
3
  export type ScopeRiskTier = 'low' | 'medium' | 'high' | 'critical';
4
4
  export declare const SCOPE_RISK_TIERS: Readonly<Record<Scope, ScopeRiskTier>>;
5
- export declare const MINIONRY_ERROR_CODES: readonly ["USER_REJECTED", "SCOPE_DENIED", "RATE_LIMITED", "SPACE_DISCONNECTED", "QUOTA_EXCEEDED", "UNSUPPORTED", "CANCELLED"];
5
+ export declare const MINIONRY_ERROR_CODES: readonly ["USER_REJECTED", "SCOPE_DENIED", "RATE_LIMITED", "SPACE_DISCONNECTED", "QUOTA_EXCEEDED", "UNSUPPORTED", "CANCELLED", "CONFLICT"];
6
6
  export type MinionryErrorCode = (typeof MINIONRY_ERROR_CODES)[number];
7
7
  export declare class MinionryError extends Error {
8
8
  readonly code: MinionryErrorCode | (string & {});
@@ -36,11 +36,18 @@ export declare const AGENT_RUN_LIMITS: {
36
36
  };
37
37
  export declare const AGENT_RUN_MODEL_SELECTIONS: readonly ["quality"];
38
38
  export type AgentRunModelSelection = (typeof AGENT_RUN_MODEL_SELECTIONS)[number];
39
+ export interface AgentRunEngineSelection {
40
+ engine?: string;
41
+ model?: string;
42
+ effortLevel?: string;
43
+ fastMode?: boolean;
44
+ }
39
45
  export interface AgentRunRequest {
40
46
  prompt: string;
41
47
  title?: string;
42
48
  model?: string;
43
49
  modelSelection?: AgentRunModelSelection;
50
+ engineSelection?: AgentRunEngineSelection;
44
51
  systemPrompt?: string;
45
52
  budget?: {
46
53
  maxTurns?: number;
@@ -396,6 +403,18 @@ export type ScheduleTiming =
396
403
  }
397
404
  | {
398
405
  kind: 'continuous';
406
+ }
407
+ | {
408
+ kind: 'daily';
409
+ time: string;
410
+ timeZone: string;
411
+ days?: number[];
412
+ }
413
+ | {
414
+ kind: 'monthly';
415
+ time: string;
416
+ timeZone: string;
417
+ dayOfMonth: number | 'last';
399
418
  };
400
419
  export type ScheduleFireStatus = 'started' | 'completed' | 'failed' | 'skipped-overlap' | 'missed';
401
420
  export interface ScheduleHistoryEntry {
@@ -423,28 +442,128 @@ export interface ScheduleSnapshot {
423
442
  status: ScheduleFireStatus;
424
443
  };
425
444
  history: ScheduleHistoryEntry[];
445
+ maxLatenessMs?: number;
426
446
  }
427
447
  export interface CreateScheduleRequest {
428
448
  name?: string;
429
449
  source: {
430
450
  kind: 'template-json';
431
451
  content: string;
452
+ } | {
453
+ kind: 'board-zip';
454
+ path: string;
432
455
  };
433
456
  timing: ScheduleTiming;
434
457
  input?: BoardRunInput;
435
458
  enabled?: boolean;
459
+ maxLatenessMs?: number;
436
460
  }
437
461
  export interface UpdateScheduleRequest {
438
462
  name?: string;
439
463
  timing?: ScheduleTiming;
440
464
  input?: BoardRunInput | null;
441
465
  enabled?: boolean;
466
+ maxLatenessMs?: number | null;
442
467
  }
443
468
  export interface MinionryPmSchedules {
444
469
  list(): Promise<ScheduleSnapshot[]>;
445
470
  create(req: CreateScheduleRequest): Promise<ScheduleSnapshot>;
446
471
  update(scheduleId: string, patch: UpdateScheduleRequest): Promise<ScheduleSnapshot>;
447
472
  delete(scheduleId: string): Promise<void>;
473
+ runNow(scheduleId: string): Promise<ScheduleSnapshot>;
474
+ }
475
+ export type ChainCondition = 'success' | 'failure' | 'settled';
476
+ export type ChainFireStatus = 'pending' | 'started' | 'skipped' | 'failed';
477
+ export type ChainSkipReason = 'condition_not_met' | 'grant_revoked' | 'cycle' | 'max_depth' | 'link_disabled';
478
+ export interface ChainFireEntry {
479
+ at: string;
480
+ completedAt?: string;
481
+ status: ChainFireStatus;
482
+ upstreamOutcome: 'success' | 'failure';
483
+ downstreamBoardId: string | null;
484
+ downstreamRunId?: string;
485
+ skipReason?: ChainSkipReason;
486
+ error?: string;
487
+ }
488
+ export interface ChainLinkSnapshot {
489
+ id: string;
490
+ from: string;
491
+ to: string;
492
+ on: ChainCondition;
493
+ passOutputs: boolean;
494
+ name?: string;
495
+ enabled: boolean;
496
+ state: 'armed' | 'fired' | 'disabled';
497
+ createdAt: string;
498
+ ownedByCaller: boolean;
499
+ history: ChainFireEntry[];
500
+ }
501
+ export interface CreateChainLinkRequest {
502
+ from: string;
503
+ to: string;
504
+ on: ChainCondition;
505
+ passOutputs?: boolean;
506
+ name?: string;
507
+ enabled?: boolean;
508
+ }
509
+ export interface UpdateChainLinkRequest {
510
+ enabled?: boolean;
511
+ name?: string | null;
512
+ }
513
+ export interface MinionryPmChains {
514
+ list(): Promise<ChainLinkSnapshot[]>;
515
+ create(req: CreateChainLinkRequest): Promise<ChainLinkSnapshot>;
516
+ update(linkId: string, patch: UpdateChainLinkRequest): Promise<ChainLinkSnapshot>;
517
+ delete(linkId: string): Promise<void>;
518
+ }
519
+ export type AgentScheduleTiming = Exclude<ScheduleTiming, {
520
+ kind: 'continuous';
521
+ }>;
522
+ export interface AgentScheduleHistoryEntry {
523
+ at: string;
524
+ status: ScheduleFireStatus;
525
+ tabId: string | null;
526
+ error?: string;
527
+ }
528
+ export interface AgentScheduleSnapshot {
529
+ id: string;
530
+ createdAt: string;
531
+ name?: string;
532
+ prompt: string;
533
+ promptFile?: string;
534
+ timing: AgentScheduleTiming;
535
+ enabled: boolean;
536
+ nextFireAt: string | null;
537
+ lastFire?: {
538
+ at: string;
539
+ tabId: string | null;
540
+ status: ScheduleFireStatus;
541
+ };
542
+ history: AgentScheduleHistoryEntry[];
543
+ maxLatenessMs?: number;
544
+ }
545
+ export interface CreateAgentScheduleRequest {
546
+ name?: string;
547
+ prompt?: string;
548
+ promptFile?: string;
549
+ timing: AgentScheduleTiming;
550
+ enabled?: boolean;
551
+ maxLatenessMs?: number;
552
+ }
553
+ export interface UpdateAgentScheduleRequest {
554
+ name?: string;
555
+ prompt?: string;
556
+ promptFile?: string;
557
+ timing?: AgentScheduleTiming;
558
+ enabled?: boolean;
559
+ maxLatenessMs?: number | null;
560
+ }
561
+ export interface MinionryAgentSchedules {
562
+ list(): Promise<AgentScheduleSnapshot[]>;
563
+ create(req: CreateAgentScheduleRequest): Promise<AgentScheduleSnapshot>;
564
+ update(scheduleId: string, patch: UpdateAgentScheduleRequest): Promise<AgentScheduleSnapshot>;
565
+ delete(scheduleId: string): Promise<void>;
566
+ runNow(scheduleId: string): Promise<AgentScheduleSnapshot>;
448
567
  }
449
568
  export interface FileEntry {
450
569
  name: string;
@@ -456,11 +575,18 @@ export interface FileEntry {
456
575
  export type FileReadResult = {
457
576
  kind: 'text';
458
577
  content: string;
578
+ modifiedAt?: string;
579
+ size?: number;
459
580
  } | {
460
581
  kind: 'binary';
461
582
  content: string;
462
583
  mimeType: string;
584
+ modifiedAt?: string;
585
+ size?: number;
463
586
  };
587
+ export interface FileWriteOptions {
588
+ expectedModifiedAt?: string;
589
+ }
464
590
  export interface FileSearchOptions {
465
591
  caseSensitive?: boolean;
466
592
  wholeWord?: boolean;
@@ -512,7 +638,9 @@ export interface FileDefinition {
512
638
  }
513
639
  export interface FileChangeEvent {
514
640
  path: string;
515
- kind: 'changed' | 'opened';
641
+ kind: 'changed' | 'opened' | 'created' | 'deleted' | 'renamed';
642
+ newPath?: string;
643
+ dir?: boolean;
516
644
  }
517
645
  export interface FileTransferProgress {
518
646
  chunkIndex: number;
@@ -864,6 +992,7 @@ export interface MinionryAuth {
864
992
  export interface MinionryAgents {
865
993
  run(req: AgentRunRequest): Promise<AgentRun>;
866
994
  readonly sessions: MinionryAgentSessions;
995
+ readonly schedules: MinionryAgentSchedules;
867
996
  }
868
997
  export interface MinionryPm {
869
998
  createBoard(req: CreateBoardRequest): Promise<CreateBoardResult>;
@@ -876,11 +1005,12 @@ export interface MinionryPm {
876
1005
  updateBoard(boardId: string, fields: UpdateBoardFields): Promise<BoardSummary>;
877
1006
  execute(boardId: string): Promise<BoardRun>;
878
1007
  readonly schedules: MinionryPmSchedules;
1008
+ readonly chains: MinionryPmChains;
879
1009
  }
880
1010
  export interface MinionryFiles {
881
1011
  read(path: string): Promise<string>;
882
1012
  readEntry(path: string): Promise<FileReadResult>;
883
- write(path: string, content: string): Promise<void>;
1013
+ write(path: string, content: string, opts?: FileWriteOptions): Promise<void>;
884
1014
  list(path: string): Promise<FileEntry[]>;
885
1015
  delete(path: string): Promise<void>;
886
1016
  mkdir(path: string): Promise<void>;
@@ -970,6 +1100,7 @@ export interface ComposerSettingsCatalog {
970
1100
  modelsStatus?: ComposerModelCatalogStatus;
971
1101
  effortLevels?: Record<string, string[]>;
972
1102
  inferenceEngines?: string[];
1103
+ agentRunEngines?: string[];
973
1104
  }
974
1105
  export interface MinionryComposer {
975
1106
  autocomplete(query: string): Promise<AutocompleteEntry[]>;
@@ -1855,6 +1986,7 @@ export interface InferenceChatRequest {
1855
1986
  engine?: string;
1856
1987
  model?: string;
1857
1988
  effortLevel?: string;
1989
+ fastMode?: boolean;
1858
1990
  }
1859
1991
  export type InferenceRunResultStatus = 'done' | 'error' | 'cancelled';
1860
1992
  export type InferenceRunStatus = 'running' | InferenceRunResultStatus;
@@ -1928,6 +2060,7 @@ export interface ProviderEventMap {
1928
2060
  fileChangeGap: {
1929
2061
  path: string;
1930
2062
  message: string;
2063
+ reason?: string;
1931
2064
  };
1932
2065
  themeChanged: ThemeSnapshot;
1933
2066
  localeChanged: LocaleSnapshot;
package/dist/types.js CHANGED
@@ -24,6 +24,8 @@ export const SCOPES = [
24
24
  'quality:run',
25
25
  'inference:run',
26
26
  'endpoints:register',
27
+ 'pm:chain',
28
+ 'agents:schedule',
27
29
  ];
28
30
  export const SCOPE_RISK_TIERS = {
29
31
  identity: 'low',
@@ -51,6 +53,8 @@ export const SCOPE_RISK_TIERS = {
51
53
  'quality:run': 'high',
52
54
  'inference:run': 'high',
53
55
  'endpoints:register': 'high',
56
+ 'pm:chain': 'critical',
57
+ 'agents:schedule': 'critical',
54
58
  };
55
59
  export const MINIONRY_ERROR_CODES = [
56
60
  'USER_REJECTED',
@@ -60,6 +64,7 @@ export const MINIONRY_ERROR_CODES = [
60
64
  'QUOTA_EXCEEDED',
61
65
  'UNSUPPORTED',
62
66
  'CANCELLED',
67
+ 'CONFLICT',
63
68
  ];
64
69
  export class MinionryError extends Error {
65
70
  code;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minionry/sdk",
3
- "version": "0.4.23",
3
+ "version": "0.5.2",
4
4
  "description": "Client library for apps that run inside Minionry.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,
@@ -23,5 +23,5 @@
23
23
  "files": [
24
24
  "dist"
25
25
  ],
26
- "gitHead": "893155a8c2ffaa5fb372e615a3b13ccf53171e0e"
26
+ "gitHead": "17a1b8b5b03c1cdc341df1abbbaceda201e8758f"
27
27
  }