deepline 0.3.89 → 0.3.90
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/contracts/install-commands.json +29 -0
- package/dist/bundling-sources/sdk/src/client.ts +120 -37
- package/dist/bundling-sources/sdk/src/index.ts +4 -0
- package/dist/bundling-sources/sdk/src/pagination.ts +25 -0
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +16 -9
- package/dist/bundling-sources/sdk/src/types.ts +23 -0
- package/dist/bundling-sources/shared_libs/monitors/analytics-public.ts +10 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +3 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-queue.ts +4 -4
- package/dist/bundling-sources/shared_libs/monitors/inventory-reconciliation.ts +59 -0
- package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +7 -9
- package/dist/bundling-sources/shared_libs/monitors/package.json +7 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +44 -2
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-consumer-health.ts +2 -2
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +2 -2
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-public-aliases.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +245 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-message.ts +38 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-ack-probe.ts +94 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue-delivery.ts +60 -0
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-queue.ts +60 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-install-validation.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +2 -2
- package/dist/bundling-sources/shared_libs/monitors/snitcher-radar.ts +1 -1
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/build-context.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +160 -0
- package/dist/bundling-sources/shared_libs/observability/request-context.ts +68 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +654 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +35 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/neon-constants.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +272 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +66 -1
- package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/bounceban-batching.ts +137 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +779 -140
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +46 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-payload-contract.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +103 -0
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +725 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +23 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +442 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/contracts.ts +66 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/job.ts +145 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/ports.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/integration-operation-reader-fence/postgres-store.ts +170 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1322 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/launch-source-policy.ts +112 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-execution-frame.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/perf-trace.ts +127 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/contracts.ts +56 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/index.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/job.ts +41 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/ports.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/admission/postgres-adapter.ts +54 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/contracts.ts +114 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/engine-suspension.ts +108 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/index.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/job.ts +97 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/ports.ts +104 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/postgres-fence-adapter.ts +263 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/attempts/worker-terminal-projection.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/contracts.ts +29 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/gateway-adapter.ts +56 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/index.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/job.ts +65 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/projection/ports.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/index.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +142 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +102 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/contracts.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/index.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/job.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/ports.ts +54 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/terminal/postgres-adapter.ts +71 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +5 -8
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +3 -5
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +168 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +72 -9
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +6 -12
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/bundle.ts +0 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +14 -44
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +57 -205
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +201 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-env.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-release-environment.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +14 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-telemetry.ts +108 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-deadline-reconciliation.ts +88 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-deploy-task.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-play-run-task.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +193 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-lifecycle.ts +269 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-queue-suffix.ts +73 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +6642 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +897 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-metrics.ts +120 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +76 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +476 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-heavy-request-admission.ts +47 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +147 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/index.ts +27 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/lazy.ts +50 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +98 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-budget-state.ts +260 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-pool.ts +1416 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1255 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +942 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +14636 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +888 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +355 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-terminal-transition.ts +46 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runner-push.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +33 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-gateway-health.ts +64 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +835 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +1218 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +207 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-scheduler-schema.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-capacity.ts +123 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/scheduler-launch-read-observability.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/submit-admission.ts +169 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/terminal-contract.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-queue-metrics.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/worker-resource-metrics.ts +249 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/step-progress.ts +296 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/native-batch.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +60 -15
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-protection.ts +14 -1
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +165 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +15 -23
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +169 -0
- package/dist/bundling-sources/shared_libs/play-runtime/zerobounce-batching.ts +122 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +2 -0
- package/dist/bundling-sources/shared_libs/plays/deployment-status.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/docflow.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/play-grep-search.ts +39 -0
- package/dist/bundling-sources/shared_libs/plays/share/copy.ts +271 -0
- package/dist/bundling-sources/shared_libs/plays/share/metrics.ts +140 -0
- package/dist/bundling-sources/shared_libs/plays/share/public-read-model.ts +86 -0
- package/dist/bundling-sources/shared_libs/plays/share/seo-quality.ts +181 -0
- package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +658 -0
- package/dist/bundling-sources/shared_libs/plays/share/types.ts +197 -0
- package/dist/bundling-sources/shared_libs/plays/slack-hitl-timeout-error.ts +37 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -1
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +7 -1
- package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +3 -2
- package/dist/bundling-sources/shared_libs/product-notifications/overflow.ts +18 -0
- package/dist/bundling-sources/shared_libs/product-notifications/rolling-limit.ts +24 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +624 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-payload.ts +140 -0
- package/dist/bundling-sources/shared_libs/product-notifications/slack-transport.ts +75 -0
- package/dist/bundling-sources/shared_libs/runtime-env.ts +6 -0
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +42 -0
- package/dist/bundling-sources/shared_libs/security/header-safe-env.ts +10 -3
- package/dist/bundling-sources/shared_libs/security/slack-sanitize.ts +133 -0
- package/dist/cli/getting-started.d.mts +52 -0
- package/dist/cli/getting-started.d.ts +52 -0
- package/dist/cli/getting-started.js +65 -0
- package/dist/cli/getting-started.mjs +36 -0
- package/dist/cli/index.d.mts +9 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.js +545 -264
- package/dist/cli/index.mjs +543 -271
- package/dist/{compiler-manifest-DsLbQaew.d.mts → compiler-manifest-BaJfE-5H.d.mts} +5 -3
- package/dist/{compiler-manifest-DsLbQaew.d.ts → compiler-manifest-BaJfE-5H.d.ts} +5 -3
- package/dist/index.d.mts +81 -148
- package/dist/index.d.ts +81 -148
- package/dist/index.js +83 -26
- package/dist/index.mjs +83 -26
- package/dist/install-integrity.json +130 -2
- package/dist/monitor-fleet-contract.d.mts +138 -0
- package/dist/monitor-fleet-contract.d.ts +138 -0
- package/dist/monitor-fleet-contract.js +404 -0
- package/dist/monitor-fleet-contract.mjs +367 -0
- package/dist/plays/bundle-play-file.d.mts +2 -2
- package/dist/plays/bundle-play-file.d.ts +2 -2
- package/dist/release.d.mts +255 -0
- package/dist/release.d.ts +255 -0
- package/dist/release.js +215 -0
- package/dist/release.mjs +188 -0
- package/package.json +21 -4
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type { PublishedPlayPagePackage } from './types';
|
|
2
|
+
|
|
3
|
+
// SEO quality is deterministic authoring policy, not a web-app adapter.
|
|
4
|
+
|
|
5
|
+
export type PlayPageSeoQualitySignal =
|
|
6
|
+
| 'unique_title'
|
|
7
|
+
| 'unique_description'
|
|
8
|
+
| 'required_body_sections'
|
|
9
|
+
| 'concrete_inputs'
|
|
10
|
+
| 'concrete_outputs'
|
|
11
|
+
| 'workflow_structure'
|
|
12
|
+
| 'provider_or_tool_count'
|
|
13
|
+
| 'related_links'
|
|
14
|
+
| 'json_ld_ready'
|
|
15
|
+
| 'canonical'
|
|
16
|
+
| 'h1'
|
|
17
|
+
| 'no_placeholder_copy';
|
|
18
|
+
|
|
19
|
+
export type PlayPageSeoQualityResult = {
|
|
20
|
+
score: number;
|
|
21
|
+
maxScore: number;
|
|
22
|
+
passed: boolean;
|
|
23
|
+
passedSignals: PlayPageSeoQualitySignal[];
|
|
24
|
+
failedSignals: PlayPageSeoQualitySignal[];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const PLAY_PAGE_REQUIRED_BODY_SECTIONS = [
|
|
28
|
+
'What this workflow does',
|
|
29
|
+
'Inputs you need',
|
|
30
|
+
'Outputs you get',
|
|
31
|
+
'How it works',
|
|
32
|
+
'Cost/latency when available',
|
|
33
|
+
'Common edits',
|
|
34
|
+
'Related workflows',
|
|
35
|
+
'Run or fork with Deepline CLI',
|
|
36
|
+
] as const;
|
|
37
|
+
|
|
38
|
+
const MIN_SCORE_TO_INDEX = 10;
|
|
39
|
+
const PLACEHOLDER_PATTERNS = [
|
|
40
|
+
/\blorem ipsum\b/i,
|
|
41
|
+
/\btbd\b/i,
|
|
42
|
+
/\bcoming soon\b/i,
|
|
43
|
+
/\bplaceholder\b/i,
|
|
44
|
+
/\bTODO\b/,
|
|
45
|
+
/\bexample workflow\b/i,
|
|
46
|
+
/\bgeneric workflow\b/i,
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
function cleanWords(value: string): Set<string> {
|
|
50
|
+
return new Set(
|
|
51
|
+
value
|
|
52
|
+
.toLowerCase()
|
|
53
|
+
.replace(/[^a-z0-9\s]/g, ' ')
|
|
54
|
+
.split(/\s+/)
|
|
55
|
+
.filter((word) => word.length >= 4),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function overlapRatio(a: string, b: string): number {
|
|
60
|
+
const left = cleanWords(a);
|
|
61
|
+
const right = cleanWords(b);
|
|
62
|
+
if (left.size === 0 || right.size === 0) return 1;
|
|
63
|
+
let overlap = 0;
|
|
64
|
+
for (const word of left) {
|
|
65
|
+
if (right.has(word)) overlap += 1;
|
|
66
|
+
}
|
|
67
|
+
return overlap / Math.min(left.size, right.size);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function hasConcreteFields(fields: string[] | undefined): boolean {
|
|
71
|
+
const concrete = (fields ?? [])
|
|
72
|
+
.map((field) => field.trim())
|
|
73
|
+
.filter(Boolean)
|
|
74
|
+
.filter(
|
|
75
|
+
(field) =>
|
|
76
|
+
!/^(run parameters|input rows?|output table|results?)$/i.test(field),
|
|
77
|
+
);
|
|
78
|
+
return concrete.length > 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function hasNoPlaceholderCopy(pkg: PublishedPlayPagePackage): boolean {
|
|
82
|
+
const searchable = [
|
|
83
|
+
pkg.copy.title,
|
|
84
|
+
pkg.copy.shortDescription,
|
|
85
|
+
pkg.copy.jtbd,
|
|
86
|
+
pkg.copy.llmSummary,
|
|
87
|
+
pkg.copy.seoTitle,
|
|
88
|
+
pkg.copy.seoDescription,
|
|
89
|
+
...pkg.copy.whenToUse,
|
|
90
|
+
...pkg.copy.inputs,
|
|
91
|
+
...pkg.copy.outputs,
|
|
92
|
+
].join('\n');
|
|
93
|
+
return !PLACEHOLDER_PATTERNS.some((pattern) => pattern.test(searchable));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function evaluatePlayPageSeoQuality(input: {
|
|
97
|
+
pkg: PublishedPlayPagePackage;
|
|
98
|
+
relatedLinkCount: number;
|
|
99
|
+
}): PlayPageSeoQualityResult {
|
|
100
|
+
const { pkg, relatedLinkCount } = input;
|
|
101
|
+
const checks: Array<[PlayPageSeoQualitySignal, boolean]> = [
|
|
102
|
+
[
|
|
103
|
+
'unique_title',
|
|
104
|
+
pkg.copy.seoTitle.trim().length >= 18 &&
|
|
105
|
+
pkg.copy.title.trim().length > 0 &&
|
|
106
|
+
overlapRatio(pkg.copy.seoTitle, pkg.copy.seoDescription) < 0.82,
|
|
107
|
+
],
|
|
108
|
+
[
|
|
109
|
+
'unique_description',
|
|
110
|
+
pkg.copy.seoDescription.trim().length >= 80 &&
|
|
111
|
+
pkg.copy.seoDescription.trim().length <= 170 &&
|
|
112
|
+
overlapRatio(pkg.copy.seoDescription, pkg.copy.shortDescription) < 0.95,
|
|
113
|
+
],
|
|
114
|
+
['required_body_sections', PLAY_PAGE_REQUIRED_BODY_SECTIONS.length === 8],
|
|
115
|
+
[
|
|
116
|
+
'concrete_inputs',
|
|
117
|
+
hasConcreteFields(pkg.copy.inputs) ||
|
|
118
|
+
hasConcreteFields(pkg.revision.inputSchema?.fields),
|
|
119
|
+
],
|
|
120
|
+
[
|
|
121
|
+
'concrete_outputs',
|
|
122
|
+
hasConcreteFields(pkg.copy.outputs) ||
|
|
123
|
+
hasConcreteFields(pkg.revision.outputSchema?.fields),
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
'workflow_structure',
|
|
127
|
+
pkg.revision.staticPipelineSummary.stepCount > 0 &&
|
|
128
|
+
pkg.revision.staticPipelineSummary.previewNodes.length > 0,
|
|
129
|
+
],
|
|
130
|
+
[
|
|
131
|
+
'provider_or_tool_count',
|
|
132
|
+
pkg.revision.staticPipelineSummary.providerCount > 0 ||
|
|
133
|
+
pkg.revision.staticPipelineSummary.stepCount >= 2,
|
|
134
|
+
],
|
|
135
|
+
['related_links', relatedLinkCount >= 1],
|
|
136
|
+
[
|
|
137
|
+
'json_ld_ready',
|
|
138
|
+
pkg.copy.llmSummary.trim().length > 0 &&
|
|
139
|
+
pkg.copy.agentPrompt.trim().length > 0,
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
'canonical',
|
|
143
|
+
/^\/p\/[^/]+\/[^/]+\/v\/\d+$/.test(pkg.page.canonicalPath) &&
|
|
144
|
+
pkg.page.canonicalPath.includes(
|
|
145
|
+
encodeURIComponent(pkg.definition.name),
|
|
146
|
+
),
|
|
147
|
+
],
|
|
148
|
+
['h1', pkg.copy.title.trim().length > 0],
|
|
149
|
+
['no_placeholder_copy', hasNoPlaceholderCopy(pkg)],
|
|
150
|
+
];
|
|
151
|
+
|
|
152
|
+
const passedSignals = checks
|
|
153
|
+
.filter(([, passed]) => passed)
|
|
154
|
+
.map(([signal]) => signal);
|
|
155
|
+
const failedSignals = checks
|
|
156
|
+
.filter(([, passed]) => !passed)
|
|
157
|
+
.map(([signal]) => signal);
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
score: passedSignals.length,
|
|
161
|
+
maxScore: checks.length,
|
|
162
|
+
passed:
|
|
163
|
+
passedSignals.length >= MIN_SCORE_TO_INDEX && failedSignals.length === 0,
|
|
164
|
+
passedSignals,
|
|
165
|
+
failedSignals,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function applyPlayPageSeoQuality(input: {
|
|
170
|
+
pkg: PublishedPlayPagePackage;
|
|
171
|
+
relatedLinkCount: number;
|
|
172
|
+
}): PublishedPlayPagePackage {
|
|
173
|
+
const result = evaluatePlayPageSeoQuality(input);
|
|
174
|
+
return {
|
|
175
|
+
...input.pkg,
|
|
176
|
+
page: {
|
|
177
|
+
...input.pkg.page,
|
|
178
|
+
seoIndexing: result.passed ? input.pkg.page.seoIndexing : 'noindex',
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
}
|