@inneranimalmedia/agentsam-sdk 2.6.10 → 2.6.11
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/README.md +3 -0
- package/TRADEMARKS.md +22 -0
- package/apps/README.md +3 -0
- package/apps/cad-creator/LICENSE +21 -0
- package/apps/cad-creator/README.md +4 -1
- package/apps/cad-creator/shared/cad/package.json +1 -1
- package/apps/client-cms-editor/LICENSE +21 -0
- package/apps/client-cms-editor/README.md +3 -0
- package/apps/client-cms-editor/backend/package.json +2 -2
- package/apps/client-cms-editor/frontend/package.json +3 -3
- package/apps/client-cms-editor/package-lock.json +43 -43
- package/apps/client-cms-editor/package.json +3 -3
- package/apps/client-cms-editor/reference/harvest/HARVEST_RECEIPT.json +1 -1
- package/apps/client-cms-editor/reference/harvest/README.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/ARCHIVE-INTAKE.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/HARVEST-INDEX.md +1 -1
- package/apps/client-cms-editor/reference/harvest/plans/TOOLING-LAB.md +1 -1
- package/apps/client-cms-editor/shared/cms/package.json +1 -1
- package/docs/MINI.md +4 -2
- package/docs/REPO_FILE_MAP.txt +0 -1
- package/docs/SOURCE_ARCHITECTURE.md +1 -1
- package/docs/architecture/DUAL_ANALYTICS_PRODUCT.md +140 -0
- package/docs/content-studio/REVISION_GATE_2026-09-27.md +1 -1
- package/docs/engineering/go-portability/01-product-project-deployment-authority.md +69 -0
- package/docs/engineering/provider-internal-renames/01-lane-initialization.md +20 -0
- package/docs/engineering/provider-internal-renames/01a-runtime-environment-contract.md +115 -0
- package/docs/engineering/provider-internal-renames/02-cfoa.md +57 -0
- package/docs/engineering/provider-internal-renames/03-gclioa.md +32 -0
- package/docs/engineering/provider-internal-renames/04-goaude.md +50 -0
- package/docs/engineering/provider-internal-renames/05-gdrv.md +33 -0
- package/docs/engineering/provider-internal-renames/06-verification.md +103 -0
- package/docs/engineering/provider-internal-renames/README.md +77 -0
- package/docs/engineering/provider-internal-renames/runtime-environment-contract.json +220 -0
- package/docs/engineering/test-diagnostics/go-cli-test-hang-20261003.md +49 -0
- package/docs/engineering/test-diagnostics/go-skip-deploy-docker-fix.md +90 -0
- package/docs/knowledge-service-verification.md +3 -3
- package/docs/plans/AGENTSAM-SUSPEND-QUEUE-KNOWLEDGE-RDP-2026-10-03.md +870 -0
- package/docs/plans/LOCAL-STUDIO-GRADUATION-2026-09-26.md +9 -9
- package/docs/plans/MACHINE-FIRST-APPS-TUI-2026-09-24.md +11 -11
- package/docs/plans/RECONCILIATION-2026-09-19.md +6 -6
- package/docs/plans/SAM_WORK_PROTOCOL.md +667 -0
- package/docs/plans/TOMORROW-EXTENSIVE-TODO-2026-09-26.md +2 -2
- package/docs/plans/UNIVERSAL-INGEST-MACHINE-FIRST-2026-09-24.md +3 -3
- package/examples/hyperspace-demo/src/main.tsx +227 -110
- package/migrations/d1/0020_agentsam_receipt_catalog.sql +35 -0
- package/migrations/runtime/0006_agent_run_suspend_activity.sql +53 -0
- package/migrations/runtime/0007_queue_control.sql +40 -0
- package/migrations/runtime/0008_agent_run_dependencies.sql +24 -0
- package/migrations/runtime/0008_analytics_legacy_bootstrap.sql +43 -0
- package/migrations/runtime/0009_analytics_authority.sql +108 -0
- package/package.json +26 -11
- package/packages/agentsam-brand/README.md +3 -0
- package/packages/agentsam-brand/package.json +2 -2
- package/packages/agentsam-contracts/dist/adapter.d.ts +22 -0
- package/packages/agentsam-contracts/dist/adapter.js +0 -0
- package/packages/agentsam-contracts/dist/agent.d.ts +66 -0
- package/packages/agentsam-contracts/dist/agent.js +15 -0
- package/packages/agentsam-contracts/dist/artifacts.d.ts +70 -0
- package/packages/agentsam-contracts/dist/artifacts.js +0 -0
- package/packages/agentsam-contracts/dist/authority.d.ts +21 -0
- package/packages/agentsam-contracts/dist/authority.js +0 -0
- package/packages/agentsam-contracts/dist/context.d.ts +14 -0
- package/packages/agentsam-contracts/dist/context.js +0 -0
- package/packages/agentsam-contracts/dist/errors.d.ts +121 -0
- package/packages/agentsam-contracts/dist/errors.js +5 -0
- package/packages/agentsam-contracts/dist/events.d.ts +53 -0
- package/packages/agentsam-contracts/dist/events.js +0 -0
- package/packages/agentsam-contracts/dist/execution.d.ts +38 -0
- package/packages/agentsam-contracts/dist/execution.js +0 -0
- package/packages/agentsam-contracts/dist/hooks.d.ts +31 -0
- package/packages/agentsam-contracts/dist/hooks.js +0 -0
- package/packages/agentsam-contracts/dist/identity.d.ts +15 -0
- package/packages/agentsam-contracts/dist/identity.js +0 -0
- package/packages/agentsam-contracts/dist/index.d.ts +16 -0
- package/packages/agentsam-contracts/dist/index.js +164 -0
- package/packages/agentsam-contracts/dist/models.d.ts +9 -0
- package/packages/agentsam-contracts/dist/models.js +0 -0
- package/packages/agentsam-contracts/dist/providers.d.ts +27 -0
- package/packages/agentsam-contracts/dist/providers.js +0 -0
- package/packages/agentsam-contracts/dist/repository.d.ts +56 -0
- package/packages/agentsam-contracts/dist/repository.js +15 -0
- package/packages/agentsam-contracts/dist/run.d.ts +113 -0
- package/packages/agentsam-contracts/dist/run.js +132 -0
- package/packages/agentsam-contracts/dist/tools.d.ts +82 -0
- package/packages/agentsam-contracts/dist/tools.js +0 -0
- package/packages/agentsam-contracts/dist/widgets.d.ts +38 -0
- package/packages/agentsam-contracts/dist/widgets.js +0 -0
- package/packages/agentsam-contracts/package.json +9 -1
- package/packages/agentsam-contracts/scripts/build.mjs +1 -1
- package/packages/agentsam-contracts/src/agent.ts +78 -3
- package/packages/agentsam-contracts/src/index.ts +2 -0
- package/packages/agentsam-contracts/src/run.ts +320 -0
- package/packages/agentsam-contracts/src/widgets.ts +58 -0
- package/packages/agentsam-contracts/test/contracts.test.mjs +1 -1
- package/packages/agentsam-contracts/test/run-contract.test.mjs +94 -0
- package/packages/agentsam-errors/package.json +1 -1
- package/packages/agentsam-goap/README.md +3 -0
- package/packages/agentsam-goap/package.json +2 -2
- package/packages/agentsam-hooks/package.json +2 -2
- package/packages/agentsam-hooks/src/adapters/agents.js +48 -22
- package/packages/agentsam-hooks/src/index.d.ts +16 -0
- package/packages/agentsam-knowledge/package.json +1 -1
- package/packages/agentsam-knowledge/src/backends/index.js +1 -1
- package/packages/agentsam-merch/README.md +62 -0
- package/packages/agentsam-merch/bin/agentsam-merch.mjs +16 -0
- package/packages/agentsam-merch/package.json +65 -0
- package/packages/agentsam-merch/profiles/completeful/dtg-back-large.json +42 -0
- package/packages/agentsam-merch/profiles/completeful/laser-engraving.json +39 -0
- package/packages/agentsam-merch/profiles/generic/embroidery-digitization.json +22 -0
- package/packages/agentsam-merch/schemas/collection-candidate.schema.json +66 -0
- package/packages/agentsam-merch/schemas/manufacturing-profile.schema.json +221 -0
- package/packages/agentsam-merch/src/adapters-completeful.js +50 -0
- package/packages/agentsam-merch/src/cli.js +93 -0
- package/packages/agentsam-merch/src/collection-lab.js +60 -0
- package/packages/agentsam-merch/src/compatibility.js +501 -0
- package/packages/agentsam-merch/src/derivatives.js +112 -0
- package/packages/agentsam-merch/src/index.d.ts +316 -0
- package/packages/agentsam-merch/src/index.js +46 -0
- package/packages/agentsam-merch/src/node/index.d.ts +58 -0
- package/packages/agentsam-merch/src/node/index.js +6 -0
- package/packages/agentsam-merch/src/node/raster.js +142 -0
- package/packages/agentsam-merch/src/node/vector.js +239 -0
- package/packages/agentsam-merch/src/product-concepts.js +118 -0
- package/packages/agentsam-merch/src/profile-registry.js +104 -0
- package/packages/agentsam-merch/src/profile.js +158 -0
- package/packages/agentsam-merch/src/transforms.js +215 -0
- package/packages/agentsam-merch/test/merch.test.mjs +332 -0
- package/packages/agentsam-merch/test/node-transforms.test.mjs +149 -0
- package/packages/agentsam-nav/dist/browser.global.js +71 -34
- package/packages/agentsam-nav/dist/browser.js +3179 -781
- package/packages/agentsam-nav/dist/index.js +3171 -773
- package/packages/agentsam-nav/package.json +1 -1
- package/packages/agentsam-queue-control/README.md +4 -1
- package/packages/agentsam-queue-control/package.json +4 -3
- package/packages/agentsam-queue-control/schemas/job-envelope.schema.json +111 -11
- package/packages/agentsam-queue-control/src/adapters/cloudflare.js +34 -6
- package/packages/agentsam-queue-control/src/adapters/memory.js +11 -2
- package/packages/agentsam-queue-control/src/adapters/sqlite.js +259 -0
- package/packages/agentsam-queue-control/src/contracts.js +207 -3
- package/packages/agentsam-queue-control/src/control-plane.js +62 -2
- package/packages/agentsam-queue-control/src/index.js +1 -0
- package/packages/agentsam-queue-control/test/queue-control.test.mjs +310 -0
- package/packages/agentsam-queue-control/test/sqlite-adapter.test.mjs +91 -0
- package/packages/agentsam-rapid-rust/README.md +3 -0
- package/packages/agentsam-repository/README.md +3 -0
- package/packages/agentsam-repository/package.json +1 -1
- package/packages/agentsam-vault/package.json +1 -1
- package/packages/agentsam-workbench/README.md +43 -0
- package/packages/agentsam-workbench/package.json +13 -3
- package/packages/agentsam-workbench/src/agent/AgentConversationSurface.tsx +108 -0
- package/packages/agentsam-workbench/src/agent/AgentPanel.tsx +25 -8
- package/packages/agentsam-workbench/src/agent/AgentRuntimeField.tsx +152 -0
- package/packages/agentsam-workbench/src/agent/Composer.tsx +10 -1
- package/packages/agentsam-workbench/src/agent/RunMode.ts +26 -0
- package/packages/agentsam-workbench/src/agent/Thread.tsx +18 -3
- package/packages/agentsam-workbench/src/agent/index.ts +3 -0
- package/packages/agentsam-workbench/src/index.ts +4 -0
- package/packages/agentsam-workbench/src/manufacturing/PreflightIndicator.tsx +203 -0
- package/packages/agentsam-workbench/src/manufacturing/index.ts +2 -0
- package/packages/agentsam-workbench/src/manufacturing/loading.ts +147 -0
- package/packages/agentsam-workbench/src/widgets/BuiltinWidget.tsx +22 -0
- package/packages/agentsam-workbench/src/widgets/CountdownWidget.tsx +68 -0
- package/packages/agentsam-workbench/src/widgets/WidgetFrame.tsx +56 -0
- package/packages/agentsam-workbench/src/widgets/countdown.ts +25 -0
- package/packages/agentsam-workbench/src/widgets/index.ts +6 -0
- package/packages/agentsam-workbench/src/widgets/registry.ts +13 -0
- package/packages/agentsam-workbench/src/widgets/useCountdown.ts +128 -0
- package/packages/agentsam-workbench/src/widgets/widgets.css +102 -0
- package/packages/connectors/{cloudflare → cfoa}/package.json +3 -3
- package/packages/heuristic-theme/package.json +1 -1
- package/packages/identity/README.md +3 -0
- package/packages/identity/backend/README.md +3 -0
- package/packages/identity/package.json +1 -1
- package/packages/identity/src/frontend/auth-portal/README.md +3 -0
- package/packages/identity/src/index.js +1 -1
- package/packages/identity/src/oauth/README.md +4 -1
- package/packages/identity/src/oauth/credentials.js +1 -1
- package/packages/identity/src/server/worker-router.js +1 -1
- package/packages/identity/tests/google-desktop-identity-login.test.mjs +1 -1
- package/packages/identity/tests/lane1-packed-consumer.test.mjs +1 -1
- package/packages/identity/tests/oauth-presets-accounts-ssot.test.mjs +1 -1
- package/packages/providers/completeful/package.json +1 -1
- package/packages/theme-church-site/package.json +1 -1
- package/packages/theme-companions-site/package.json +1 -1
- package/packages/theme-floors-site/package.json +1 -1
- package/packages/theme-fuelnfree-site/package.json +1 -1
- package/packages/theme-handyman-site/package.json +1 -1
- package/packages/theme-insurance-site/package.json +1 -1
- package/packages/theme-scenes/package.json +1 -1
- package/packages/theme-shinshu-site/package.json +1 -1
- package/packages/work-graph/package.json +1 -1
- package/protocol/models/README.md +3 -0
- package/protocol/receipts/agentsam.receipt.v1.json +95 -0
- package/protocol/theme-refinery/receipts/products-registry-batch-20260924.json +6 -6
- package/protocol/theme-refinery/receipts/theme-harvest-20260924.json +6 -6
- package/skills/README.md +3 -0
- package/src/acp/agent-executor.js +106 -0
- package/src/acp/client.js +316 -0
- package/src/acp/dependencies.js +426 -0
- package/src/acp/http.js +207 -0
- package/src/acp/index.js +22 -0
- package/src/acp/runs.js +125 -0
- package/src/acp/runtime-selection.js +180 -0
- package/src/cli/command-catalog.js +3 -0
- package/src/cli.js +24 -0
- package/src/commands/cloudflare-login.js +1 -1
- package/src/commands/cloudflare.js +2 -2
- package/src/commands/connections.js +1 -1
- package/src/commands/go.js +76 -6
- package/src/commands/merch.js +5 -0
- package/src/commands/mini.js +1 -1
- package/src/commands/receipts.js +140 -0
- package/src/commands/run.js +253 -0
- package/src/go/container.js +1 -1
- package/src/go/contract.js +61 -18
- package/src/go/discover.js +0 -4
- package/src/go/index.js +13 -1
- package/src/go/probe.js +109 -0
- package/src/go/{cloudflare.js → providers/cloudflare.js} +36 -136
- package/src/go/verify.js +1 -1
- package/src/indexing/ingest/inventory.js +1 -1
- package/src/lib/deploy/local-studio.js +2 -2
- package/src/lib/mini/scaffold.js +1 -1
- package/src/lib/whoami-capabilities.js +1 -1
- package/src/local/runtime-store.js +8 -0
- package/src/mcp/cloudflare-bundles.js +1 -1
- package/src/plugins/index.js +1 -0
- package/src/plugins/registry.js +59 -6
- package/src/receipts/contract.js +68 -0
- package/src/receipts/index.js +20 -0
- package/src/receipts/prune.js +64 -0
- package/src/receipts/sinks.js +285 -0
- package/templates/mini/gadget/app.js +15 -40
- package/templates/mini/gadget/index.html +7 -7
- package/templates/mini/shared/style.css +1 -1
- package/packages/agentsam-repository/src/goap.js.bak-20260922011251 +0 -670
- /package/packages/connectors/{cloudflare → cfoa}/OAUTH_STORAGE_AUDIT.md +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/api-client.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/capabilities.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/credential.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/brand-protection.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/keyless.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/pages.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/scanner.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/snippets.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/tag-gateway.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/tags.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/token-validation.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/vectorize.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/families/workflows.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/index.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/oauth-persist.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/owner.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/permission-options.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/routes.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/scope-catalog.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/src/vault.js +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/capabilities.test.mjs +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/connector.test.mjs +0 -0
- /package/packages/connectors/{cloudflare → cfoa}/tests/oauth-persist.test.mjs +0 -0
- /package/packages/identity/src/oauth/{google-desktop-exchange.js → goaude.js} +0 -0
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
export type MediaKind = "raster" | "vector" | "document" | "unknown";
|
|
2
|
+
export type CompatibilityStatus =
|
|
3
|
+
| "ready"
|
|
4
|
+
| "ready_with_warning"
|
|
5
|
+
| "ready_with_transform"
|
|
6
|
+
| "prepared_for_digitization"
|
|
7
|
+
| "needs_variant"
|
|
8
|
+
| "unsupported";
|
|
9
|
+
export type TransformPolicy = "auto" | "preserve";
|
|
10
|
+
|
|
11
|
+
export interface ResolutionPolicy {
|
|
12
|
+
readyPpi: number | null;
|
|
13
|
+
minimumPpi: number | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface AutoNormalizePolicy {
|
|
17
|
+
trimAlpha: boolean;
|
|
18
|
+
colorSpace: boolean;
|
|
19
|
+
svgOptimize: boolean;
|
|
20
|
+
outlineText: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface VectorizationPolicy {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
preferredTracer: string | null;
|
|
26
|
+
maxAspectDrift: number;
|
|
27
|
+
minBoundaryIntegrity: number;
|
|
28
|
+
outputFormat: string | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ManufacturingProfile {
|
|
32
|
+
schemaVersion?: "agentsam.manufacturing-profile.v1" | string;
|
|
33
|
+
$schema?: string;
|
|
34
|
+
id: string;
|
|
35
|
+
manufacturer: string;
|
|
36
|
+
process: string;
|
|
37
|
+
format?: string;
|
|
38
|
+
preferredFormat?: string;
|
|
39
|
+
colorSpace?: string | null;
|
|
40
|
+
colorMode?: string | null;
|
|
41
|
+
alpha?: boolean;
|
|
42
|
+
requireAlpha?: boolean;
|
|
43
|
+
ppi?: number | null;
|
|
44
|
+
resolution?: Partial<ResolutionPolicy> | ResolutionPolicy;
|
|
45
|
+
autoNormalize?: Partial<AutoNormalizePolicy> | AutoNormalizePolicy;
|
|
46
|
+
vectorization?: Partial<VectorizationPolicy> | VectorizationPolicy;
|
|
47
|
+
maxBytes?: number | null;
|
|
48
|
+
preferredPrintWidthIn?: number | null;
|
|
49
|
+
preferredPrintHeightIn?: number | null;
|
|
50
|
+
allowRaster?: boolean;
|
|
51
|
+
allowVector?: boolean;
|
|
52
|
+
allowGradients?: boolean;
|
|
53
|
+
requireClosedPaths?: boolean;
|
|
54
|
+
requireViewBox?: boolean;
|
|
55
|
+
outlineText?: boolean;
|
|
56
|
+
match?: Record<string, unknown> | null;
|
|
57
|
+
handoff?: { status?: string; reason?: string; [key: string]: unknown } | null;
|
|
58
|
+
source?: { kind?: string; verified?: boolean; [key: string]: unknown } | null;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface SourceAssetDescriptor {
|
|
63
|
+
format?: string;
|
|
64
|
+
extension?: string;
|
|
65
|
+
mimeType?: string;
|
|
66
|
+
mediaKind?: MediaKind;
|
|
67
|
+
widthPx?: number;
|
|
68
|
+
heightPx?: number;
|
|
69
|
+
contentWidthPx?: number;
|
|
70
|
+
contentHeightPx?: number;
|
|
71
|
+
trimmedWidthPx?: number;
|
|
72
|
+
trimmedHeightPx?: number;
|
|
73
|
+
width?: number;
|
|
74
|
+
height?: number;
|
|
75
|
+
bytes?: number;
|
|
76
|
+
sizeBytes?: number;
|
|
77
|
+
colorSpace?: string;
|
|
78
|
+
colorMode?: string;
|
|
79
|
+
hasAlpha?: boolean;
|
|
80
|
+
transparentBorderDetected?: boolean;
|
|
81
|
+
isAlphaTrimmed?: boolean;
|
|
82
|
+
hasGradients?: boolean;
|
|
83
|
+
hasOpenPaths?: boolean;
|
|
84
|
+
hasLiveText?: boolean;
|
|
85
|
+
hasExplicitViewBox?: boolean;
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface ManufacturingTarget {
|
|
90
|
+
placementWidthIn?: number | null;
|
|
91
|
+
placementHeightIn?: number | null;
|
|
92
|
+
printWidthIn?: number | null;
|
|
93
|
+
printHeightIn?: number | null;
|
|
94
|
+
providerDpi?: number | null;
|
|
95
|
+
[key: string]: unknown;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface CompatibilityIssue {
|
|
99
|
+
status: CompatibilityStatus;
|
|
100
|
+
code: string;
|
|
101
|
+
message: string;
|
|
102
|
+
action: string | null;
|
|
103
|
+
meta?: Record<string, unknown> | null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface EffectivePpiResult {
|
|
107
|
+
effectivePpi: number | null;
|
|
108
|
+
widthPpi: number | null;
|
|
109
|
+
heightPpi: number | null;
|
|
110
|
+
widthIn: number | null;
|
|
111
|
+
heightIn: number | null;
|
|
112
|
+
basis: "content_bounds" | "pixel_bounds" | null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface ManufacturingCompatibility {
|
|
116
|
+
profileId: string | null;
|
|
117
|
+
manufacturer: string | null;
|
|
118
|
+
process: string | null;
|
|
119
|
+
status: CompatibilityStatus;
|
|
120
|
+
requirementsVerified: boolean;
|
|
121
|
+
productionReady: boolean;
|
|
122
|
+
transformReady: boolean;
|
|
123
|
+
effectivePpi: number | null;
|
|
124
|
+
resolution: {
|
|
125
|
+
band: "ready" | "warning" | "fail" | "unknown";
|
|
126
|
+
basis: "content_bounds" | "pixel_bounds" | null;
|
|
127
|
+
widthPpi: number | null;
|
|
128
|
+
heightPpi: number | null;
|
|
129
|
+
readyPpi: number | null;
|
|
130
|
+
minimumPpi: number | null;
|
|
131
|
+
};
|
|
132
|
+
target: {
|
|
133
|
+
format: string | null;
|
|
134
|
+
ppi: number | null;
|
|
135
|
+
printWidthIn: number | null;
|
|
136
|
+
printHeightIn: number | null;
|
|
137
|
+
};
|
|
138
|
+
issues: readonly CompatibilityIssue[];
|
|
139
|
+
actions: readonly string[];
|
|
140
|
+
handoff: ManufacturingProfile["handoff"];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface ManufacturingProfileRegistry {
|
|
144
|
+
register(profile: ManufacturingProfile, options?: { replace?: boolean }): Readonly<ManufacturingProfile>;
|
|
145
|
+
get(id: string): Readonly<ManufacturingProfile> | null;
|
|
146
|
+
list(filter?: { manufacturer?: string; process?: string }): Readonly<ManufacturingProfile>[];
|
|
147
|
+
select(context?: Record<string, unknown>): Readonly<ManufacturingProfile> | null;
|
|
148
|
+
unregister(id: string): boolean;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export const MANUFACTURING_PROFILE_SCHEMA: "agentsam.manufacturing-profile.v1";
|
|
152
|
+
export const RASTER_FORMATS: readonly string[];
|
|
153
|
+
export const VECTOR_FORMATS: readonly string[];
|
|
154
|
+
export const DOCUMENT_FORMATS: readonly string[];
|
|
155
|
+
export function normalizeFormat(value: unknown): string | null;
|
|
156
|
+
export function mediaKindForFormat(value: unknown): MediaKind;
|
|
157
|
+
export function normalizeResolutionPolicy(
|
|
158
|
+
input?: Partial<ResolutionPolicy>,
|
|
159
|
+
fallbackPpi?: number | null,
|
|
160
|
+
): Readonly<ResolutionPolicy>;
|
|
161
|
+
export function normalizeManufacturingProfile(input?: ManufacturingProfile): Readonly<ManufacturingProfile>;
|
|
162
|
+
export function validateManufacturingProfile(input: ManufacturingProfile): {
|
|
163
|
+
ok: boolean;
|
|
164
|
+
errors: readonly string[];
|
|
165
|
+
profile: Readonly<ManufacturingProfile>;
|
|
166
|
+
};
|
|
167
|
+
export function createManufacturingProfileRegistry(
|
|
168
|
+
profiles?: ManufacturingProfile[],
|
|
169
|
+
): ManufacturingProfileRegistry;
|
|
170
|
+
|
|
171
|
+
export const COMPATIBILITY_STATUS: Readonly<{
|
|
172
|
+
READY: "ready";
|
|
173
|
+
READY_WITH_WARNING: "ready_with_warning";
|
|
174
|
+
READY_WITH_TRANSFORM: "ready_with_transform";
|
|
175
|
+
PREPARED_FOR_DIGITIZATION: "prepared_for_digitization";
|
|
176
|
+
NEEDS_VARIANT: "needs_variant";
|
|
177
|
+
UNSUPPORTED: "unsupported";
|
|
178
|
+
}>;
|
|
179
|
+
export function calculateEffectivePpi(
|
|
180
|
+
asset: SourceAssetDescriptor,
|
|
181
|
+
profile: ManufacturingProfile,
|
|
182
|
+
target?: ManufacturingTarget,
|
|
183
|
+
): Readonly<EffectivePpiResult>;
|
|
184
|
+
export function evaluateManufacturingCompatibility(
|
|
185
|
+
asset: SourceAssetDescriptor,
|
|
186
|
+
profile: ManufacturingProfile,
|
|
187
|
+
target?: ManufacturingTarget,
|
|
188
|
+
): Readonly<ManufacturingCompatibility>;
|
|
189
|
+
export function evaluateCompatibleProducts(
|
|
190
|
+
asset: SourceAssetDescriptor,
|
|
191
|
+
products: Record<string, unknown>[],
|
|
192
|
+
registry: ManufacturingProfileRegistry,
|
|
193
|
+
): Readonly<Record<string, unknown>>[];
|
|
194
|
+
|
|
195
|
+
export interface TransformOperation {
|
|
196
|
+
id: string;
|
|
197
|
+
automatic: boolean;
|
|
198
|
+
requires: readonly string[];
|
|
199
|
+
params: Readonly<Record<string, unknown>>;
|
|
200
|
+
issueCode?: string;
|
|
201
|
+
missingCapabilities?: readonly string[];
|
|
202
|
+
executable?: boolean;
|
|
203
|
+
note?: string;
|
|
204
|
+
}
|
|
205
|
+
export const TRANSFORM_OPERATION: Readonly<Record<string, string>>;
|
|
206
|
+
export function planAutomaticTransforms(input: {
|
|
207
|
+
asset: SourceAssetDescriptor;
|
|
208
|
+
profile: ManufacturingProfile;
|
|
209
|
+
target?: ManufacturingTarget;
|
|
210
|
+
capabilities?: Record<string, boolean>;
|
|
211
|
+
}): Readonly<{
|
|
212
|
+
compatibility: ManufacturingCompatibility;
|
|
213
|
+
operations: readonly TransformOperation[];
|
|
214
|
+
canExecuteAutomatically: boolean;
|
|
215
|
+
hasBlockingIssue: boolean;
|
|
216
|
+
}>;
|
|
217
|
+
export function verifyVectorizationResult(input: {
|
|
218
|
+
source: SourceAssetDescriptor;
|
|
219
|
+
result: SourceAssetDescriptor & { boundaryIntegrity?: number };
|
|
220
|
+
profile: ManufacturingProfile;
|
|
221
|
+
}): Readonly<{
|
|
222
|
+
verified: boolean;
|
|
223
|
+
aspectOk: boolean;
|
|
224
|
+
boundaryOk: boolean;
|
|
225
|
+
aspectDrift: number | null;
|
|
226
|
+
boundaryIntegrity: number | null;
|
|
227
|
+
thresholds: Readonly<{ maxAspectDrift: number; minBoundaryIntegrity: number }>;
|
|
228
|
+
reason: string | null;
|
|
229
|
+
}>;
|
|
230
|
+
|
|
231
|
+
export const DERIVATIVE_ROLE: Readonly<{
|
|
232
|
+
ORIGINAL: "original/master";
|
|
233
|
+
MANUFACTURING: "manufacturing";
|
|
234
|
+
STOREFRONT: "storefront/gallery";
|
|
235
|
+
THUMBNAIL: "thumbnail";
|
|
236
|
+
SOCIAL: "social";
|
|
237
|
+
MOCKUP: "mockup";
|
|
238
|
+
}>;
|
|
239
|
+
export function planMediaDerivatives(input: {
|
|
240
|
+
asset: SourceAssetDescriptor;
|
|
241
|
+
profile: ManufacturingProfile;
|
|
242
|
+
target?: ManufacturingTarget;
|
|
243
|
+
storefrontFormat?: string;
|
|
244
|
+
thumbnailFormat?: string;
|
|
245
|
+
socialFormat?: string;
|
|
246
|
+
mockupFormat?: string;
|
|
247
|
+
}): Readonly<Record<string, unknown>>;
|
|
248
|
+
export function buildMerchPlan(input: {
|
|
249
|
+
design: { asset: SourceAssetDescriptor; [key: string]: unknown };
|
|
250
|
+
products?: Record<string, unknown>[];
|
|
251
|
+
registry: ManufacturingProfileRegistry;
|
|
252
|
+
}): Readonly<Record<string, unknown>>;
|
|
253
|
+
|
|
254
|
+
export type CollectionCandidateState =
|
|
255
|
+
| "concept"
|
|
256
|
+
| "approved-art"
|
|
257
|
+
| "production-ready"
|
|
258
|
+
| "sample-ordered"
|
|
259
|
+
| "sample-approved"
|
|
260
|
+
| "published"
|
|
261
|
+
| "retired";
|
|
262
|
+
export interface CollectionCandidate {
|
|
263
|
+
id: string;
|
|
264
|
+
designId: string;
|
|
265
|
+
collectionPath: readonly string[];
|
|
266
|
+
state: CollectionCandidateState;
|
|
267
|
+
products: readonly Record<string, unknown>[];
|
|
268
|
+
approvals: Readonly<{ artwork: boolean; wording: boolean; palette: boolean; visualIdentity: boolean }>;
|
|
269
|
+
metadata: Readonly<Record<string, unknown>>;
|
|
270
|
+
}
|
|
271
|
+
export const COLLECTION_CANDIDATE_STATE: Readonly<Record<string, CollectionCandidateState>>;
|
|
272
|
+
export function createCollectionCandidate(
|
|
273
|
+
input: Partial<CollectionCandidate> & Pick<CollectionCandidate, "id" | "designId">,
|
|
274
|
+
): Readonly<CollectionCandidate>;
|
|
275
|
+
export function canTransitionCollectionCandidate(from: CollectionCandidateState, to: CollectionCandidateState): boolean;
|
|
276
|
+
export function transitionCollectionCandidate(
|
|
277
|
+
candidate: CollectionCandidate,
|
|
278
|
+
nextState: CollectionCandidateState,
|
|
279
|
+
): Readonly<CollectionCandidate>;
|
|
280
|
+
export function approvalsComplete(candidate: CollectionCandidate): boolean;
|
|
281
|
+
|
|
282
|
+
export interface ProductConceptTarget {
|
|
283
|
+
provider: string;
|
|
284
|
+
profileId: string;
|
|
285
|
+
priority?: number;
|
|
286
|
+
enabled?: boolean;
|
|
287
|
+
adapter?: string;
|
|
288
|
+
metadata?: Record<string, unknown>;
|
|
289
|
+
}
|
|
290
|
+
export interface ProductConcept {
|
|
291
|
+
id: string;
|
|
292
|
+
label?: string;
|
|
293
|
+
category?: string;
|
|
294
|
+
targets: ProductConceptTarget[];
|
|
295
|
+
[key: string]: unknown;
|
|
296
|
+
}
|
|
297
|
+
export function normalizeProductConcept(input: ProductConcept): Readonly<ProductConcept>;
|
|
298
|
+
export function createProductConceptRegistry(initial?: ProductConcept[]): Readonly<{
|
|
299
|
+
register(input: ProductConcept, options?: { replace?: boolean }): Readonly<ProductConcept>;
|
|
300
|
+
get(id: string): Readonly<ProductConcept> | null;
|
|
301
|
+
list(): Readonly<ProductConcept>[];
|
|
302
|
+
}>;
|
|
303
|
+
export function resolveProductConceptTarget(
|
|
304
|
+
concept: ProductConcept,
|
|
305
|
+
input: {
|
|
306
|
+
profileRegistry: ManufacturingProfileRegistry;
|
|
307
|
+
availableProviders?: string[];
|
|
308
|
+
preferredProvider?: string | null;
|
|
309
|
+
},
|
|
310
|
+
): Readonly<Record<string, unknown>>;
|
|
311
|
+
|
|
312
|
+
export function completefulProfileContext(
|
|
313
|
+
product?: Record<string, unknown>,
|
|
314
|
+
location?: Record<string, unknown>,
|
|
315
|
+
): Readonly<Record<string, unknown>>;
|
|
316
|
+
export function completefulTarget(location?: Record<string, unknown>): Readonly<ManufacturingTarget>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export {
|
|
2
|
+
MANUFACTURING_PROFILE_SCHEMA,
|
|
3
|
+
RASTER_FORMATS,
|
|
4
|
+
VECTOR_FORMATS,
|
|
5
|
+
DOCUMENT_FORMATS,
|
|
6
|
+
mediaKindForFormat,
|
|
7
|
+
normalizeFormat,
|
|
8
|
+
normalizeManufacturingProfile,
|
|
9
|
+
normalizeResolutionPolicy,
|
|
10
|
+
validateManufacturingProfile,
|
|
11
|
+
} from "./profile.js";
|
|
12
|
+
export { createManufacturingProfileRegistry } from "./profile-registry.js";
|
|
13
|
+
export {
|
|
14
|
+
COMPATIBILITY_STATUS,
|
|
15
|
+
calculateEffectivePpi,
|
|
16
|
+
evaluateManufacturingCompatibility,
|
|
17
|
+
evaluateCompatibleProducts,
|
|
18
|
+
} from "./compatibility.js";
|
|
19
|
+
export {
|
|
20
|
+
DERIVATIVE_ROLE,
|
|
21
|
+
planMediaDerivatives,
|
|
22
|
+
buildMerchPlan,
|
|
23
|
+
} from "./derivatives.js";
|
|
24
|
+
export {
|
|
25
|
+
COLLECTION_CANDIDATE_STATE,
|
|
26
|
+
approvalsComplete,
|
|
27
|
+
canTransitionCollectionCandidate,
|
|
28
|
+
createCollectionCandidate,
|
|
29
|
+
transitionCollectionCandidate,
|
|
30
|
+
} from "./collection-lab.js";
|
|
31
|
+
export {
|
|
32
|
+
completefulProfileContext,
|
|
33
|
+
completefulTarget,
|
|
34
|
+
} from "./adapters-completeful.js";
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
TRANSFORM_OPERATION,
|
|
38
|
+
planAutomaticTransforms,
|
|
39
|
+
verifyVectorizationResult,
|
|
40
|
+
} from "./transforms.js";
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
createProductConceptRegistry,
|
|
44
|
+
normalizeProductConcept,
|
|
45
|
+
resolveProductConceptTarget,
|
|
46
|
+
} from "./product-concepts.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { SourceAssetDescriptor, TransformOperation } from "../index.js";
|
|
2
|
+
|
|
3
|
+
export interface NodeTransformCapabilities {
|
|
4
|
+
raster_normalizer: boolean;
|
|
5
|
+
format_converter: boolean;
|
|
6
|
+
vector_rasterizer: boolean;
|
|
7
|
+
vector_tracer: boolean;
|
|
8
|
+
svg_normalizer: boolean;
|
|
9
|
+
vector_normalizer: boolean;
|
|
10
|
+
text_outliner: boolean;
|
|
11
|
+
tools: Readonly<Record<string, boolean>>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function inspectRaster(
|
|
15
|
+
input: Buffer | Uint8Array | string,
|
|
16
|
+
options?: { sharp?: unknown },
|
|
17
|
+
): Promise<Readonly<SourceAssetDescriptor>>;
|
|
18
|
+
|
|
19
|
+
export function normalizeRaster(
|
|
20
|
+
input: Buffer | Uint8Array | string,
|
|
21
|
+
options?: {
|
|
22
|
+
operations?: readonly (string | TransformOperation)[];
|
|
23
|
+
format?: string;
|
|
24
|
+
sharp?: unknown;
|
|
25
|
+
},
|
|
26
|
+
): Promise<Readonly<{
|
|
27
|
+
buffer: Buffer;
|
|
28
|
+
info: Readonly<Record<string, unknown>>;
|
|
29
|
+
descriptor: Readonly<SourceAssetDescriptor>;
|
|
30
|
+
operations: readonly string[];
|
|
31
|
+
}>>;
|
|
32
|
+
|
|
33
|
+
export function detectNodeTransformCapabilities(): Promise<Readonly<NodeTransformCapabilities>>;
|
|
34
|
+
|
|
35
|
+
export function traceRasterToSvg(
|
|
36
|
+
input: Buffer | Uint8Array,
|
|
37
|
+
options?: {
|
|
38
|
+
tracer?: "auto" | "potrace" | "vtracer";
|
|
39
|
+
threshold?: number;
|
|
40
|
+
turdSize?: number;
|
|
41
|
+
sharp?: unknown;
|
|
42
|
+
},
|
|
43
|
+
): Promise<Readonly<{
|
|
44
|
+
svg: string;
|
|
45
|
+
tracer: string;
|
|
46
|
+
descriptor: Readonly<SourceAssetDescriptor & { boundaryIntegrity: number }>;
|
|
47
|
+
metrics: Readonly<{ boundaryIntegrity: number; width: number; height: number }>;
|
|
48
|
+
}>>;
|
|
49
|
+
|
|
50
|
+
export function normalizeSvgWithSvgo(
|
|
51
|
+
svg: string,
|
|
52
|
+
options?: { multipass?: boolean },
|
|
53
|
+
): Promise<Readonly<{
|
|
54
|
+
svg: string;
|
|
55
|
+
hasExplicitViewBox: boolean;
|
|
56
|
+
hasLiveText: boolean;
|
|
57
|
+
note: string;
|
|
58
|
+
}>>;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
async function loadSharp(injected) {
|
|
2
|
+
if (injected) return injected;
|
|
3
|
+
try {
|
|
4
|
+
const mod = await import("sharp");
|
|
5
|
+
return mod.default || mod;
|
|
6
|
+
} catch (error) {
|
|
7
|
+
const wrapped = new Error(
|
|
8
|
+
"Raster normalization requires the optional 'sharp' runtime dependency.",
|
|
9
|
+
);
|
|
10
|
+
wrapped.code = "sharp_unavailable";
|
|
11
|
+
wrapped.cause = error;
|
|
12
|
+
throw wrapped;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function hasOperation(operations, id) {
|
|
17
|
+
return (operations || []).some((operation) =>
|
|
18
|
+
typeof operation === "string" ? operation === id : operation?.id === id,
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function operation(operations, id) {
|
|
23
|
+
return (operations || []).find((item) =>
|
|
24
|
+
typeof item === "string" ? item === id : item?.id === id,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function inspectRaster(input, { sharp: injectedSharp } = {}) {
|
|
29
|
+
const sharp = await loadSharp(injectedSharp);
|
|
30
|
+
const image = sharp(input, { failOn: "warning" }).rotate();
|
|
31
|
+
const metadata = await image.metadata();
|
|
32
|
+
|
|
33
|
+
const descriptor = {
|
|
34
|
+
format: metadata.format || null,
|
|
35
|
+
mediaKind: "raster",
|
|
36
|
+
widthPx: metadata.width || null,
|
|
37
|
+
heightPx: metadata.height || null,
|
|
38
|
+
colorSpace: metadata.space || null,
|
|
39
|
+
hasAlpha: metadata.hasAlpha ?? null,
|
|
40
|
+
channels: metadata.channels || null,
|
|
41
|
+
density: metadata.density || null,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (!metadata.hasAlpha) {
|
|
45
|
+
return Object.freeze({
|
|
46
|
+
...descriptor,
|
|
47
|
+
contentWidthPx: metadata.width || null,
|
|
48
|
+
contentHeightPx: metadata.height || null,
|
|
49
|
+
transparentBorderDetected: false,
|
|
50
|
+
isAlphaTrimmed: true,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const { info } = await sharp(input, { failOn: "warning" })
|
|
56
|
+
.rotate()
|
|
57
|
+
.trim({ background: { r: 0, g: 0, b: 0, alpha: 0 } })
|
|
58
|
+
.png()
|
|
59
|
+
.toBuffer({ resolveWithObject: true });
|
|
60
|
+
|
|
61
|
+
const trimmed =
|
|
62
|
+
Boolean(metadata.width && info.width && info.width < metadata.width) ||
|
|
63
|
+
Boolean(metadata.height && info.height && info.height < metadata.height);
|
|
64
|
+
|
|
65
|
+
return Object.freeze({
|
|
66
|
+
...descriptor,
|
|
67
|
+
contentWidthPx: info.width || metadata.width || null,
|
|
68
|
+
contentHeightPx: info.height || metadata.height || null,
|
|
69
|
+
transparentBorderDetected: trimmed,
|
|
70
|
+
isAlphaTrimmed: !trimmed,
|
|
71
|
+
});
|
|
72
|
+
} catch {
|
|
73
|
+
return Object.freeze({
|
|
74
|
+
...descriptor,
|
|
75
|
+
contentWidthPx: metadata.width || null,
|
|
76
|
+
contentHeightPx: metadata.height || null,
|
|
77
|
+
transparentBorderDetected: null,
|
|
78
|
+
isAlphaTrimmed: false,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export async function normalizeRaster(
|
|
84
|
+
input,
|
|
85
|
+
{
|
|
86
|
+
operations = [],
|
|
87
|
+
format = "png",
|
|
88
|
+
sharp: injectedSharp,
|
|
89
|
+
} = {},
|
|
90
|
+
) {
|
|
91
|
+
const sharp = await loadSharp(injectedSharp);
|
|
92
|
+
let image = sharp(input, { failOn: "warning" }).rotate();
|
|
93
|
+
|
|
94
|
+
if (hasOperation(operations, "trim_alpha")) {
|
|
95
|
+
image = image.trim({ background: { r: 0, g: 0, b: 0, alpha: 0 } });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const colorOperation = operation(operations, "normalize_color_space");
|
|
99
|
+
const requestedColorSpace =
|
|
100
|
+
typeof colorOperation === "object"
|
|
101
|
+
? colorOperation.params?.colorSpace || "srgb"
|
|
102
|
+
: "srgb";
|
|
103
|
+
if (colorOperation) {
|
|
104
|
+
image = image.toColourspace(requestedColorSpace);
|
|
105
|
+
if (typeof image.withIccProfile === "function") {
|
|
106
|
+
image = image.withIccProfile(requestedColorSpace);
|
|
107
|
+
} else {
|
|
108
|
+
image = image.withMetadata();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const target = String(format || "png").toLowerCase();
|
|
113
|
+
if (target === "png") {
|
|
114
|
+
image = image.png({
|
|
115
|
+
compressionLevel: 9,
|
|
116
|
+
adaptiveFiltering: true,
|
|
117
|
+
palette: false,
|
|
118
|
+
});
|
|
119
|
+
} else if (target === "jpg" || target === "jpeg") {
|
|
120
|
+
image = image.jpeg({ quality: 95, chromaSubsampling: "4:4:4" });
|
|
121
|
+
} else if (target === "webp") {
|
|
122
|
+
image = image.webp({ quality: 92, smartSubsample: true });
|
|
123
|
+
} else if (target === "tiff") {
|
|
124
|
+
image = image.tiff({ compression: "lzw" });
|
|
125
|
+
} else {
|
|
126
|
+
const error = new Error(`Unsupported raster normalization output: ${target}`);
|
|
127
|
+
error.code = "unsupported_raster_output";
|
|
128
|
+
throw error;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const { data, info } = await image.toBuffer({ resolveWithObject: true });
|
|
132
|
+
const descriptor = await inspectRaster(data, { sharp });
|
|
133
|
+
|
|
134
|
+
return Object.freeze({
|
|
135
|
+
buffer: data,
|
|
136
|
+
info: Object.freeze({ ...info }),
|
|
137
|
+
descriptor,
|
|
138
|
+
operations: Object.freeze(
|
|
139
|
+
operations.map((item) => (typeof item === "string" ? item : item.id)),
|
|
140
|
+
),
|
|
141
|
+
});
|
|
142
|
+
}
|