deepline 0.3.88 → 0.3.89

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.
Files changed (121) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +534 -4
  2. package/dist/bundling-sources/sdk/src/config.ts +77 -0
  3. package/dist/bundling-sources/sdk/src/http.ts +76 -30
  4. package/dist/bundling-sources/sdk/src/index.ts +6 -0
  5. package/dist/bundling-sources/sdk/src/monitor-fleet-contract.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/play.ts +15 -1
  7. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +2 -2
  8. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  9. package/dist/bundling-sources/sdk/src/types.ts +83 -4
  10. package/dist/bundling-sources/shared_libs/integration-contracts/AGENTS.md +9 -0
  11. package/dist/bundling-sources/shared_libs/integration-contracts/README.md +3 -0
  12. package/dist/bundling-sources/shared_libs/integration-contracts/index.ts +2 -0
  13. package/dist/bundling-sources/shared_libs/monitors/analytics-install-guides.ts +77 -0
  14. package/dist/bundling-sources/shared_libs/monitors/billing/charges.ts +125 -0
  15. package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +686 -0
  16. package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +54 -0
  17. package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +72 -0
  18. package/dist/bundling-sources/shared_libs/monitors/billing/session.ts +45 -0
  19. package/dist/bundling-sources/shared_libs/monitors/billing/state.ts +454 -0
  20. package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +260 -0
  21. package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +215 -0
  22. package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +333 -0
  23. package/dist/bundling-sources/shared_libs/monitors/cursor-page.ts +42 -0
  24. package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
  25. package/dist/bundling-sources/shared_libs/monitors/framework-managed-payload-fields.ts +71 -0
  26. package/dist/bundling-sources/shared_libs/monitors/generated/provider-monitor-callback-admission-targets.ts +16 -0
  27. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +267 -0
  28. package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +39 -0
  29. package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +82 -0
  30. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +473 -0
  31. package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +1 -1
  32. package/dist/bundling-sources/shared_libs/monitors/package.json +29 -0
  33. package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +1125 -0
  34. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +263 -0
  35. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +964 -0
  36. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +56 -0
  37. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +131 -0
  38. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +535 -0
  39. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-legacy-aliases.ts +16 -0
  40. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-priority-execution.ts +56 -0
  41. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +28 -0
  42. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-runtime-read-eligibility.ts +38 -0
  43. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
  44. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-status.ts +10 -0
  45. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +112 -0
  46. package/dist/bundling-sources/shared_libs/monitors/provider-webhook-monitor-runtime.ts +300 -0
  47. package/dist/bundling-sources/shared_libs/monitors/quickstart-prompts.ts +22 -0
  48. package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +93 -0
  49. package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +332 -0
  50. package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +221 -0
  51. package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +105 -0
  52. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +73 -0
  53. package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +81 -0
  54. package/dist/bundling-sources/shared_libs/monitors/tsconfig.json +10 -0
  55. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +6 -11
  56. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +90 -12
  57. package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +78 -0
  58. package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
  59. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +407 -53
  60. package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
  61. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +57 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +20 -1
  63. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +6 -0
  64. package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +7 -1
  65. package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +189 -0
  66. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +28 -0
  67. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
  68. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +23 -0
  69. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
  70. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +18 -4
  71. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +68 -0
  72. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +2 -0
  73. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +1 -0
  74. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +10 -8
  75. package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
  76. package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
  77. package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +6 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +24 -0
  79. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +30 -1
  80. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +1 -1
  81. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +1 -1
  82. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +6 -3
  83. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +454 -17
  84. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
  85. package/dist/bundling-sources/shared_libs/plays/contracts.ts +6 -14
  86. package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
  87. package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
  88. package/dist/bundling-sources/shared_libs/plays/email-status.ts +1 -1
  89. package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
  90. package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
  91. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +44 -14
  92. package/dist/bundling-sources/shared_libs/plays/tool-category-descriptions.ts +2 -2
  93. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
  94. package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
  95. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +560 -0
  96. package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
  97. package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +59 -0
  98. package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
  99. package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
  100. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
  101. package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
  102. package/dist/bundling-sources/shared_libs/product-notifications/workspace.ts +38 -0
  103. package/dist/bundling-sources/shared_libs/runtime-env.ts +6 -0
  104. package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +28 -0
  105. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
  106. package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +267 -0
  107. package/dist/cli/index.js +1070 -193
  108. package/dist/cli/index.mjs +1057 -180
  109. package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-DsLbQaew.d.mts} +132 -8
  110. package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-DsLbQaew.d.ts} +132 -8
  111. package/dist/index.d.mts +834 -12
  112. package/dist/index.d.ts +834 -12
  113. package/dist/index.js +469 -40
  114. package/dist/index.mjs +469 -40
  115. package/dist/install-integrity.json +65 -4
  116. package/dist/plays/bundle-play-file.d.mts +8 -3
  117. package/dist/plays/bundle-play-file.d.ts +8 -3
  118. package/dist/plays/bundle-play-file.mjs +100 -20
  119. package/package.json +3 -1
  120. /package/dist/bundling-sources/shared_libs/{integrations/bettercontact-execution-policy.ts → integration-contracts/bettercontact/execution-policy.ts} +0 -0
  121. /package/dist/bundling-sources/shared_libs/{integrations/theirstack-execution-policy.ts → integration-contracts/theirstack/execution-policy.ts} +0 -0
