@squidcloud/backend 1.0.482 → 1.0.483

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.
@@ -1,6 +1,6 @@
1
1
  import { AiFunctionId, ApiEndpointId, CollectionName, IntegrationId, IntegrationType, TopicName } from '@squidcloud/client';
2
2
  import { JSONSchema } from 'json-schema-typed';
3
- import { ActionMethodDecorator, AiFunctionAction, ClientConnectionStateChangeAction, EventHandlerAction, ExecutableAction, LimiterConfig, LimitsAction, LlmAskAction, McpAuthorizerAction, McpToolAction, QueueMessageAction, SchedulerAction, SecureAiAgentAction, SecureAiQueryAction, SecureApiAction, SecureDatabaseAction, SecureDistributedLockAction, SecureGraphQLAction, SecureMetricAction, SecureNativeQueryAction, SecureStorageAction, SecureTopicAction, TriggerAction, WebhookAction } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
3
+ import { ActionMethodDecorator, AiFunctionAction, ClientConnectionStateChangeAction, EventHandlerAction, ExecutableAction, LimiterConfig, LimitsAction, LlmAskAction, McpAuthorizerAction, McpToolAction, QueueMessageAction, SchedulerAction, SecureAiAgentAction, SecureAiQueryAction, SecureApiAction, SecureDatabaseAction, SecureDistributedLockAction, SecureGraphQLAction, SecureLangGraphAction, SecureMetricAction, SecureNativeQueryAction, SecureStorageAction, SecureTopicAction, TriggerAction, WebhookAction } from '../../internal-common/src/public-types-backend/bundle-api.public-types';
4
4
  import { AiFunctionAttributes, AiFunctionParam, DatabaseActionType, MetricActionType, StorageActionType, TopicActionType } from '../../internal-common/src/public-types-backend/bundle-data.public-types';
5
5
  import { AiFunctionsConfiguratorRequest, AiFunctionsConfiguratorResponse, CronExpression, CronExpressionString, LlmServiceOptions, McpServerOptions, MutationType, SchedulerId, TriggerId, WebhookId } from './public-types';
6
6
  /**
@@ -454,6 +454,19 @@ export declare function secureDistributedLock(mutex?: string): ActionMethodDecor
454
454
  @category Decorator
455
455
  */
456
456
  export declare function secureAiAgent(agentId?: string): ActionMethodDecorator<SecureAiAgentAction>;
457
+ /**
458
+ * A decorator that can be used to secure a LangGraph invocation.
459
+ *
460
+ * The function should return a boolean or a `Promise` of a boolean indicating
461
+ * whether the invocation is allowed. It takes a {@link SecureLangGraphContext}
462
+ * parameter containing the `operation` (`'invoke' | 'resume' | 'getState' | 'deleteThread'`),
463
+ * `graphId`, `threadId`, `input`, and `resumePayload` of the request.
464
+ *
465
+ * @param graphId The ID of the graph to secure - if not provided, this will apply to all graphs.
466
+ * @category AI
467
+ * @category Decorator
468
+ */
469
+ export declare function secureLangGraph(graphId?: string): ActionMethodDecorator<SecureLangGraphAction>;
457
470
  /**
458
471
  * A decorator that can be used to rate/quota limit a function. In its simplest form, the decorator
459
472
  * can take the query rate that is allowed for the given function and/or how many total calls are
@@ -5,6 +5,7 @@ export * from '../../internal-common/src/public-types-backend/bundle-api.public-
5
5
  export * from '../../internal-common/src/public-types-backend/bundle-data.public-types';
6
6
  export * from '../../internal-common/src/public-types-backend/distributed-lock.public-context';
7
7
  export * from '../../internal-common/src/public-types-backend/graphql.public-context';
8
+ export * from '../../internal-common/src/public-types-backend/langgraph.public-context';
8
9
  export * from '../../internal-common/src/public-types-backend/llm.public-types';
9
10
  export * from '../../internal-common/src/public-types-backend/mcp.public-types';
10
11
  export * from '../../internal-common/src/public-types-backend/metric.public-context';
@@ -5,6 +5,23 @@ export interface WorkspaceMetadata {
5
5
  /** Absolute path of the workspace directory on this pod's local disk. */
6
6
  path: string;
7
7
  }
8
+ /**
9
+ * Options for {@link WorkspaceClient.create}.
10
+ *
11
+ * Note the durability contract of the directory itself, which is separate from the GC TTL below: only
12
+ * {@link WorkspaceClient.push} makes local changes durable. The pod-local copy is evicted after 6 hours
13
+ * without a `create`, `push`, or agent run, so a long-running job that writes files and pushes them more
14
+ * than 6 hours later loses whatever it had not pushed — unlike an expired *tracked* workspace, whose
15
+ * final push revives it. Push periodically for work that spans hours.
16
+ */
17
+ export interface WorkspaceCreateOptions {
18
+ /**
19
+ * Idle TTL in seconds (bounds: see workspace.utils): the workspace is reclaimed by GC after this long
20
+ * without use; every use pushes the deadline forward. Persisted last-write-wins; when absent, the
21
+ * workspace keeps its stored TTL (or the default — one day — for a new one).
22
+ */
23
+ idleTtlSeconds?: number;
24
+ }
8
25
  /**
9
26
  * Returns whether the shared workspace server is configured on this pod. Callers that want to degrade
10
27
  * gracefully (treat a shared workspace as best-effort/ephemeral rather than fail) should check this
@@ -37,13 +54,14 @@ export declare class WorkspaceClient {
37
54
  * new workspace id when none is given. Safe to call repeatedly: pulls from the workspace server only
38
55
  * when there is something to pull, and is a no-op for a brand-new, never-pushed workspace.
39
56
  */
40
- create(id?: string): Promise<WorkspaceMetadata>;
57
+ create(id?: string, options?: WorkspaceCreateOptions): Promise<WorkspaceMetadata>;
41
58
  /** Syncs the current state of the workspace directory to the workspace server as the new authoritative state. */
42
59
  push(id: string): Promise<WorkspaceMetadata>;
43
60
  /**
44
- * Deletes the workspace directory on this pod and clears its contents on the workspace server. Only
45
- * the local copy on the pod this is called from is removed; copies left on other pod replicas by an
46
- * earlier `create` are reclaimed by their own pod lifecycle (restart/reschedule), not by this call.
61
+ * Deletes the workspace everywhere it canonically exists: its directory on the workspace server and its
62
+ * GC tracking record (both via core), plus every copy on this pod — the live directory, its marker, and
63
+ * any tree an interrupted eviction left in quarantine. Copies left on other pod replicas by an earlier
64
+ * `create` are reclaimed by their own pod's cache eviction, not by this call.
47
65
  */
48
66
  delete(id: string): Promise<void>;
49
67
  private buildMetadata;
@@ -55,8 +73,6 @@ export declare class WorkspaceClient {
55
73
  private pull;
56
74
  /** Pushes `dir` to the workspace server as the new authoritative state. */
57
75
  private pushDir;
58
- /** Mirrors an empty local directory onto the server to clear its content. */
59
- private rsyncEmptyTo;
60
76
  /**
61
77
  * Runs rsync against the workspace server for `workspaceId`, fetching a fresh, short-lived certificate
62
78
  * scoped to that workspace first and cleaning it up afterwards. The certificate (not the key) is what