@opengeni/config 4.6.1 → 4.6.2-canary.39853438886001

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.
@@ -5,6 +5,8 @@ var DEFAULT_MODEL_COST_POLICY_JSON = JSON.stringify({
5
5
  });
6
6
  var DEFAULT_GOAL_IDLE_BACKOFF_MS = [3e3, 3e4, 12e4, 3e5];
7
7
  var DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS = 6e5;
8
+ var DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS = 9e4;
9
+ var DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS = 105e3;
8
10
  var AGENT_INSTRUCTIONS_CORE_PLACEHOLDER = "{{core}}";
9
11
  var DEFAULT_AGENT_INSTRUCTIONS = [
10
12
  "You are an Opengeni workspace agent: a general assistant for questions, writing, research, analysis, and technical work.",
@@ -26,7 +28,9 @@ export {
26
28
  DEFAULT_MODEL_COST_POLICY_JSON,
27
29
  DEFAULT_GOAL_IDLE_BACKOFF_MS,
28
30
  DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS,
31
+ DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS,
32
+ DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS,
29
33
  AGENT_INSTRUCTIONS_CORE_PLACEHOLDER,
30
34
  DEFAULT_AGENT_INSTRUCTIONS
31
35
  };
32
- //# sourceMappingURL=chunk-KW4MS4FH.js.map
36
+ //# sourceMappingURL=chunk-C3GVPDPY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["// Immutable configuration defaults, independent of settings validation and provider adapters.\nexport const DEFAULT_OPENROUTER_MODEL_ID =\n \"openrouter/nvidia/nemotron-3-super-120b-a12b:free\" as const;\n\nexport const DEFAULT_MODEL_COST_POLICY_JSON = JSON.stringify({\n [DEFAULT_OPENROUTER_MODEL_ID]: \"free\",\n});\n\n/** Default pacing between consecutive no-input goal continuations. */\nexport const DEFAULT_GOAL_IDLE_BACKOFF_MS: readonly number[] = [3_000, 30_000, 120_000, 300_000];\n\nexport const DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS = 600_000;\n\n/**\n * Turn-worker graceful shutdown. A draining turn worker lets in-flight turns\n * finish naturally for the grace, then cancels the rest with WORKER_SHUTDOWN\n * (recoverable checkpoint), and the Temporal SDK force-stops at the force time.\n * With the standalone process exit ten seconds after the force time, these fit\n * inside the 120-second Kubernetes termination grace used by the Helm chart.\n */\nexport const DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS = 90_000;\nexport const DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS = 105_000;\n\n/**\n * Placeholder token inside an agent-instructions persona template. The runtime\n * substitutes the non-bypassable CORE (goal-loop ownership + the dynamic\n * workspace-environment block) at this marker. A template that omits the\n * marker still gets the CORE appended after it (a non-bypassable fail-safe),\n * so a white-labelled persona can never drop the goal-loop contract or the\n * environment metadata the agent depends on.\n */\nexport const AGENT_INSTRUCTIONS_CORE_PLACEHOLDER = \"{{core}}\";\n\n/**\n * Default per-workspace agent persona template. This is the BRAND + tool-usage\n * opinion (the white-labellable surface): the general-assistant identity line,\n * the framing/opinion lines, and the mount-path facts. Domain-specific tooling\n * guidance (for example Terraform or Checkov) belongs in opt-in Skills.\n *\n * The CORE that MUST survive any override — the goal-loop ownership line (which\n * names the opengeni__goal_* tools) and the dynamic workspace-environment block\n * — is injected at AGENT_INSTRUCTIONS_CORE_PLACEHOLDER by the runtime, never\n * baked into this overridable string.\n *\n * INVARIANT: with no per-workspace override and an empty environment, the\n * runtime's composed instructions are byte-for-byte pinned by a runtime test.\n * The template below is joined by \" \", followed by \" \" + the placeholder.\n * Changing a single character here changes that default; update the pin\n * intentionally.\n */\nexport const DEFAULT_AGENT_INSTRUCTIONS = [\n \"You are an Opengeni workspace agent: a general assistant for questions, writing, research, analysis, and technical work.\",\n \"Follow the user's task and the applicable Skill instructions for the current role.\",\n \"When a task needs files or commands, work inside the sandbox workspace with the filesystem and shell tools.\",\n \"Repository resources are mounted under repos/<host>/<owner>/<repo> unless the session specifies another collision-free mount path.\",\n \"File resources are mounted under .opengeni/files/<file-id>/ unless the session specifies another mount path.\",\n \"Attached files are mounted read-only; copy them before modifying.\",\n \"Installed and selected Skills appear in the session Skill index; follow its reading instructions and any role-specific guidance.\",\n \"Provider CLIs such as gh, glab, and az may be pre-authenticated by the host through brokered git credentials or a sandbox preparation profile; try them before asking for credentials.\",\n \"When the Git repository you change has a remote and git provider credentials are available, work on a focused branch and open a pull request.\",\n \"Otherwise leave changes in the working tree and do not create or mention branches, commits, or pull requests unless the user asks; if the repository has a remote, say the changes are not pushed, and if the user asks for something you cannot make, say what blocks it.\",\n \"Answer questions directly and briefly; after making changes, say what changed, how you checked it, and anything still blocked.\",\n AGENT_INSTRUCTIONS_CORE_PLACEHOLDER,\n].join(\" \");\n"],"mappings":";AACO,IAAM,8BACX;AAEK,IAAM,iCAAiC,KAAK,UAAU;AAAA,EAC3D,CAAC,2BAA2B,GAAG;AACjC,CAAC;AAGM,IAAM,+BAAkD,CAAC,KAAO,KAAQ,MAAS,GAAO;AAExF,IAAM,mCAAmC;AASzC,IAAM,wCAAwC;AAC9C,IAAM,wCAAwC;AAU9C,IAAM,sCAAsC;AAmB5C,IAAM,6BAA6B;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;","names":[]}
@@ -3,6 +3,15 @@ export declare const DEFAULT_MODEL_COST_POLICY_JSON: string;
3
3
  /** Default pacing between consecutive no-input goal continuations. */
4
4
  export declare const DEFAULT_GOAL_IDLE_BACKOFF_MS: readonly number[];
5
5
  export declare const DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS = 600000;
6
+ /**
7
+ * Turn-worker graceful shutdown. A draining turn worker lets in-flight turns
8
+ * finish naturally for the grace, then cancels the rest with WORKER_SHUTDOWN
9
+ * (recoverable checkpoint), and the Temporal SDK force-stops at the force time.
10
+ * With the standalone process exit ten seconds after the force time, these fit
11
+ * inside the 120-second Kubernetes termination grace used by the Helm chart.
12
+ */
13
+ export declare const DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS = 90000;
14
+ export declare const DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS = 105000;
6
15
  /**
7
16
  * Placeholder token inside an agent-instructions persona template. The runtime
8
17
  * substitutes the non-bypassable CORE (goal-loop ownership + the dynamic
package/dist/defaults.js CHANGED
@@ -4,14 +4,18 @@ import {
4
4
  DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS,
5
5
  DEFAULT_GOAL_IDLE_BACKOFF_MS,
6
6
  DEFAULT_MODEL_COST_POLICY_JSON,
7
- DEFAULT_OPENROUTER_MODEL_ID
8
- } from "./chunk-KW4MS4FH.js";
7
+ DEFAULT_OPENROUTER_MODEL_ID,
8
+ DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS,
9
+ DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS
10
+ } from "./chunk-C3GVPDPY.js";
9
11
  export {
10
12
  AGENT_INSTRUCTIONS_CORE_PLACEHOLDER,
11
13
  DEFAULT_AGENT_INSTRUCTIONS,
12
14
  DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS,
13
15
  DEFAULT_GOAL_IDLE_BACKOFF_MS,
14
16
  DEFAULT_MODEL_COST_POLICY_JSON,
15
- DEFAULT_OPENROUTER_MODEL_ID
17
+ DEFAULT_OPENROUTER_MODEL_ID,
18
+ DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS,
19
+ DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS
16
20
  };
17
21
  //# sourceMappingURL=defaults.js.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { DEFAULT_OPENROUTER_MODEL_ID, DEFAULT_MODEL_COST_POLICY_JSON, DEFAULT_GOAL_IDLE_BACKOFF_MS, DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS, AGENT_INSTRUCTIONS_CORE_PLACEHOLDER, DEFAULT_AGENT_INSTRUCTIONS, } from "./defaults.js";
1
+ export { DEFAULT_OPENROUTER_MODEL_ID, DEFAULT_MODEL_COST_POLICY_JSON, DEFAULT_GOAL_IDLE_BACKOFF_MS, DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS, AGENT_INSTRUCTIONS_CORE_PLACEHOLDER, DEFAULT_AGENT_INSTRUCTIONS, DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS, DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS, } from "./defaults.js";
2
2
  export { managedUserEmailAllowed } from "./managed-user-admission.js";
3
3
  export * from "./realtime-voice-pricing.js";
4
4
  export * from "./web-search.js";
@@ -112,6 +112,8 @@ declare const SettingsSchema: z.ZodObject<{
112
112
  turnWorkerEmergencyMemoryUsage: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
113
113
  turnWorkerMemoryGuardIntervalMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
114
114
  turnWorkerMemoryGuardSustainMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
115
+ turnWorkerShutdownGraceMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
116
+ turnWorkerShutdownForceMs: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
115
117
  observabilityStructuredLogs: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
116
118
  observabilityMetricsEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
117
119
  observabilityOtlpEndpoint: z.ZodOptional<z.ZodString>;
@@ -626,6 +628,8 @@ declare const SettingsSchema: z.ZodObject<{
626
628
  onePasswordFakeTokens: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
627
629
  protonPassCliPath: z.ZodOptional<z.ZodString>;
628
630
  integrationsEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
631
+ googleConnectorSetupEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
632
+ googleDriveMcpEnabled: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
629
633
  integrationsStateSecret: z.ZodOptional<z.ZodString>;
630
634
  integrationsAllowPrivateNetworkTargets: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
631
635
  privacyOnlyMeAllowed: z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>;
package/dist/index.js CHANGED
@@ -4,8 +4,10 @@ import {
4
4
  DEFAULT_GOAL_IDLE_BACKOFF_MAX_MS,
5
5
  DEFAULT_GOAL_IDLE_BACKOFF_MS,
6
6
  DEFAULT_MODEL_COST_POLICY_JSON,
7
- DEFAULT_OPENROUTER_MODEL_ID
8
- } from "./chunk-KW4MS4FH.js";
7
+ DEFAULT_OPENROUTER_MODEL_ID,
8
+ DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS,
9
+ DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS
10
+ } from "./chunk-C3GVPDPY.js";
9
11
 
10
12
  // src/managed-user-admission.ts
11
13
  function managedUserEmailAllowed(allowedUserEmails, email) {
@@ -1094,6 +1096,15 @@ var SettingsSchema = z5.object({
1094
1096
  turnWorkerEmergencyMemoryUsage: z5.coerce.number().min(0.85).max(0.95).default(0.9),
1095
1097
  turnWorkerMemoryGuardIntervalMs: z5.coerce.number().int().min(1e3).max(6e4).default(5e3),
1096
1098
  turnWorkerMemoryGuardSustainMs: z5.coerce.number().int().min(5e3).max(3e5).default(3e4),
1099
+ // Graceful turn-worker shutdown (rolling deploy, scale-down, memory guard).
1100
+ // After the worker stops polling, in-flight turns may finish naturally for
1101
+ // the grace; the rest are cancelled with WORKER_SHUTDOWN (recoverable
1102
+ // checkpoint) and the SDK force-stops at the force time. Keep the force time
1103
+ // inside the pod's termination grace; the standalone process exits at most
1104
+ // ten seconds after it. The worker keeps at least a ten-second checkpoint
1105
+ // window between grace and force, shortening the grace when needed.
1106
+ turnWorkerShutdownGraceMs: z5.coerce.number().int().min(0).max(36e5).default(DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS),
1107
+ turnWorkerShutdownForceMs: z5.coerce.number().int().min(1e4).max(36e5).default(DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS),
1097
1108
  observabilityStructuredLogs: EnvBoolean.default(false),
1098
1109
  observabilityMetricsEnabled: EnvBoolean.default(true),
1099
1110
  observabilityOtlpEndpoint: z5.string().url().optional(),
@@ -1233,6 +1244,9 @@ var SettingsSchema = z5.object({
1233
1244
  "Proton Pass CLI path must be absolute"
1234
1245
  ).optional(),
1235
1246
  integrationsEnabled: EnvBoolean.default(false),
1247
+ // Operator gate for unverified Gmail/Drive OAuth acquisition; sign-in and refresh are independent.
1248
+ googleConnectorSetupEnabled: EnvBoolean.default(true),
1249
+ googleDriveMcpEnabled: EnvBoolean.default(false),
1236
1250
  integrationsStateSecret: z5.string().optional(),
1237
1251
  integrationsAllowPrivateNetworkTargets: EnvBoolean.default(false),
1238
1252
  // Privacy limits a deployment (for example a product that embeds Opengeni)
@@ -4524,6 +4538,8 @@ function getSettings(source = process.env) {
4524
4538
  turnWorkerEmergencyMemoryUsage: optional("OPENGENI_TURN_WORKER_EMERGENCY_MEMORY_USAGE"),
4525
4539
  turnWorkerMemoryGuardIntervalMs: optional("OPENGENI_TURN_WORKER_MEMORY_GUARD_INTERVAL_MS"),
4526
4540
  turnWorkerMemoryGuardSustainMs: optional("OPENGENI_TURN_WORKER_MEMORY_GUARD_SUSTAIN_MS"),
4541
+ turnWorkerShutdownGraceMs: optional("OPENGENI_TURN_WORKER_SHUTDOWN_GRACE_MS"),
4542
+ turnWorkerShutdownForceMs: optional("OPENGENI_TURN_WORKER_SHUTDOWN_FORCE_MS"),
4527
4543
  observabilityStructuredLogs: optional("OPENGENI_OBSERVABILITY_STRUCTURED_LOGS"),
4528
4544
  observabilityMetricsEnabled: optional("OPENGENI_OBSERVABILITY_METRICS_ENABLED"),
4529
4545
  observabilityOtlpEndpoint: optional("OPENGENI_OTEL_EXPORTER_OTLP_ENDPOINT") ?? optional("OTEL_EXPORTER_OTLP_ENDPOINT"),
@@ -4582,6 +4598,8 @@ function getSettings(source = process.env) {
4582
4598
  onePasswordFakeTokens: optional("OPENGENI_ONEPASSWORD_FAKE_TOKENS"),
4583
4599
  protonPassCliPath: optional("OPENGENI_PROTON_PASS_CLI_PATH"),
4584
4600
  integrationsEnabled: optional("OPENGENI_INTEGRATIONS_ENABLED"),
4601
+ googleConnectorSetupEnabled: optional("OPENGENI_GOOGLE_CONNECTOR_SETUP_ENABLED"),
4602
+ googleDriveMcpEnabled: optional("OPENGENI_GOOGLE_DRIVE_MCP_ENABLED"),
4585
4603
  integrationsStateSecret: optional("OPENGENI_INTEGRATIONS_STATE_SECRET"),
4586
4604
  integrationsAllowPrivateNetworkTargets: optional(
4587
4605
  "OPENGENI_INTEGRATIONS_ALLOW_PRIVATE_NETWORK_TARGETS"
@@ -9344,6 +9362,8 @@ export {
9344
9362
  DEFAULT_MODEL_STREAM_IDLE_TIMEOUT_MS,
9345
9363
  DEFAULT_MODEL_STREAM_PROGRESS_TIMEOUT_MS,
9346
9364
  DEFAULT_OPENROUTER_MODEL_ID,
9365
+ DEFAULT_TURN_WORKER_SHUTDOWN_FORCE_MS,
9366
+ DEFAULT_TURN_WORKER_SHUTDOWN_GRACE_MS,
9347
9367
  DEFAULT_WEB_SEARCH_PROVIDER,
9348
9368
  ELEVENLABS_REALTIME_LANGUAGES,
9349
9369
  ELEVENLABS_REALTIME_MODELS,