@@ -0,0 +1,267 @@
1
+ const REDACTED_VALUE = '[REDACTED]';
2
+
3
+ type SecretRedactionOptions = {
4
+ redactHighEntropy?: boolean;
5
+ };
6
+
7
+ const SENSITIVE_KEY_PATTERNS = [
8
+ /^api[-_]?key$/i,
9
+ /^x[-_]?api[-_]?key$/i,
10
+ /secret/i,
11
+ /token/i,
12
+ /password/i,
13
+ /authorization/i,
14
+ /cookie/i,
15
+ /credential/i,
16
+ /private/i,
17
+ ];
18
+
19
+ const SAFE_IDENTIFIER_KEYS = new Set([
20
+ 'artifactHash',
21
+ 'artifactHashes',
22
+ 'artifact_hash',
23
+ 'artifact_hashes',
24
+ 'graphHash',
25
+ 'graph_hash',
26
+ 'hash',
27
+ 'idempotencyKey',
28
+ 'idempotency_key',
29
+ 'key',
30
+ 'session',
31
+ 'sessionId',
32
+ 'session_id',
33
+ 'sessionIds',
34
+ 'session_ids',
35
+ 'promptId',
36
+ 'prompt_id',
37
+ 'requestId',
38
+ 'request_id',
39
+ 'upload_id',
40
+ // Durable-call runtime identity fields. These are non-secret
41
+ // `ctx:<org>:call:tool:<tool>:<hash>` receipt/idempotency keys (and their
42
+ // `:force:<lease>` / `:ordered:<hash>` variants) surfaced on tool-result
43
+ // `_metadata.execution` and echoed provider idempotency metadata.
44
+ // Explicit-secret patterns below still redact real secrets that ever appear
45
+ // under these keys.
46
+ 'receiptKey',
47
+ 'receipt_key',
48
+ 'attachedToReceiptKey',
49
+ 'attached_to_receipt_key',
50
+ 'durableCallReceiptKey',
51
+ 'durable_call_receipt_key',
52
+ 'providerIdempotencyKey',
53
+ 'provider_idempotency_key',
54
+ 'cacheKey',
55
+ 'cache_key',
56
+ // Non-secret run-output identifiers.
57
+ 'targetTable',
58
+ 'target_table',
59
+ 'tableNamespace',
60
+ 'table_namespace',
61
+ 'queryId',
62
+ 'query_id',
63
+ 'queryIds',
64
+ 'query_ids',
65
+ 'snowflakeQueryId',
66
+ 'snowflake_query_id',
67
+ 'snowflakeQueryIds',
68
+ 'snowflake_query_ids',
69
+ ]);
70
+
71
+ const EXPLICIT_SECRET_VALUE_PATTERNS = [
72
+ /\bnapi_[a-z0-9]{20,}\b/i,
73
+ /\bgh[opsu]_[A-Za-z0-9_]{20,}\b/,
74
+ /\bwhsec_[a-z0-9]+\b/i,
75
+ /\bsk-proj-[A-Za-z0-9_-]{20,}\b/,
76
+ /\bxox[baprs]-[A-Za-z0-9-]{20,}\b/i,
77
+ /\b(sk|rk)_(live|test)_[a-z0-9]+\b/i,
78
+ /\bpostgres(?:ql)?:\/\/[^\s'"]+/i,
79
+ /\bhttps?:\/\/[^/\s'"]+:[^@\s'"]+@[^/\s'"]+/i,
80
+ ];
81
+
82
+ const HIGH_ENTROPY_VALUE_PATTERN = /\b[A-Za-z0-9+/=_-]{32,}\b/g;
83
+ // A public hostname can legitimately contain a generated label longer than the
84
+ // high-entropy threshold (for example, a per-run probe hostname). Preserve the
85
+ // complete hostname after known secret formats have already been checked.
86
+ const PUBLIC_DNS_NAME_PATTERN =
87
+ /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}\.?$/i;
88
+ const SENSITIVE_URL_PARAM_KEY_PATTERN =
89
+ /(?:api[-_]?key|x[-_]?api[-_]?key|token|access[-_]?token|refresh[-_]?token|secret|password|authorization|credential|signature|sig)/i;
90
+ const BEARER_SECRET_PATTERN = /\b(Bearer)\s+[A-Za-z0-9._~+/=-]{8,}/gi;
91
+ const ASSIGNMENT_SECRET_PATTERN =
92
+ /\b(access[-_]?token|refresh[-_]?token|token|x[-_\s]?api[-_\s]?key|api[-_\s]?key|apikey|password|secret|session)\b(\s*[:=]\s*)[^\s'",;)}\]]+/gi;
93
+ const AUTH_ASSIGNMENT_SECRET_PATTERN =
94
+ /\b(auth(?:orization)?)\b(\s*[:=]\s*)(?!Bearer\b)(?:[A-Za-z]+\s+)?[^\s'",;)}\]]+/gi;
95
+ const SENSITIVE_URL_PARAM_VALUE_PATTERN =
96
+ /([?&#](?:api[-_]?key|x[-_]?api[-_]?key|token|access[-_]?token|refresh[-_]?token|secret|password|authorization|credential|signature|sig)=)[^&#\s'"]+/gi;
97
+
98
+ function inspectStandalonePublicHttpUrl(
99
+ value: string,
100
+ ): 'safe' | 'sensitive' | null {
101
+ const trimmed = value.trim();
102
+ if (!trimmed || /\s/.test(trimmed)) {
103
+ return null;
104
+ }
105
+
106
+ let url: URL;
107
+ try {
108
+ url = new URL(trimmed);
109
+ } catch {
110
+ return null;
111
+ }
112
+
113
+ if (url.protocol !== 'http:' && url.protocol !== 'https:') {
114
+ return null;
115
+ }
116
+ if (url.username || url.password) {
117
+ return 'sensitive';
118
+ }
119
+
120
+ for (const key of url.searchParams.keys()) {
121
+ if (SENSITIVE_URL_PARAM_KEY_PATTERN.test(key)) {
122
+ return 'sensitive';
123
+ }
124
+ }
125
+ if (url.hash && SENSITIVE_URL_PARAM_KEY_PATTERN.test(url.hash)) {
126
+ return 'sensitive';
127
+ }
128
+ return 'safe';
129
+ }
130
+
131
+ function shouldRedactKey(key: string) {
132
+ if (SAFE_IDENTIFIER_KEYS.has(key)) {
133
+ return false;
134
+ }
135
+ return SENSITIVE_KEY_PATTERNS.some((pattern) => pattern.test(key));
136
+ }
137
+
138
+ function maybeRedactString(value: string, options: SecretRedactionOptions) {
139
+ if (EXPLICIT_SECRET_VALUE_PATTERNS.some((pattern) => pattern.test(value))) {
140
+ return REDACTED_VALUE;
141
+ }
142
+ const publicHttpUrl = inspectStandalonePublicHttpUrl(value);
143
+ if (publicHttpUrl === 'sensitive') {
144
+ return REDACTED_VALUE;
145
+ }
146
+ if (publicHttpUrl === 'safe') {
147
+ return value;
148
+ }
149
+ if (PUBLIC_DNS_NAME_PATTERN.test(value.trim())) {
150
+ return value;
151
+ }
152
+ const redacted = value
153
+ .replace(BEARER_SECRET_PATTERN, `$1 ${REDACTED_VALUE}`)
154
+ .replace(AUTH_ASSIGNMENT_SECRET_PATTERN, `$1$2${REDACTED_VALUE}`)
155
+ .replace(ASSIGNMENT_SECRET_PATTERN, `$1$2${REDACTED_VALUE}`)
156
+ .replace(SENSITIVE_URL_PARAM_VALUE_PATTERN, `$1${REDACTED_VALUE}`);
157
+ return options.redactHighEntropy === false
158
+ ? redacted
159
+ : redacted.replace(HIGH_ENTROPY_VALUE_PATTERN, REDACTED_VALUE);
160
+ }
161
+
162
+ export function redactSecretsInValue<T>(
163
+ value: T,
164
+ parentKey?: string,
165
+ options: SecretRedactionOptions = {},
166
+ ): T {
167
+ if (typeof value === 'string') {
168
+ if (EXPLICIT_SECRET_VALUE_PATTERNS.some((pattern) => pattern.test(value))) {
169
+ return REDACTED_VALUE as T;
170
+ }
171
+ if (parentKey && SAFE_IDENTIFIER_KEYS.has(parentKey)) {
172
+ return value as T;
173
+ }
174
+ if (parentKey && shouldRedactKey(parentKey)) {
175
+ return REDACTED_VALUE as T;
176
+ }
177
+ return maybeRedactString(value, options) as T;
178
+ }
179
+
180
+ if (!value || typeof value !== 'object') return value;
181
+
182
+ type Container = unknown[] | Record<string, unknown>;
183
+ const root: Container = Array.isArray(value) ? [] : {};
184
+ const pending: Array<{
185
+ source: Container;
186
+ target: Container;
187
+ parentKey?: string;
188
+ }> = [{ source: value as Container, target: root, parentKey }];
189
+
190
+ const redactNestedValue = (
191
+ item: unknown,
192
+ itemParentKey: string | undefined,
193
+ ): unknown => {
194
+ if (typeof item !== 'string') return item;
195
+ if (EXPLICIT_SECRET_VALUE_PATTERNS.some((pattern) => pattern.test(item))) {
196
+ return REDACTED_VALUE;
197
+ }
198
+ if (itemParentKey && SAFE_IDENTIFIER_KEYS.has(itemParentKey)) return item;
199
+ if (itemParentKey && shouldRedactKey(itemParentKey)) return REDACTED_VALUE;
200
+ return maybeRedactString(item, options);
201
+ };
202
+
203
+ while (pending.length > 0) {
204
+ const current = pending.pop();
205
+ if (!current) break;
206
+ const sourceIsArray = Array.isArray(current.source);
207
+ for (const [key, item] of Object.entries(current.source)) {
208
+ const itemParentKey = sourceIsArray ? current.parentKey : key;
209
+ if (!sourceIsArray && shouldRedactKey(key)) {
210
+ (current.target as Record<string, unknown>)[key] = REDACTED_VALUE;
211
+ continue;
212
+ }
213
+ if (item && typeof item === 'object') {
214
+ const nestedTarget: Container = Array.isArray(item) ? [] : {};
215
+ (current.target as Record<string, unknown>)[key] = nestedTarget;
216
+ pending.push({
217
+ source: item as Container,
218
+ target: nestedTarget,
219
+ parentKey: itemParentKey,
220
+ });
221
+ continue;
222
+ }
223
+ (current.target as Record<string, unknown>)[key] = redactNestedValue(
224
+ item,
225
+ itemParentKey,
226
+ );
227
+ }
228
+ }
229
+
230
+ return root as T;
231
+ }
232
+
233
+ /**
234
+ * Redaction for customer-authored inputs and outputs. Preserve arbitrary
235
+ * identifiers while still removing explicit credential formats, sensitive
236
+ * keys, authorization values, and credential-bearing URLs.
237
+ */
238
+ export function redactSecretsInCustomerValue<T>(
239
+ value: T,
240
+ parentKey?: string,
241
+ ): T {
242
+ return redactSecretsInValue(value, parentKey, { redactHighEntropy: false });
243
+ }
244
+
245
+ export function redactSecretsInJsonText(
246
+ text: string,
247
+ options: SecretRedactionOptions = {},
248
+ ) {
249
+ try {
250
+ const parsed = JSON.parse(text) as unknown;
251
+ return JSON.stringify(
252
+ redactSecretsInValue(parsed, undefined, options),
253
+ null,
254
+ 2,
255
+ );
256
+ } catch {
257
+ let redacted = text;
258
+ for (const pattern of EXPLICIT_SECRET_VALUE_PATTERNS) {
259
+ redacted = redacted.replace(pattern, REDACTED_VALUE);
260
+ }
261
+ return maybeRedactString(redacted, options);
262
+ }
263
+ }
264
+
265
+ export function redactSecretsInCustomerJsonText(text: string) {
266
+ return redactSecretsInJsonText(text, { redactHighEntropy: false });
267
+ }