@vibesdotdev/integrations-comfyui 0.0.0-stage → 1.0.0-rc.4
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/LICENSE +126 -0
- package/README.md +39 -2
- package/dist/ai/index.d.ts +4 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +4 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/provider.consumer.plugin.d.ts +6 -0
- package/dist/ai/provider.consumer.plugin.d.ts.map +1 -0
- package/dist/ai/provider.consumer.plugin.js +122 -0
- package/dist/ai/provider.consumer.plugin.js.map +1 -0
- package/dist/ai/provider.plugin.d.ts +3 -0
- package/dist/ai/provider.plugin.d.ts.map +1 -0
- package/dist/ai/provider.plugin.js +3 -0
- package/dist/ai/provider.plugin.js.map +1 -0
- package/dist/ai/providers/comfyui/comfyui.provider.impl.d.ts +20 -0
- package/dist/ai/providers/comfyui/comfyui.provider.impl.d.ts.map +1 -0
- package/dist/ai/providers/comfyui/comfyui.provider.impl.js +104 -0
- package/dist/ai/providers/comfyui/comfyui.provider.impl.js.map +1 -0
- package/dist/ai/providers/comfyui/detection/index.d.ts +2 -0
- package/dist/ai/providers/comfyui/detection/index.d.ts.map +1 -0
- package/dist/ai/providers/comfyui/detection/index.js +2 -0
- package/dist/ai/providers/comfyui/detection/index.js.map +1 -0
- package/dist/ai/providers/comfyui/detection/system.d.ts +6 -0
- package/dist/ai/providers/comfyui/detection/system.d.ts.map +1 -0
- package/dist/ai/providers/comfyui/detection/system.js +44 -0
- package/dist/ai/providers/comfyui/detection/system.js.map +1 -0
- package/dist/ai/providers/comfyui/http.d.ts +4 -0
- package/dist/ai/providers/comfyui/http.d.ts.map +1 -0
- package/dist/ai/providers/comfyui/http.js +36 -0
- package/dist/ai/providers/comfyui/http.js.map +1 -0
- package/dist/ai/providers/comfyui/index.d.ts +4 -0
- package/dist/ai/providers/comfyui/index.d.ts.map +1 -0
- package/dist/ai/providers/comfyui/index.js +4 -0
- package/dist/ai/providers/comfyui/index.js.map +1 -0
- package/dist/ai/providers/comfyui/recommendations.d.ts +24 -0
- package/dist/ai/providers/comfyui/recommendations.d.ts.map +1 -0
- package/dist/ai/providers/comfyui/recommendations.js +101 -0
- package/dist/ai/providers/comfyui/recommendations.js.map +1 -0
- package/dist/ai/providers/local/image/comfyui/config/config.comfyui.descriptor.d.ts +4206 -0
- package/dist/ai/providers/local/image/comfyui/config/config.comfyui.descriptor.d.ts.map +1 -0
- package/dist/ai/providers/local/image/comfyui/config/config.comfyui.descriptor.js +43 -0
- package/dist/ai/providers/local/image/comfyui/config/config.comfyui.descriptor.js.map +1 -0
- package/dist/ai/providers/local/image/comfyui/config/schemas/index.d.ts +2 -0
- package/dist/ai/providers/local/image/comfyui/config/schemas/index.d.ts.map +1 -0
- package/dist/ai/providers/local/image/comfyui/config/schemas/index.js +2 -0
- package/dist/ai/providers/local/image/comfyui/config/schemas/index.js.map +1 -0
- package/dist/ai/providers/local/image/comfyui/index.d.ts +5 -0
- package/dist/ai/providers/local/image/comfyui/index.d.ts.map +1 -0
- package/dist/ai/providers/local/image/comfyui/index.js +4 -0
- package/dist/ai/providers/local/image/comfyui/index.js.map +1 -0
- package/dist/ai/providers/local/image/comfyui/provider.comfyui.descriptor.d.ts +183 -0
- package/dist/ai/providers/local/image/comfyui/provider.comfyui.descriptor.d.ts.map +1 -0
- package/dist/ai/providers/local/image/comfyui/provider.comfyui.descriptor.js +53 -0
- package/dist/ai/providers/local/image/comfyui/provider.comfyui.descriptor.js.map +1 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.descriptor.d.ts +37 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.descriptor.d.ts.map +1 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.descriptor.js +34 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.descriptor.js.map +1 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.impl.d.ts +75 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.impl.d.ts.map +1 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.impl.js +239 -0
- package/dist/ai/specs/comfyui-prompt/comfyui-prompt.spec.impl.js.map +1 -0
- package/dist/config/comfyui.config.descriptor.d.ts +79 -0
- package/dist/config/comfyui.config.descriptor.d.ts.map +1 -0
- package/dist/config/comfyui.config.descriptor.js +50 -0
- package/dist/config/comfyui.config.descriptor.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/comfyui.d.ts +98 -0
- package/dist/schemas/comfyui.d.ts.map +1 -0
- package/dist/schemas/comfyui.js +69 -0
- package/dist/schemas/comfyui.js.map +1 -0
- package/package.json +101 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Parameters
|
|
4
|
+
|
|
5
|
+
Licensor: VIBES DEV LLC
|
|
6
|
+
Licensed Work: @vibesdotdev/integrations-comfyui
|
|
7
|
+
The Licensed Work is (c) 2026 VIBES DEV LLC.
|
|
8
|
+
Additional Use Grant: In this grant, "Vibes Platform" means the hosted services VIBES DEV LLC
|
|
9
|
+
operates at vibes.dev and its subdomains.
|
|
10
|
+
|
|
11
|
+
You may make production use of the Licensed Work, including commercial
|
|
12
|
+
use, subject to the limits below. Permitted production use includes:
|
|
13
|
+
building, operating and selling your own applications, agents and services
|
|
14
|
+
on or with the Vibes Platform; self-hosting the Licensed Work for use inside
|
|
15
|
+
your own organization; and providing consulting, integration or development
|
|
16
|
+
services to clients who build on the Vibes Platform.
|
|
17
|
+
|
|
18
|
+
The production use permitted above does not include use that:
|
|
19
|
+
|
|
20
|
+
(a) offers third parties a hosted, managed or embedded service that
|
|
21
|
+
substitutes for the Vibes Platform or a material part of it (including
|
|
22
|
+
agent hosting; fleet, sandbox or container provisioning; package
|
|
23
|
+
registry; source hosting and continuous integration; and managed AI,
|
|
24
|
+
storage, secrets or messaging), where the Licensed Work provides a
|
|
25
|
+
material part of that service's value and that service earns more than
|
|
26
|
+
US$1,000,000 in gross revenue in any twelve-month period;
|
|
27
|
+
(b) sells, rents, sublicenses or white-labels the Licensed Work, or access
|
|
28
|
+
to Vibes Platform functionality, as a product in its own right;
|
|
29
|
+
(c) removes, disables or works around entitlement checks, usage metering,
|
|
30
|
+
quotas or plan limits, or reaches Vibes Platform features the user's
|
|
31
|
+
account is not entitled to;
|
|
32
|
+
(d) scrapes, bulk-exports or harvests data or content from the Vibes
|
|
33
|
+
Platform or its users other than through documented interfaces and
|
|
34
|
+
within their terms, or uses outputs or data obtained from the Vibes
|
|
35
|
+
Platform to train or improve a product that competes with it;
|
|
36
|
+
(e) violates applicable law, infringes anyone's rights, commits fraud or
|
|
37
|
+
deception, conducts unlawful surveillance or harassment, distributes
|
|
38
|
+
malware, or accesses systems without authorization; or
|
|
39
|
+
(f) violates applicable antitrust or competition law.
|
|
40
|
+
|
|
41
|
+
A written permission from the Licensor extends this grant.
|
|
42
|
+
Change Date: Four years from the date the Licensed Work is published.
|
|
43
|
+
Change License: MIT
|
|
44
|
+
|
|
45
|
+
For information about alternative licensing arrangements for the Licensed Work,
|
|
46
|
+
contact VIBES DEV LLC through https://vibes.dev.
|
|
47
|
+
|
|
48
|
+
Notice
|
|
49
|
+
|
|
50
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
51
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
52
|
+
under an Open Source License, as stated in this License.
|
|
53
|
+
|
|
54
|
+
-----------------------------------------------------------------------------
|
|
55
|
+
|
|
56
|
+
Business Source License 1.1
|
|
57
|
+
|
|
58
|
+
License text copyright © 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
59
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
60
|
+
|
|
61
|
+
Terms
|
|
62
|
+
|
|
63
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
64
|
+
works, redistribute, and make non-production use of the Licensed Work. The
|
|
65
|
+
Licensor may make an Additional Use Grant, above, permitting limited
|
|
66
|
+
production use.
|
|
67
|
+
|
|
68
|
+
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
69
|
+
available distribution of a specific version of the Licensed Work under this
|
|
70
|
+
License, whichever comes first, the Licensor hereby grants you rights under
|
|
71
|
+
the terms of the Change License, and the rights granted in the paragraph
|
|
72
|
+
above terminate.
|
|
73
|
+
|
|
74
|
+
If your use of the Licensed Work does not comply with the requirements
|
|
75
|
+
currently in effect as described in this License, you must purchase a
|
|
76
|
+
commercial license from the Licensor, its affiliated entities, or authorized
|
|
77
|
+
resellers, or you must refrain from using the Licensed Work.
|
|
78
|
+
|
|
79
|
+
All copies of the original and modified Licensed Work, and derivative works
|
|
80
|
+
of the Licensed Work, are subject to this License. This License applies
|
|
81
|
+
separately for each version of the Licensed Work and the Change Date may vary
|
|
82
|
+
for each version of the Licensed Work released by Licensor.
|
|
83
|
+
|
|
84
|
+
You must conspicuously display this License on each original or modified copy
|
|
85
|
+
of the Licensed Work. If you receive the Licensed Work in original or
|
|
86
|
+
modified form from a third party, the terms and conditions set forth in this
|
|
87
|
+
License apply to your use of that work.
|
|
88
|
+
|
|
89
|
+
Any use of the Licensed Work in violation of this License will automatically
|
|
90
|
+
terminate your rights under this License for the current and all other
|
|
91
|
+
versions of the Licensed Work.
|
|
92
|
+
|
|
93
|
+
This License does not grant you any right in any trademark or logo of
|
|
94
|
+
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
95
|
+
Licensor as expressly required by this License).
|
|
96
|
+
|
|
97
|
+
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
98
|
+
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
99
|
+
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
100
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
101
|
+
TITLE.
|
|
102
|
+
|
|
103
|
+
MariaDB hereby grants you permission to use this License’s text to license
|
|
104
|
+
your works, and to refer to it using the trademark “Business Source License”,
|
|
105
|
+
as long as you comply with the Covenants of Licensor below.
|
|
106
|
+
|
|
107
|
+
Covenants of Licensor
|
|
108
|
+
|
|
109
|
+
In consideration of the right to use this License’s text and the “Business
|
|
110
|
+
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
111
|
+
other recipients of the licensed work to be provided by Licensor:
|
|
112
|
+
|
|
113
|
+
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
114
|
+
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
115
|
+
where “compatible” means that software provided under the Change License can
|
|
116
|
+
be included in a program with software provided under GPL Version 2.0 or a
|
|
117
|
+
later version. Licensor may specify additional Change Licenses without
|
|
118
|
+
limitation.
|
|
119
|
+
|
|
120
|
+
2. To either: (a) specify an additional grant of rights to use that does not
|
|
121
|
+
impose any additional restriction on the right granted in this License, as
|
|
122
|
+
the Additional Use Grant; or (b) insert the text “None”.
|
|
123
|
+
|
|
124
|
+
3. To specify a Change Date.
|
|
125
|
+
|
|
126
|
+
4. Not to modify this License in any other way.
|
package/README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ComfyUI integration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Compose `@vibesdotdev/integrations-comfyui/ai/plugin` after the AI provider
|
|
4
|
+
substrate on a consumer host. Start ComfyUI separately; this package neither
|
|
5
|
+
starts nor owns the server. It uses unauthenticated HTTP, so select remote
|
|
6
|
+
origins only after an explicit trust decision.
|
|
7
|
+
|
|
8
|
+
The root and `./ai` export contracts and descriptors. Resolve `ai/provider`
|
|
9
|
+
(`comfyui`), `ai/spec` (`comfyui-prompt`), discovery and recommendations
|
|
10
|
+
through the runtime. Use the resolved provider's `generate` method for a total
|
|
11
|
+
deadline that cancels submission HTTP work. It delegates to the AI semantic
|
|
12
|
+
client and `ai/generation`. Calling `getVibesAIClient(runtime).image(...)`
|
|
13
|
+
directly currently bypasses that submission cancellation wrapper. Implementations remain available on explicit
|
|
14
|
+
`./ai/providers/comfyui/*` and `./ai/specs/comfyui-prompt/*` subpaths.
|
|
15
|
+
|
|
16
|
+
Configure the `integrations.comfyui` manifest:
|
|
17
|
+
|
|
18
|
+
| Field | Default |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| baseUrl | http://localhost:8188 |
|
|
21
|
+
| timeoutMs | 60000 |
|
|
22
|
+
| pollDelayMs | 1000 |
|
|
23
|
+
| clientId | absent |
|
|
24
|
+
|
|
25
|
+
The workflow honors prompt, negative prompt, checkpoint, dimensions, batch
|
|
26
|
+
count, steps, seed and guidance scale. Completion returns encoded `/view`
|
|
27
|
+
image URLs; image bytes remain on the server. Runtime lifecycle waits own the
|
|
28
|
+
provider generation deadline and cancellation. Hosts dispose their runtimes.
|
|
29
|
+
The manifest's optional `clientId` becomes `client_id` in submissions; a
|
|
30
|
+
provider connection can override it.
|
|
31
|
+
|
|
32
|
+
Only a refused TCP connection means the optional service is absent. HTTP,
|
|
33
|
+
schema and transport failures propagate; graph rejection, missing prompt IDs,
|
|
34
|
+
failed execution and missing images have typed refusals. See [SPEC.md](SPEC.md)
|
|
35
|
+
for the complete code/reason table.
|
|
36
|
+
|
|
37
|
+
Run `bun run check`, `bun run test` and `bun run build`. Typechecking covers
|
|
38
|
+
source and tests; `tsconfig.build.json` emits production files only. The unit's
|
|
39
|
+
`vibes.config.ts` declares canonical rules and lint checks. Runtime tests compose
|
|
40
|
+
real owner plugins and use disposable memory storage; only HTTP is replaced.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,cAAc,0CAA0C,CAAC;AACzD,cAAc,uBAAuB,CAAC"}
|
package/dist/ai/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai/index.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,cAAc,0CAA0C,CAAC;AACzD,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type RuntimePlugin } from '@vibesdotdev/kernel';
|
|
2
|
+
/** Consumer-only runtime boundary. Compose from the explicit ./ai/plugin subpath. */
|
|
3
|
+
export declare function createComfyuiAIPlugin(): RuntimePlugin;
|
|
4
|
+
export declare const comfyuiAIPlugin: RuntimePlugin;
|
|
5
|
+
export default comfyuiAIPlugin;
|
|
6
|
+
//# sourceMappingURL=provider.consumer.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.consumer.plugin.d.ts","sourceRoot":"","sources":["../../src/ai/provider.consumer.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,aAAa,EAAqB,MAAM,qBAAqB,CAAC;AAwElH,qFAAqF;AACrF,wBAAgB,qBAAqB,IAAI,aAAa,CA6DrD;AAED,eAAO,MAAM,eAAe,EAAE,aAAuC,CAAC;AACtE,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { CapabilityError, createRuntimePlugin } from '@vibesdotdev/kernel';
|
|
2
|
+
import { AI_PROVIDER_SCHEMA_KIND } from '@vibesdotdev/ai/providers-runtime';
|
|
3
|
+
import { AI_PROVIDER_RECOMMENDATION_KIND, createAIProviderRecommendationDescriptor } from '@vibesdotdev/ai/recommendations';
|
|
4
|
+
import comfyuiPromptDescriptor from "./specs/comfyui-prompt/comfyui-prompt.spec.descriptor.js";
|
|
5
|
+
import comfyuiProviderDescriptor from "./providers/local/image/comfyui/provider.comfyui.descriptor.js";
|
|
6
|
+
import comfyuiProviderConfigDescriptor from "./providers/local/image/comfyui/config/config.comfyui.descriptor.js";
|
|
7
|
+
import { comfyUIConnectionSchema } from "./providers/local/image/comfyui/config/schemas/index.js";
|
|
8
|
+
import { loadComfyuiSettings } from "../config/comfyui.config.descriptor.js";
|
|
9
|
+
import comfyuiSettingsDescriptor from "../config/comfyui.config.descriptor.js";
|
|
10
|
+
/** Loaders resolve provider HTTP through the runtime that is resolving them. */
|
|
11
|
+
function resolvingRuntime(owner) {
|
|
12
|
+
if (owner)
|
|
13
|
+
return owner;
|
|
14
|
+
throw new CapabilityError('ComfyUI loaders need the resolving runtime', 'UNAVAILABLE', {
|
|
15
|
+
reason: 'comfyui-runtime-missing', retryable: false
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const providerDetectionDescriptor = {
|
|
19
|
+
id: 'comfyui',
|
|
20
|
+
kind: 'ai/provider-detection',
|
|
21
|
+
providerId: 'comfyui',
|
|
22
|
+
description: `System detection loader for ${'comfyui'}`
|
|
23
|
+
};
|
|
24
|
+
const providerRecommendationDescriptor = createAIProviderRecommendationDescriptor({
|
|
25
|
+
id: 'comfyui',
|
|
26
|
+
providerType: 'comfyui',
|
|
27
|
+
displayName: 'ComfyUI',
|
|
28
|
+
name: 'ComfyUI provider recommendation',
|
|
29
|
+
description: 'Scores locally discovered ComfyUI checkpoints',
|
|
30
|
+
hardware: ['consumer'],
|
|
31
|
+
enabled: true,
|
|
32
|
+
tags: ['comfyui', 'local', 'image']
|
|
33
|
+
});
|
|
34
|
+
const providerDocsDescriptor = {
|
|
35
|
+
kind: 'docs/topic',
|
|
36
|
+
id: 'ai.providers.comfyui',
|
|
37
|
+
title: 'ComfyUI provider',
|
|
38
|
+
summary: 'Generate images through a local ComfyUI workflow server.',
|
|
39
|
+
body: {
|
|
40
|
+
type: 'markdown',
|
|
41
|
+
sourceType: 'raw',
|
|
42
|
+
source: '# ComfyUI\n\nRun ComfyUI on this machine. Detection probes the local HTTP service with a bounded timeout and never returns secret material. Generation resolves `ai/generation`. Configure baseUrl, clientId, timeoutMs and pollDelayMs through the integrations.comfyui manifest. The runtime owns recommendation instances and disposal. Resolved provider generation forwards its lifecycle deadline and cancellation to the submission transport; direct AI semantic-client calls bypass this wrapper. Generation returns encoded /view URLs; remote origins require a host trust decision. HTTP, malformed responses, rejected graphs, missing prompt IDs, failed execution and missing images propagate typed refusals; only refused TCP connections confirm service absence. Consumer hardware constraints are explicit on the provider and recommendation descriptors.\n'
|
|
43
|
+
},
|
|
44
|
+
tags: ['ai', 'providers', 'comfyui', 'local', 'image'],
|
|
45
|
+
parent: 'ai.providers',
|
|
46
|
+
order: 51,
|
|
47
|
+
surfaces: ['cli', 'web', 'in-app'],
|
|
48
|
+
hardware: ['consumer'],
|
|
49
|
+
enabled: true
|
|
50
|
+
};
|
|
51
|
+
const providerSchemaDescriptor = {
|
|
52
|
+
id: 'integrations/comfyui/ai/comfyui',
|
|
53
|
+
kind: AI_PROVIDER_SCHEMA_KIND,
|
|
54
|
+
providerId: 'comfyui',
|
|
55
|
+
schemaKind: 'connection',
|
|
56
|
+
sourcePath: 'integrations/comfyui/src/ai/providers/local/image/comfyui/config/schemas/index.ts',
|
|
57
|
+
version: '0.1.0-rc.0',
|
|
58
|
+
name: 'ComfyUI',
|
|
59
|
+
description: 'Local node-based image generation platform with advanced workflows. '
|
|
60
|
+
};
|
|
61
|
+
/** Consumer-only runtime boundary. Compose from the explicit ./ai/plugin subpath. */
|
|
62
|
+
export function createComfyuiAIPlugin() {
|
|
63
|
+
return createRuntimePlugin({
|
|
64
|
+
id: 'integrations-comfyui/ai',
|
|
65
|
+
name: 'Comfyui AI Integration',
|
|
66
|
+
description: 'Registers Comfyui-owned AI descriptors and lazy implementations',
|
|
67
|
+
dependencies: ['ai/providers'],
|
|
68
|
+
descriptors: [comfyuiSettingsDescriptor],
|
|
69
|
+
onRegister(runtime) {
|
|
70
|
+
runtime.registerDescriptor('ai/provider', comfyuiProviderDescriptor);
|
|
71
|
+
runtime.registerDescriptor('config/manifest', comfyuiProviderConfigDescriptor);
|
|
72
|
+
runtime.registerDescriptor('ai/provider-detection', providerDetectionDescriptor);
|
|
73
|
+
runtime.registerDescriptor(AI_PROVIDER_SCHEMA_KIND, providerSchemaDescriptor);
|
|
74
|
+
runtime.registerDescriptor(AI_PROVIDER_RECOMMENDATION_KIND, providerRecommendationDescriptor);
|
|
75
|
+
runtime.registerDescriptor('ai/spec', comfyuiPromptDescriptor);
|
|
76
|
+
if (runtime.hasKind('docs/topic'))
|
|
77
|
+
runtime.registerDescriptor('docs/topic', providerDocsDescriptor);
|
|
78
|
+
},
|
|
79
|
+
onActivate(runtime) {
|
|
80
|
+
runtime.registerLoader('ai/provider', 'comfyui', async () => ({
|
|
81
|
+
meta: { id: 'comfyui', kind: 'ai/provider', priority: 0 },
|
|
82
|
+
impl: (await import("./providers/comfyui/comfyui.provider.impl.js")).ComfyUIProviderType
|
|
83
|
+
}));
|
|
84
|
+
runtime.registerLoader('ai/provider-detection', 'comfyui', async (owner) => ({
|
|
85
|
+
meta: { id: 'comfyui', kind: 'ai/provider-detection', priority: 0 },
|
|
86
|
+
impl: {
|
|
87
|
+
detect: async () => (await import("./providers/comfyui/detection/system.js"))
|
|
88
|
+
.detectComfyUISystem(resolvingRuntime(owner))
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
runtime.registerLoader(AI_PROVIDER_SCHEMA_KIND, providerSchemaDescriptor.id, async () => ({
|
|
92
|
+
meta: { id: providerSchemaDescriptor.id, kind: AI_PROVIDER_SCHEMA_KIND, priority: 0 },
|
|
93
|
+
impl: {
|
|
94
|
+
connectionSchema: comfyUIConnectionSchema,
|
|
95
|
+
metadata: {
|
|
96
|
+
name: 'ComfyUI',
|
|
97
|
+
description: 'Local node-based image generation platform with advanced workflows. ',
|
|
98
|
+
category: 'local',
|
|
99
|
+
capabilities: ['image', 'connection'],
|
|
100
|
+
fields: []
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
104
|
+
runtime.registerLoader(AI_PROVIDER_RECOMMENDATION_KIND, providerRecommendationDescriptor.id, async () => ({
|
|
105
|
+
meta: {
|
|
106
|
+
id: providerRecommendationDescriptor.id,
|
|
107
|
+
kind: AI_PROVIDER_RECOMMENDATION_KIND,
|
|
108
|
+
priority: providerRecommendationDescriptor.priority ?? 0
|
|
109
|
+
},
|
|
110
|
+
impl: new (await import("./providers/comfyui/recommendations.js")).ComfyUIRecommendation()
|
|
111
|
+
}));
|
|
112
|
+
runtime.registerLoader('ai/spec', comfyuiPromptDescriptor.id, async (owner) => {
|
|
113
|
+
const { ComfyUIPromptSpec } = await import("./specs/comfyui-prompt/comfyui-prompt.spec.impl.js");
|
|
114
|
+
const resolving = resolvingRuntime(owner);
|
|
115
|
+
return { impl: new ComfyUIPromptSpec(resolving, {}, await loadComfyuiSettings(resolving)) };
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export const comfyuiAIPlugin = createComfyuiAIPlugin();
|
|
121
|
+
export default comfyuiAIPlugin;
|
|
122
|
+
//# sourceMappingURL=provider.consumer.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.consumer.plugin.js","sourceRoot":"","sources":["../../src/ai/provider.consumer.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAyC,MAAM,qBAAqB,CAAC;AAClH,OAAO,EACN,uBAAuB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACN,+BAA+B,EAC/B,wCAAwC,EACxC,MAAM,iCAAiC,CAAC;AAIzC,OAAO,uBAAuB,MAAM,0DAA0D,CAAC;AAC/F,OAAO,yBAAyB,MAAM,gEAAgE,CAAC;AACvG,OAAO,+BAA+B,MAAM,qEAAqE,CAAC;AAClH,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,wC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,EAAE,IAAI,CAAC,MAAM,MAAM,CAAC,wCAAwC,CAAC,CAAC,CAAC,qBAAqB,EAAE;aAC1F,CAAC,CACF,CAAC;YACF,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,uBAAuB,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;gBAC7E,MAAM,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,oDAAoD,CAAC,CAAC;gBACjG,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAC1C,OAAO,EAAE,IAAI,EAAE,IAAI,iBAAiB,CAAC,SAAS,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;YAC7F,CAAC,CAAC,CAAC;QACJ,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAkB,qBAAqB,EAAE,CAAC;AACtE,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.plugin.d.ts","sourceRoot":"","sources":["../../src/ai/provider.plugin.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.plugin.js","sourceRoot":"","sources":["../../src/ai/provider.plugin.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AIProviderTypeContext, AIProviderTypeInterface, ConnectionValidationResult, DetectedProviderInstance, ModelRecommendation, ProviderGenerateOptions, ProviderGenerateResult, ProviderHealthCheckResult } from '@vibesdotdev/ai/interfaces/provider-type';
|
|
2
|
+
import type { GenerationRequest } from '@vibesdotdev/ai/interfaces/adapter';
|
|
3
|
+
import type { AIModelDescriptor, Modality } from '@vibesdotdev/ai/models/schemas';
|
|
4
|
+
import type { AIProviderDescriptor } from '@vibesdotdev/ai/providers-runtime/schemas/provider-descriptor';
|
|
5
|
+
import type { AIProviderTypeDescriptor } from '@vibesdotdev/ai/providers-runtime/schemas/type-descriptor';
|
|
6
|
+
export declare class ComfyUIProviderType implements AIProviderTypeInterface {
|
|
7
|
+
readonly descriptor: AIProviderTypeDescriptor;
|
|
8
|
+
private readonly context;
|
|
9
|
+
constructor(descriptor: AIProviderTypeDescriptor, context: AIProviderTypeContext);
|
|
10
|
+
generate<T extends Modality>(provider: AIProviderDescriptor, model: AIModelDescriptor, request: GenerationRequest<T>, options?: ProviderGenerateOptions): Promise<ProviderGenerateResult<T>>;
|
|
11
|
+
detectInstalled(): Promise<DetectedProviderInstance[]>;
|
|
12
|
+
recommendModels(useCase: string): Promise<ModelRecommendation[]>;
|
|
13
|
+
checkHealth(config: Parameters<AIProviderTypeInterface['checkHealth']>[0], options?: {
|
|
14
|
+
timeout?: number;
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
}): Promise<ProviderHealthCheckResult>;
|
|
17
|
+
validateConnection(config: Parameters<AIProviderTypeInterface['validateConnection']>[0]): Promise<ConnectionValidationResult>;
|
|
18
|
+
dispose(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=comfyui.provider.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comfyui.provider.impl.d.ts","sourceRoot":"","sources":["../../../../src/ai/providers/comfyui/comfyui.provider.impl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,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/client';
|
|
2
|
+
import { getVibesAIClient } from '@vibesdotdev/ai/client';
|
|
3
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
4
|
+
import { ImageGenerationRequestSchema } from '@vibesdotdev/ai/generation/execution/schemas/request';
|
|
5
|
+
import { ComfyUIConnectionSchema, ComfyUIHealthOptionsSchema, ComfyUISystemStatsSchema } from "../../../schemas/comfyui.js";
|
|
6
|
+
import { readComfyUIResponse } from "./http.js";
|
|
7
|
+
import { loadComfyuiSettings } from "../../../config/comfyui.config.descriptor.js";
|
|
8
|
+
import { detectComfyUISystem } from "./detection/system.js";
|
|
9
|
+
export class ComfyUIProviderType {
|
|
10
|
+
descriptor;
|
|
11
|
+
context;
|
|
12
|
+
constructor(descriptor, context) {
|
|
13
|
+
this.descriptor = descriptor;
|
|
14
|
+
this.context = context;
|
|
15
|
+
}
|
|
16
|
+
async generate(provider, model, request, options) {
|
|
17
|
+
const parsed = ImageGenerationRequestSchema.safeParse(request);
|
|
18
|
+
if (!parsed.success) {
|
|
19
|
+
throw new CapabilityError('ComfyUI requires an image generation request', 'INVALID_INPUT', {
|
|
20
|
+
reason: 'comfyui-modality-unsupported', retryable: false, cause: parsed.error
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const ai = await getVibesAIClient(this.context.runtime);
|
|
24
|
+
const settings = await loadComfyuiSettings(this.context.runtime);
|
|
25
|
+
const connection = ComfyUIConnectionSchema.parse({
|
|
26
|
+
baseUrl: settings.baseUrl, timeout: settings.timeoutMs, ...provider.configuration
|
|
27
|
+
});
|
|
28
|
+
const response = await this.context.runtime.lifecycle.wait((signal) => ai.image({
|
|
29
|
+
...parsed.data, providerId: provider.id, modelId: model.id,
|
|
30
|
+
provider: { id: provider.id }, model: { id: model.id }
|
|
31
|
+
}, {
|
|
32
|
+
...options, signal
|
|
33
|
+
}), {
|
|
34
|
+
timeoutMs: options?.timeoutMs ?? connection.timeout,
|
|
35
|
+
signal: request.signal,
|
|
36
|
+
reason: 'comfyui generation'
|
|
37
|
+
});
|
|
38
|
+
// SAFETY: ImageGenerationRequestSchema established the image request contract for T.
|
|
39
|
+
return { response, adapterId: 'ai/generation', generationMethod: 'direct' };
|
|
40
|
+
}
|
|
41
|
+
async detectInstalled() {
|
|
42
|
+
const detected = await detectComfyUISystem(this.context.runtime);
|
|
43
|
+
return detected
|
|
44
|
+
? [{ name: detected.name, source: 'system', config: detected.configuration ?? {} }]
|
|
45
|
+
: [];
|
|
46
|
+
}
|
|
47
|
+
async recommendModels(useCase) {
|
|
48
|
+
const detected = await detectComfyUISystem(this.context.runtime);
|
|
49
|
+
return (detected?.models ?? []).map((name, index) => ({
|
|
50
|
+
modelId: name,
|
|
51
|
+
modelName: name,
|
|
52
|
+
score: 90 - index,
|
|
53
|
+
reason: 'Installed in the detected ComfyUI checkpoint catalog',
|
|
54
|
+
capabilities: ['image'],
|
|
55
|
+
useCaseFit: useCase === 'images' ? 98 : 90 - index
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
async checkHealth(config, options) {
|
|
59
|
+
const start = Date.now();
|
|
60
|
+
const settings = await loadComfyuiSettings(this.context.runtime);
|
|
61
|
+
const connection = ComfyUIConnectionSchema.parse({
|
|
62
|
+
baseUrl: settings.baseUrl, timeout: settings.timeoutMs, clientId: settings.clientId, ...config
|
|
63
|
+
});
|
|
64
|
+
const probe = ComfyUIHealthOptionsSchema.parse(options ?? {});
|
|
65
|
+
const baseUrl = connection.baseUrl.replace(/\/+$/, '');
|
|
66
|
+
await this.context.runtime.lifecycle.wait(async (signal) => {
|
|
67
|
+
try {
|
|
68
|
+
const response = await fetchAIProvider(this.context, `${baseUrl}/system_stats`, { signal });
|
|
69
|
+
return await readComfyUIResponse(response, ComfyUISystemStatsSchema);
|
|
70
|
+
}
|
|
71
|
+
catch (cause) {
|
|
72
|
+
if (cause instanceof CapabilityError)
|
|
73
|
+
throw cause;
|
|
74
|
+
if (cause instanceof Error && cause.name === 'AbortError')
|
|
75
|
+
throw cause;
|
|
76
|
+
throw new CapabilityError('ComfyUI request failed', 'UNAVAILABLE', {
|
|
77
|
+
reason: 'comfyui-request-failed', retryable: false, cause
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}, {
|
|
81
|
+
timeoutMs: probe.timeout ?? connection.timeout,
|
|
82
|
+
reason: 'comfyui health probe',
|
|
83
|
+
signal: probe.signal
|
|
84
|
+
});
|
|
85
|
+
return {
|
|
86
|
+
healthy: true, latencyMs: Date.now() - start,
|
|
87
|
+
message: 'ComfyUI is running', checkedAt: new Date(), availableModalities: ['image']
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
async validateConnection(config) {
|
|
91
|
+
const parsed = ComfyUIConnectionSchema.safeParse(config);
|
|
92
|
+
if (!parsed.success) {
|
|
93
|
+
return { valid: false, errors: parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`) };
|
|
94
|
+
}
|
|
95
|
+
const url = new URL(parsed.data.baseUrl);
|
|
96
|
+
const local = ['localhost', '127.0.0.1', '::1', '[::1]'].includes(url.hostname);
|
|
97
|
+
return {
|
|
98
|
+
valid: true,
|
|
99
|
+
warnings: local ? undefined : ['Remote ComfyUI endpoints require an explicit trust decision by the host']
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
async dispose() { }
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=comfyui.provider.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comfyui.provider.impl.js","sourceRoot":"","sources":["../../../../src/ai/providers/comfyui/comfyui.provider.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAe3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,EACN,uBAAuB,EAAE,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,yEAAyE,CAAC;SACzG,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO,KAAmB,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/providers/comfyui/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/providers/comfyui/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DetectedProvider } from '@vibesdotdev/ai/providers-runtime/client/types';
|
|
2
|
+
import { type VibesRuntime } from '@vibesdotdev/kernel';
|
|
3
|
+
export { ComfyUIConnectionSchema as DetectionConfigSchema } from '../../../../schemas/comfyui.ts';
|
|
4
|
+
/** A refused TCP connection confirms absence. HTTP and malformed data are failures. */
|
|
5
|
+
export declare function detectComfyUISystem(runtime: VibesRuntime): Promise<DetectedProvider | null>;
|
|
6
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../../src/ai/providers/comfyui/detection/system.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAEvF,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAUjF,OAAO,EAAE,uBAAuB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAElG,uFAAuF;AACvF,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAwCjG"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { fetchAIProvider } from '@vibesdotdev/ai/providers-runtime/client';
|
|
2
|
+
import { getLogger } from '@vibesdotdev/logging';
|
|
3
|
+
import { CapabilityError, settle } from '@vibesdotdev/kernel';
|
|
4
|
+
import { loadComfyuiSettings } from "../../../../config/comfyui.config.descriptor.js";
|
|
5
|
+
import { ComfyUIAbsentServiceSchema, ComfyUICheckpointsSchema, ComfyUIConnectionSchema, ComfyUISystemStatsSchema } from "../../../../schemas/comfyui.js";
|
|
6
|
+
import { readComfyUIResponse } from "../http.js";
|
|
7
|
+
export { ComfyUIConnectionSchema as DetectionConfigSchema } from "../../../../schemas/comfyui.js";
|
|
8
|
+
/** A refused TCP connection confirms absence. HTTP and malformed data are failures. */
|
|
9
|
+
export async function detectComfyUISystem(runtime) {
|
|
10
|
+
const settings = await loadComfyuiSettings(runtime);
|
|
11
|
+
const connection = ComfyUIConnectionSchema.parse({
|
|
12
|
+
baseUrl: settings.baseUrl, clientId: settings.clientId, timeout: settings.timeoutMs
|
|
13
|
+
});
|
|
14
|
+
const baseUrl = connection.baseUrl.replace(/\/+$/, '');
|
|
15
|
+
let confirmed = false;
|
|
16
|
+
const probe = await settle(() => runtime.lifecycle.wait(async (signal) => {
|
|
17
|
+
await readComfyUIResponse(await fetchAIProvider({ runtime }, `${baseUrl}/system_stats`, { signal }), ComfyUISystemStatsSchema);
|
|
18
|
+
confirmed = true;
|
|
19
|
+
const checkpoints = await readComfyUIResponse(await fetchAIProvider({ runtime }, `${baseUrl}/object_info/CheckpointLoaderSimple`, { signal }), ComfyUICheckpointsSchema);
|
|
20
|
+
return { models: checkpoints.CheckpointLoaderSimple.input.required.ckpt_name[0] };
|
|
21
|
+
}, { timeoutMs: connection.timeout, reason: 'comfyui discovery' }));
|
|
22
|
+
if (!probe.ok) {
|
|
23
|
+
const { cause } = probe;
|
|
24
|
+
if (!confirmed && ComfyUIAbsentServiceSchema.safeParse(cause).success) {
|
|
25
|
+
getLogger('integrations-comfyui', runtime).child('detection').debug('ComfyUI service is absent', { error: cause });
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (cause instanceof CapabilityError)
|
|
29
|
+
throw cause;
|
|
30
|
+
throw new CapabilityError('ComfyUI discovery failed', 'UNAVAILABLE', {
|
|
31
|
+
reason: 'comfyui-request-failed', retryable: false, cause
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const probed = probe.value;
|
|
35
|
+
return {
|
|
36
|
+
providerType: 'comfyui',
|
|
37
|
+
name: 'ComfyUI (Local)',
|
|
38
|
+
description: 'Local node-based image generation server',
|
|
39
|
+
status: 'running',
|
|
40
|
+
models: probed.models,
|
|
41
|
+
configuration: connection
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../../../src/ai/providers/comfyui/detection/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,EAAqB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EACN,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,OAAO,EAAE,uBAAuB,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAElG,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAAqB;IAC9D,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACpD,MAAM,UAAU,GAAG,uBAAuB,CAAC,KAAK,CAAC;QAChD,OAAO,EAAE,QAAQ,CAAC,OAAO,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AAC,CAAC;YACnH,OAAO,IAAI,CAAC;QACb,CAAC;QACD,IAAI,KAAK,YAAY,eAAe;YAAE,MAAM,KAAK,CAAC;QAClD,MAAM,IAAI,eAAe,CAAC,0BAA0B,EAAE,aAAa,EAAE;YACpE,MAAM,EAAE,wBAAwB,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK;SACzD,CAAC,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC;IAE3B,OAAO;QACN,YAAY,EAAE,SAAS;QACvB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,0CAA0C;QACvD,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,aAAa,EAAE,UAAU;KACzB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/ai/providers/comfyui/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,sFAAsF;AACtF,wBAAsB,mBAAmB,CAAC,CAAC,EAC1C,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,CAAC,CAAC,CAyBZ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { CapabilityError } from '@vibesdotdev/kernel';
|
|
3
|
+
/** Public messages contain only contract facts; original exceptions remain causes. */
|
|
4
|
+
export async function readComfyUIResponse(response, schema) {
|
|
5
|
+
if (!response.ok) {
|
|
6
|
+
throw new CapabilityError('ComfyUI returned an unsuccessful HTTP status', 'UNAVAILABLE', {
|
|
7
|
+
reason: 'comfyui-http-failed', retryable: false, details: { status: response.status }
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
let payload;
|
|
12
|
+
try {
|
|
13
|
+
payload = await response.text();
|
|
14
|
+
}
|
|
15
|
+
catch (cause) {
|
|
16
|
+
if (cause instanceof CapabilityError)
|
|
17
|
+
throw cause;
|
|
18
|
+
if (cause instanceof Error && cause.name === 'AbortError')
|
|
19
|
+
throw cause;
|
|
20
|
+
throw new CapabilityError('ComfyUI request failed', 'UNAVAILABLE', {
|
|
21
|
+
reason: 'comfyui-request-failed', retryable: false, cause
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return schema.parse(JSON.parse(payload));
|
|
25
|
+
}
|
|
26
|
+
catch (cause) {
|
|
27
|
+
if (cause instanceof CapabilityError)
|
|
28
|
+
throw cause;
|
|
29
|
+
if (cause instanceof Error && cause.name === 'AbortError')
|
|
30
|
+
throw cause;
|
|
31
|
+
throw new CapabilityError('ComfyUI returned an invalid response', 'INVALID_INPUT', {
|
|
32
|
+
reason: 'comfyui-response-invalid', retryable: false, cause
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../../src/ai/providers/comfyui/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,sFAAsF;AACtF,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,QAAkB,EAClB,MAAoB;IAEpB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAClB,MAAM,IAAI,eAAe,CAAC,8CAA8C,EAAE,aAAa,EAAE;YACxF,MAAM,EAAE,qBAAqB,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE;SACrF,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,CAAC;QACJ,IAAI,OAAe,CAAC;QACpB,IAAI,CAAC;YACJ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