@llmsafespaces/sdk 0.8.13 → 0.13.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.
package/dist/index.cjs CHANGED
@@ -97,6 +97,8 @@ var LLMSafeSpaces = class {
97
97
  probe;
98
98
  prompts;
99
99
  agentRoles;
100
+ workflows;
101
+ triggers;
100
102
  constructor(options) {
101
103
  this.baseUrl = options.baseUrl.replace(/\/$/, "");
102
104
  this.timeout = options.timeout ?? DEFAULT_TIMEOUT;
@@ -117,6 +119,8 @@ var LLMSafeSpaces = class {
117
119
  this.probe = new ProbeAPI(this);
118
120
  this.prompts = new PromptsAPI(this);
119
121
  this.agentRoles = new AgentRolesAPI(this);
122
+ this.workflows = new WorkflowsAPI(this);
123
+ this.triggers = new TriggersAPI(this);
120
124
  }
121
125
  /** Internal: make an authenticated request. */
122
126
  async request(method, path, body, timeout) {
@@ -577,6 +581,54 @@ var AgentRolesAPI = class {
577
581
  return this.client.request("GET", `/workspaces/${workspaceId}/effective-agent-role`);
578
582
  }
579
583
  };
584
+ var WorkflowsAPI = class {
585
+ constructor(client) {
586
+ this.client = client;
587
+ }
588
+ client;
589
+ list() {
590
+ return this.client.request("GET", "/me/workflows");
591
+ }
592
+ get(id) {
593
+ return this.client.request("GET", `/me/workflows/${id}`);
594
+ }
595
+ create(req) {
596
+ return this.client.request("POST", "/me/workflows", req);
597
+ }
598
+ update(id, req) {
599
+ return this.client.request("PUT", `/me/workflows/${id}`, req);
600
+ }
601
+ delete(id) {
602
+ return this.client.request("DELETE", `/me/workflows/${id}`);
603
+ }
604
+ run(id, input, workspaceId) {
605
+ return this.client.request("POST", `/me/workflows/${id}/runs`, { input, workspaceId });
606
+ }
607
+ getRun(runId) {
608
+ return this.client.request("GET", `/me/runs/${runId}`);
609
+ }
610
+ cancelRun(runId) {
611
+ return this.client.request("POST", `/me/runs/${runId}/cancel`);
612
+ }
613
+ };
614
+ var TriggersAPI = class {
615
+ constructor(client) {
616
+ this.client = client;
617
+ }
618
+ client;
619
+ list() {
620
+ return this.client.request("GET", "/me/triggers");
621
+ }
622
+ create(req) {
623
+ return this.client.request("POST", "/me/triggers", req);
624
+ }
625
+ update(id, req) {
626
+ return this.client.request("PUT", `/me/triggers/${id}`, req);
627
+ }
628
+ delete(id) {
629
+ return this.client.request("DELETE", `/me/triggers/${id}`);
630
+ }
631
+ };
580
632
 
581
633
  // src/types.ts
582
634
  var SECRET_NAME_PATTERN = /^[a-z0-9._-]+$/;
package/dist/index.d.cts CHANGED
@@ -213,6 +213,8 @@ declare class LLMSafeSpaces {
213
213
  readonly probe: ProbeAPI;
214
214
  readonly prompts: PromptsAPI;
215
215
  readonly agentRoles: AgentRolesAPI;
216
+ readonly workflows: WorkflowsAPI;
217
+ readonly triggers: TriggersAPI;
216
218
  constructor(options: ClientOptions);
217
219
  /** Internal: make an authenticated request. */
218
220
  request<T>(method: string, path: string, body?: unknown, timeout?: number): Promise<T>;
@@ -421,6 +423,98 @@ declare class AgentRolesAPI {
421
423
  clearWorkspaceRole(workspaceId: string): Promise<void>;
422
424
  getEffectiveWorkspaceRole(workspaceId: string): Promise<unknown>;
423
425
  }
426
+ interface WorkflowResponse {
427
+ id: string;
428
+ ownerType: string;
429
+ name: string;
430
+ slug: string;
431
+ description: string;
432
+ specYaml: string;
433
+ status: string;
434
+ createdAt: string;
435
+ updatedAt: string;
436
+ }
437
+ interface WorkflowRunResponse {
438
+ id: string;
439
+ workflowId: string;
440
+ status: string;
441
+ errorCode?: string;
442
+ input?: unknown;
443
+ output?: unknown;
444
+ startedAt?: string;
445
+ finishedAt?: string;
446
+ createdAt: string;
447
+ }
448
+ interface TriggerResponse {
449
+ id: string;
450
+ name: string;
451
+ enabled: boolean;
452
+ sourceType: string;
453
+ sourceConfig: unknown;
454
+ workspaceId?: string;
455
+ workflowId?: string;
456
+ prompt?: string;
457
+ agent?: string;
458
+ scriptPath?: string;
459
+ scriptArgs?: string[];
460
+ scriptEnv?: unknown;
461
+ memoryMode?: string;
462
+ captureMode?: string;
463
+ preserveSession?: string;
464
+ consecutiveFailures: number;
465
+ autoDisableAfter: number;
466
+ lastFiredAt?: string;
467
+ nextFireAt?: string;
468
+ }
469
+ declare class WorkflowsAPI {
470
+ private readonly client;
471
+ constructor(client: LLMSafeSpaces);
472
+ list(): Promise<{
473
+ workflows: WorkflowResponse[];
474
+ }>;
475
+ get(id: string): Promise<WorkflowResponse>;
476
+ create(req: {
477
+ name: string;
478
+ specYaml: string;
479
+ status?: string;
480
+ }): Promise<WorkflowResponse>;
481
+ update(id: string, req: {
482
+ name?: string;
483
+ status?: string;
484
+ specYaml?: string;
485
+ }): Promise<WorkflowResponse>;
486
+ delete(id: string): Promise<void>;
487
+ run(id: string, input?: unknown, workspaceId?: string): Promise<WorkflowRunResponse>;
488
+ getRun(runId: string): Promise<WorkflowRunResponse>;
489
+ cancelRun(runId: string): Promise<void>;
490
+ }
491
+ declare class TriggersAPI {
492
+ private readonly client;
493
+ constructor(client: LLMSafeSpaces);
494
+ list(): Promise<{
495
+ triggers: TriggerResponse[];
496
+ }>;
497
+ create(req: {
498
+ name: string;
499
+ sourceType: string;
500
+ sourceConfig: unknown;
501
+ workspaceId?: string;
502
+ workflowId?: string;
503
+ prompt?: string;
504
+ agent?: string;
505
+ scriptPath?: string;
506
+ scriptArgs?: string[];
507
+ scriptEnv?: unknown;
508
+ memoryMode?: string;
509
+ captureMode?: string;
510
+ preserveSession?: string;
511
+ }): Promise<TriggerResponse>;
512
+ update(id: string, req: {
513
+ enabled?: boolean;
514
+ autoDisableAfter?: number;
515
+ }): Promise<TriggerResponse>;
516
+ delete(id: string): Promise<void>;
517
+ }
424
518
 
425
519
  /** Base error for all LLMSafeSpaces API errors. */
426
520
  declare class LLMSafeSpacesError extends Error {
package/dist/index.d.ts CHANGED
@@ -213,6 +213,8 @@ declare class LLMSafeSpaces {
213
213
  readonly probe: ProbeAPI;
214
214
  readonly prompts: PromptsAPI;
215
215
  readonly agentRoles: AgentRolesAPI;
216
+ readonly workflows: WorkflowsAPI;
217
+ readonly triggers: TriggersAPI;
216
218
  constructor(options: ClientOptions);
217
219
  /** Internal: make an authenticated request. */
218
220
  request<T>(method: string, path: string, body?: unknown, timeout?: number): Promise<T>;
@@ -421,6 +423,98 @@ declare class AgentRolesAPI {
421
423
  clearWorkspaceRole(workspaceId: string): Promise<void>;
422
424
  getEffectiveWorkspaceRole(workspaceId: string): Promise<unknown>;
423
425
  }
426
+ interface WorkflowResponse {
427
+ id: string;
428
+ ownerType: string;
429
+ name: string;
430
+ slug: string;
431
+ description: string;
432
+ specYaml: string;
433
+ status: string;
434
+ createdAt: string;
435
+ updatedAt: string;
436
+ }
437
+ interface WorkflowRunResponse {
438
+ id: string;
439
+ workflowId: string;
440
+ status: string;
441
+ errorCode?: string;
442
+ input?: unknown;
443
+ output?: unknown;
444
+ startedAt?: string;
445
+ finishedAt?: string;
446
+ createdAt: string;
447
+ }
448
+ interface TriggerResponse {
449
+ id: string;
450
+ name: string;
451
+ enabled: boolean;
452
+ sourceType: string;
453
+ sourceConfig: unknown;
454
+ workspaceId?: string;
455
+ workflowId?: string;
456
+ prompt?: string;
457
+ agent?: string;
458
+ scriptPath?: string;
459
+ scriptArgs?: string[];
460
+ scriptEnv?: unknown;
461
+ memoryMode?: string;
462
+ captureMode?: string;
463
+ preserveSession?: string;
464
+ consecutiveFailures: number;
465
+ autoDisableAfter: number;
466
+ lastFiredAt?: string;
467
+ nextFireAt?: string;
468
+ }
469
+ declare class WorkflowsAPI {
470
+ private readonly client;
471
+ constructor(client: LLMSafeSpaces);
472
+ list(): Promise<{
473
+ workflows: WorkflowResponse[];
474
+ }>;
475
+ get(id: string): Promise<WorkflowResponse>;
476
+ create(req: {
477
+ name: string;
478
+ specYaml: string;
479
+ status?: string;
480
+ }): Promise<WorkflowResponse>;
481
+ update(id: string, req: {
482
+ name?: string;
483
+ status?: string;
484
+ specYaml?: string;
485
+ }): Promise<WorkflowResponse>;
486
+ delete(id: string): Promise<void>;
487
+ run(id: string, input?: unknown, workspaceId?: string): Promise<WorkflowRunResponse>;
488
+ getRun(runId: string): Promise<WorkflowRunResponse>;
489
+ cancelRun(runId: string): Promise<void>;
490
+ }
491
+ declare class TriggersAPI {
492
+ private readonly client;
493
+ constructor(client: LLMSafeSpaces);
494
+ list(): Promise<{
495
+ triggers: TriggerResponse[];
496
+ }>;
497
+ create(req: {
498
+ name: string;
499
+ sourceType: string;
500
+ sourceConfig: unknown;
501
+ workspaceId?: string;
502
+ workflowId?: string;
503
+ prompt?: string;
504
+ agent?: string;
505
+ scriptPath?: string;
506
+ scriptArgs?: string[];
507
+ scriptEnv?: unknown;
508
+ memoryMode?: string;
509
+ captureMode?: string;
510
+ preserveSession?: string;
511
+ }): Promise<TriggerResponse>;
512
+ update(id: string, req: {
513
+ enabled?: boolean;
514
+ autoDisableAfter?: number;
515
+ }): Promise<TriggerResponse>;
516
+ delete(id: string): Promise<void>;
517
+ }
424
518
 
425
519
  /** Base error for all LLMSafeSpaces API errors. */
426
520
  declare class LLMSafeSpacesError extends Error {
package/dist/index.js CHANGED
@@ -64,6 +64,8 @@ var LLMSafeSpaces = class {
64
64
  probe;
65
65
  prompts;
66
66
  agentRoles;
67
+ workflows;
68
+ triggers;
67
69
  constructor(options) {
68
70
  this.baseUrl = options.baseUrl.replace(/\/$/, "");
69
71
  this.timeout = options.timeout ?? DEFAULT_TIMEOUT;
@@ -84,6 +86,8 @@ var LLMSafeSpaces = class {
84
86
  this.probe = new ProbeAPI(this);
85
87
  this.prompts = new PromptsAPI(this);
86
88
  this.agentRoles = new AgentRolesAPI(this);
89
+ this.workflows = new WorkflowsAPI(this);
90
+ this.triggers = new TriggersAPI(this);
87
91
  }
88
92
  /** Internal: make an authenticated request. */
89
93
  async request(method, path, body, timeout) {
@@ -544,6 +548,54 @@ var AgentRolesAPI = class {
544
548
  return this.client.request("GET", `/workspaces/${workspaceId}/effective-agent-role`);
545
549
  }
546
550
  };
551
+ var WorkflowsAPI = class {
552
+ constructor(client) {
553
+ this.client = client;
554
+ }
555
+ client;
556
+ list() {
557
+ return this.client.request("GET", "/me/workflows");
558
+ }
559
+ get(id) {
560
+ return this.client.request("GET", `/me/workflows/${id}`);
561
+ }
562
+ create(req) {
563
+ return this.client.request("POST", "/me/workflows", req);
564
+ }
565
+ update(id, req) {
566
+ return this.client.request("PUT", `/me/workflows/${id}`, req);
567
+ }
568
+ delete(id) {
569
+ return this.client.request("DELETE", `/me/workflows/${id}`);
570
+ }
571
+ run(id, input, workspaceId) {
572
+ return this.client.request("POST", `/me/workflows/${id}/runs`, { input, workspaceId });
573
+ }
574
+ getRun(runId) {
575
+ return this.client.request("GET", `/me/runs/${runId}`);
576
+ }
577
+ cancelRun(runId) {
578
+ return this.client.request("POST", `/me/runs/${runId}/cancel`);
579
+ }
580
+ };
581
+ var TriggersAPI = class {
582
+ constructor(client) {
583
+ this.client = client;
584
+ }
585
+ client;
586
+ list() {
587
+ return this.client.request("GET", "/me/triggers");
588
+ }
589
+ create(req) {
590
+ return this.client.request("POST", "/me/triggers", req);
591
+ }
592
+ update(id, req) {
593
+ return this.client.request("PUT", `/me/triggers/${id}`, req);
594
+ }
595
+ delete(id) {
596
+ return this.client.request("DELETE", `/me/triggers/${id}`);
597
+ }
598
+ };
547
599
 
548
600
  // src/types.ts
549
601
  var SECRET_NAME_PATTERN = /^[a-z0-9._-]+$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmsafespaces/sdk",
3
- "version": "0.8.13",
3
+ "version": "0.13.0",
4
4
  "description": "TypeScript SDK for LLMSafeSpaces API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",