@openclaw/crabline 0.1.12 → 0.1.13
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 +38 -11
- package/dist/src/cli/program.js +17 -2
- package/dist/src/cli/program.js.map +1 -1
- package/dist/src/index.d.ts +12 -10
- package/dist/src/index.js +6 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/openclaw/artifact-generation.d.ts +5 -9
- package/dist/src/openclaw/artifact-generation.js +41 -69
- package/dist/src/openclaw/artifact-generation.js.map +1 -1
- package/dist/src/openclaw/bridges/discord.d.ts +1 -0
- package/dist/src/openclaw/bridges/discord.js +149 -0
- package/dist/src/openclaw/bridges/discord.js.map +1 -0
- package/dist/src/openclaw/bridges/matrix.js +1 -1
- package/dist/src/openclaw/bridges/matrix.js.map +1 -1
- package/dist/src/openclaw/bridges/mattermost.js +1 -1
- package/dist/src/openclaw/bridges/mattermost.js.map +1 -1
- package/dist/src/openclaw/bridges/signal.js +1 -1
- package/dist/src/openclaw/bridges/signal.js.map +1 -1
- package/dist/src/openclaw/bridges/slack.js +1 -1
- package/dist/src/openclaw/bridges/slack.js.map +1 -1
- package/dist/src/openclaw/bridges/telegram.js +1 -1
- package/dist/src/openclaw/bridges/telegram.js.map +1 -1
- package/dist/src/openclaw/bridges/whatsapp.js +1 -1
- package/dist/src/openclaw/bridges/whatsapp.js.map +1 -1
- package/dist/src/openclaw/bridges/zalo.js +1 -1
- package/dist/src/openclaw/bridges/zalo.js.map +1 -1
- package/dist/src/openclaw/outbound-contract.js +3 -0
- package/dist/src/openclaw/outbound-contract.js.map +1 -1
- package/dist/src/openclaw/{smoke-lock.d.ts → provider-readiness-lock.d.ts} +7 -7
- package/dist/src/openclaw/{smoke-lock.js → provider-readiness-lock.js} +122 -260
- package/dist/src/openclaw/provider-readiness-lock.js.map +1 -0
- package/dist/src/openclaw/shared.d.ts +9 -17
- package/dist/src/openclaw/shared.js +5 -6
- package/dist/src/openclaw/shared.js.map +1 -1
- package/dist/src/openclaw.d.ts +3 -5
- package/dist/src/openclaw.js +22 -20
- package/dist/src/openclaw.js.map +1 -1
- package/dist/src/servers/discord.d.ts +40 -0
- package/dist/src/servers/discord.js +842 -0
- package/dist/src/servers/discord.js.map +1 -0
- package/dist/src/servers/index.d.ts +10 -4
- package/dist/src/servers/index.js +4 -0
- package/dist/src/servers/index.js.map +1 -1
- package/dist/src/servers/slack.js +11 -3
- package/dist/src/servers/slack.js.map +1 -1
- package/dist/src/servers/telegram.js +51 -2
- package/dist/src/servers/telegram.js.map +1 -1
- package/dist/src/servers/whatsapp.d.ts +0 -1
- package/dist/src/servers/whatsapp.js +0 -1
- package/dist/src/servers/whatsapp.js.map +1 -1
- package/docs/channel-setup.md +66 -21
- package/package.json +1 -1
- package/dist/src/openclaw/smoke-lock.js.map +0 -1
package/dist/src/index.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export { resolveTelegramAdapterConfig } from "./providers/builtin/telegram.js";
|
|
2
2
|
export { resolveWhatsAppAdapterConfig } from "./providers/builtin/whatsapp.js";
|
|
3
|
+
export { startDiscordServer } from "./servers/discord.js";
|
|
3
4
|
export { startMattermostServer } from "./servers/mattermost.js";
|
|
4
5
|
export { startMatrixServer } from "./servers/matrix.js";
|
|
5
6
|
export { startSignalServer } from "./servers/signal.js";
|
|
6
|
-
export { startSlackServer
|
|
7
|
-
export { startTelegramServer
|
|
8
|
-
export { startWhatsAppServer
|
|
7
|
+
export { startSlackServer } from "./servers/slack.js";
|
|
8
|
+
export { startTelegramServer } from "./servers/telegram.js";
|
|
9
|
+
export { startWhatsAppServer } from "./servers/whatsapp.js";
|
|
9
10
|
export { startZaloServer } from "./servers/zalo.js";
|
|
10
|
-
export { CRABLINE_SERVER_CHANNELS,
|
|
11
|
-
export { createOpenClawCrablineAgentDelivery, createOpenClawCrablineChannelReportNotes, createOpenClawCrablineProviderBinding
|
|
11
|
+
export { CRABLINE_SERVER_CHANNELS, isCrablineServerChannel, startCrablineServer, } from "./servers/index.js";
|
|
12
|
+
export { createOpenClawCrablineAgentDelivery, createOpenClawCrablineChannelReportNotes, createOpenClawCrablineProviderBinding, createOpenClawCrablineInbound, createOpenClawCrablineOutboundFromRecorderEvent, OPENCLAW_CRABLINE_ARTIFACT_POINTER_PATH, OPENCLAW_CRABLINE_ARTIFACT_STORE_DIRECTORY, OPENCLAW_CRABLINE_CHANNEL_CAPABILITY_MATRIX_PATH, OPENCLAW_CRABLINE_PROVIDER_READINESS_PATH, OPENCLAW_CRABLINE_DEFAULT_CHANNEL, OPENCLAW_CRABLINE_MANIFEST_PATH, probeOpenClawCrablineProvider, resolveOpenClawCrablineChannel, resolveOpenClawCrablineChannelDriverSelection, runOpenClawCrablineProviderReadiness, startOpenClawCrablineAdapter, } from "./openclaw.js";
|
|
12
13
|
export { BUILTIN_ADAPTERS, FIXTURE_MODES, INBOUND_AUTHORS, INBOUND_NONCE_MODES, INBOUND_STRATEGIES, ManifestSchema, PROVIDER_PLATFORMS, ProviderConfigSchema, } from "./config/schema.js";
|
|
13
14
|
export { OPENCLAW_SUPPORT_CATALOG } from "./providers/catalog.js";
|
|
14
15
|
export { createRegistry } from "./providers/registry.js";
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mCAAmC,EACnC,wCAAwC,EACxC,qCAAqC,EACrC,6BAA6B,EAC7B,+CAA+C,EAC/C,uCAAuC,EACvC,0CAA0C,EAC1C,gDAAgD,EAChD,yCAAyC,EACzC,iCAAiC,EACjC,+BAA+B,EAC/B,6BAA6B,EAC7B,8BAA8B,EAC9B,6CAA6C,EAC7C,oCAAoC,EACpC,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { resolveTelegramAdapterConfig } from \"./providers/builtin/telegram.js\";\nexport { resolveWhatsAppAdapterConfig } from \"./providers/builtin/whatsapp.js\";\nexport { startDiscordServer } from \"./servers/discord.js\";\nexport { startMattermostServer } from \"./servers/mattermost.js\";\nexport { startMatrixServer } from \"./servers/matrix.js\";\nexport { startSignalServer } from \"./servers/signal.js\";\nexport { startSlackServer } from \"./servers/slack.js\";\nexport { startTelegramServer } from \"./servers/telegram.js\";\nexport { startWhatsAppServer } from \"./servers/whatsapp.js\";\nexport { startZaloServer } from \"./servers/zalo.js\";\nexport {\n CRABLINE_SERVER_CHANNELS,\n isCrablineServerChannel,\n startCrablineServer,\n} from \"./servers/index.js\";\nexport {\n createOpenClawCrablineAgentDelivery,\n createOpenClawCrablineChannelReportNotes,\n createOpenClawCrablineProviderBinding,\n createOpenClawCrablineInbound,\n createOpenClawCrablineOutboundFromRecorderEvent,\n OPENCLAW_CRABLINE_ARTIFACT_POINTER_PATH,\n OPENCLAW_CRABLINE_ARTIFACT_STORE_DIRECTORY,\n OPENCLAW_CRABLINE_CHANNEL_CAPABILITY_MATRIX_PATH,\n OPENCLAW_CRABLINE_PROVIDER_READINESS_PATH,\n OPENCLAW_CRABLINE_DEFAULT_CHANNEL,\n OPENCLAW_CRABLINE_MANIFEST_PATH,\n probeOpenClawCrablineProvider,\n resolveOpenClawCrablineChannel,\n resolveOpenClawCrablineChannelDriverSelection,\n runOpenClawCrablineProviderReadiness,\n startOpenClawCrablineAdapter,\n} from \"./openclaw.js\";\nexport {\n BUILTIN_ADAPTERS,\n FIXTURE_MODES,\n INBOUND_AUTHORS,\n INBOUND_NONCE_MODES,\n INBOUND_STRATEGIES,\n ManifestSchema,\n PROVIDER_PLATFORMS,\n ProviderConfigSchema,\n} from \"./config/schema.js\";\nexport { OPENCLAW_SUPPORT_CATALOG } from \"./providers/catalog.js\";\nexport { createRegistry } from \"./providers/registry.js\";\nexport type { CatalogEntry } from \"./providers/catalog.js\";\nexport type { Registry } from \"./providers/registry.js\";\nexport type { ServerRequestEvent } from \"./servers/http.js\";\nexport type { ServerEventObserver } from \"./servers/recorder.js\";\nexport type {\n DiscordServerManifest,\n StartedDiscordServer,\n StartDiscordServerParams,\n} from \"./servers/discord.js\";\nexport type {\n BuiltinAdapterId,\n FixtureDefinition,\n FixtureMode,\n ManifestDefinition,\n ProviderConfig,\n ProviderPlatform,\n} from \"./config/schema.js\";\nexport type {\n InboundEnvelope,\n NormalizedTarget,\n ProbeResult,\n ProviderAdapter,\n ProviderContext,\n ProviderSupportStatus,\n SendContext,\n SendResult,\n WaitContext,\n WatchContext,\n} from \"./providers/types.js\";\nexport type {\n MattermostServerManifest,\n StartedMattermostServer,\n StartMattermostServerParams,\n} from \"./servers/mattermost.js\";\nexport type {\n MatrixServerManifest,\n StartedMatrixServer,\n StartMatrixServerParams,\n} from \"./servers/matrix.js\";\nexport type {\n SignalServerManifest,\n StartedSignalServer,\n StartSignalServerParams,\n} from \"./servers/signal.js\";\nexport type {\n SlackServerManifest,\n StartedSlackServer,\n StartSlackServerParams,\n} from \"./servers/slack.js\";\nexport type {\n StartedTelegramServer,\n StartTelegramServerParams,\n TelegramServerManifest,\n} from \"./servers/telegram.js\";\nexport type {\n StartedWhatsAppServer,\n StartWhatsAppServerParams,\n WhatsAppBaileysMessage,\n WhatsAppServerManifest,\n} from \"./servers/whatsapp.js\";\nexport type {\n StartedZaloServer,\n StartZaloServerParams,\n ZaloServerManifest,\n} from \"./servers/zalo.js\";\nexport type {\n CrablineServerChannel,\n CrablineServerManifest,\n StartedCrablineServer,\n StartCrablineServerParams,\n} from \"./servers/index.js\";\nexport type {\n OpenClawCrablineAgentDelivery,\n OpenClawCrablineChannelDriverSelection,\n OpenClawCrablineProviderReadinessResult,\n OpenClawCrablineConversation,\n OpenClawCrablineGatewayBinding,\n OpenClawCrablineInbound,\n OpenClawCrablineInboundInput,\n OpenClawCrablineOutboundMessage,\n StartedOpenClawCrablineAdapter,\n StartOpenClawCrablineAdapterParams,\n} from \"./openclaw.js\";\n"]}
|
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
import type { CrablineServerManifest } from "../servers/index.js";
|
|
2
2
|
import { publishPrivateFileAtomically, syncParentDirectory } from "./private-file.js";
|
|
3
3
|
import { type OpenClawCrablineChannelDriverSelection } from "./shared.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { OpenClawCrablineProviderReadinessLock } from "./provider-readiness-lock.js";
|
|
5
5
|
type OpenClawCrablineArtifactPointerBase = {
|
|
6
6
|
capabilityMatrixPath: string;
|
|
7
7
|
generation: string;
|
|
8
8
|
manifestPath: string;
|
|
9
9
|
previousGeneration?: string;
|
|
10
10
|
providerReadinessArtifactPath: string;
|
|
11
|
-
smokeArtifactPath: string;
|
|
12
11
|
};
|
|
13
|
-
export type OpenClawCrablineArtifactPointer =
|
|
14
|
-
version: 1;
|
|
15
|
-
}) | (OpenClawCrablineArtifactPointerBase & {
|
|
12
|
+
export type OpenClawCrablineArtifactPointer = OpenClawCrablineArtifactPointerBase & {
|
|
16
13
|
recorderSnapshotPath: string | null;
|
|
17
|
-
version:
|
|
18
|
-
}
|
|
14
|
+
version: 3;
|
|
15
|
+
};
|
|
19
16
|
export type PublishedOpenClawCrablineArtifactGeneration = OpenClawCrablineArtifactPointer & {
|
|
20
17
|
pointerPath: string;
|
|
21
18
|
providerReadiness: Record<string, unknown>;
|
|
22
|
-
smoke: Record<string, unknown>;
|
|
23
19
|
warnings?: string[];
|
|
24
20
|
};
|
|
25
21
|
type PublishGenerationDependencies = {
|
|
@@ -38,7 +34,7 @@ type RecorderSnapshot = {
|
|
|
38
34
|
export declare function readOpenClawCrablineArtifactPointer(outputDir: string): Promise<OpenClawCrablineArtifactPointer | null>;
|
|
39
35
|
export declare function publishOpenClawCrablineArtifactGeneration(params: {
|
|
40
36
|
capabilityReport: unknown;
|
|
41
|
-
lock:
|
|
37
|
+
lock: OpenClawCrablineProviderReadinessLock;
|
|
42
38
|
manifest: CrablineServerManifest;
|
|
43
39
|
outputDir: string;
|
|
44
40
|
recorderSnapshot?: RecorderSnapshot;
|
|
@@ -3,18 +3,17 @@ import fs from "node:fs/promises";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { isDeepStrictEqual } from "node:util";
|
|
5
5
|
import { captureDirectoryIdentity, publishPrivateFileAtomically, removeSecuredPrivateDirectory, securePrivateDirectory, syncParentDirectory, } from "./private-file.js";
|
|
6
|
-
import { OPENCLAW_CRABLINE_ARTIFACT_POINTER_PATH, OPENCLAW_CRABLINE_ARTIFACT_STORE_DIRECTORY, OPENCLAW_CRABLINE_CHANNEL_CAPABILITY_MATRIX_PATH,
|
|
6
|
+
import { OPENCLAW_CRABLINE_ARTIFACT_POINTER_PATH, OPENCLAW_CRABLINE_ARTIFACT_STORE_DIRECTORY, OPENCLAW_CRABLINE_CHANNEL_CAPABILITY_MATRIX_PATH, OPENCLAW_CRABLINE_PROVIDER_READINESS_PATH, OPENCLAW_CRABLINE_MANIFEST_PATH, } from "./shared.js";
|
|
7
7
|
const GENERATION_NAME_PATTERN = /^generation-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
|
|
8
8
|
const STAGING_NAME_PATTERN = /^\.staging-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
|
|
9
9
|
const REMOVAL_TOMBSTONE_PATTERN = /^\.(.+)\.\d+\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.remove$/iu;
|
|
10
10
|
const CURRENT_GENERATION_READ_ATTEMPTS = 8;
|
|
11
11
|
function resolveProviderReadinessArtifactPath(selection) {
|
|
12
|
-
const readinessPath = selection.providerReadinessArtifactPath ?? selection.smokeArtifactPath;
|
|
13
12
|
if (selection.capabilityMatrixPath !== OPENCLAW_CRABLINE_CHANNEL_CAPABILITY_MATRIX_PATH ||
|
|
14
|
-
|
|
13
|
+
selection.providerReadinessArtifactPath !== OPENCLAW_CRABLINE_PROVIDER_READINESS_PATH) {
|
|
15
14
|
throw new Error("OpenClaw Crabline artifact selection paths are malformed.");
|
|
16
15
|
}
|
|
17
|
-
return
|
|
16
|
+
return selection.providerReadinessArtifactPath;
|
|
18
17
|
}
|
|
19
18
|
function isMissingPathError(error) {
|
|
20
19
|
return error.code === "ENOENT";
|
|
@@ -36,6 +35,20 @@ function isGeneratedManifest(value) {
|
|
|
36
35
|
const env = value.env;
|
|
37
36
|
const baseUrl = value.baseUrl;
|
|
38
37
|
switch (value.provider) {
|
|
38
|
+
case "discord":
|
|
39
|
+
return (hasNonEmptyStringFields(value, ["applicationId", "botToken", "botUserId"]) &&
|
|
40
|
+
hasNonEmptyStringFields(endpoints, [
|
|
41
|
+
"adminInboundUrl",
|
|
42
|
+
"apiRoot",
|
|
43
|
+
"gatewayBotUrl",
|
|
44
|
+
"gatewayUrl",
|
|
45
|
+
]) &&
|
|
46
|
+
hasNonEmptyStringFields(env, ["DISCORD_BOT_TOKEN"]) &&
|
|
47
|
+
endpoints.adminInboundUrl === `${baseUrl}/crabline/discord/inbound` &&
|
|
48
|
+
endpoints.apiRoot === `${baseUrl}/api` &&
|
|
49
|
+
endpoints.gatewayBotUrl === `${baseUrl}/api/v10/gateway/bot` &&
|
|
50
|
+
endpoints.gatewayUrl === `${baseUrl.replace(/^http/u, "ws")}/gateway` &&
|
|
51
|
+
env.DISCORD_BOT_TOKEN === value.botToken);
|
|
39
52
|
case "mattermost":
|
|
40
53
|
return (hasNonEmptyStringFields(value, ["botToken", "botUserId"]) &&
|
|
41
54
|
hasNonEmptyStringFields(endpoints, ["adminInboundUrl", "apiRoot", "websocketUrl"]) &&
|
|
@@ -101,7 +114,6 @@ function isGeneratedManifest(value) {
|
|
|
101
114
|
"baileysWebSocketUrl",
|
|
102
115
|
"messagesUrl",
|
|
103
116
|
"phoneNumberUrl",
|
|
104
|
-
"statusUrl",
|
|
105
117
|
]) &&
|
|
106
118
|
hasNonEmptyStringFields(env, [
|
|
107
119
|
"CLOUD_API_ACCESS_TOKEN",
|
|
@@ -114,7 +126,6 @@ function isGeneratedManifest(value) {
|
|
|
114
126
|
endpoints.phoneNumberUrl ===
|
|
115
127
|
`${endpoints.apiRoot}/${value.phoneNumberId}` &&
|
|
116
128
|
endpoints.messagesUrl === `${endpoints.phoneNumberUrl}/messages` &&
|
|
117
|
-
endpoints.statusUrl === endpoints.messagesUrl &&
|
|
118
129
|
endpoints.baileysWebSocketUrl ===
|
|
119
130
|
`${baseUrl.replace(/^http/u, "ws")}/ws/chat?access_token=${encodeURIComponent(value.accessToken)}` &&
|
|
120
131
|
env.CLOUD_API_ACCESS_TOKEN === value.accessToken &&
|
|
@@ -138,6 +149,11 @@ function isSuccessfulProbe(value, manifest) {
|
|
|
138
149
|
return false;
|
|
139
150
|
}
|
|
140
151
|
switch (manifest.provider) {
|
|
152
|
+
case "discord":
|
|
153
|
+
return (value.id === manifest.botUserId &&
|
|
154
|
+
value.bot === true &&
|
|
155
|
+
typeof value.username === "string" &&
|
|
156
|
+
value.username.trim().length > 0);
|
|
141
157
|
case "mattermost":
|
|
142
158
|
return (value.id === manifest.botUserId &&
|
|
143
159
|
typeof value.username === "string" &&
|
|
@@ -238,7 +254,7 @@ function parseArtifactPointer(contents) {
|
|
|
238
254
|
throw new Error("OpenClaw Crabline artifact pointer is malformed.");
|
|
239
255
|
}
|
|
240
256
|
const value = parsed;
|
|
241
|
-
if (value.version !==
|
|
257
|
+
if (value.version !== 3) {
|
|
242
258
|
throw new Error("OpenClaw Crabline artifact pointer is malformed.");
|
|
243
259
|
}
|
|
244
260
|
assertGenerationName(value.generation, "generation");
|
|
@@ -252,50 +268,32 @@ function parseArtifactPointer(contents) {
|
|
|
252
268
|
capabilityMatrixPath: generationArtifactPath(value.generation, OPENCLAW_CRABLINE_CHANNEL_CAPABILITY_MATRIX_PATH),
|
|
253
269
|
manifestPath: generationArtifactPath(value.generation, OPENCLAW_CRABLINE_MANIFEST_PATH),
|
|
254
270
|
providerReadinessArtifactPath: generationArtifactPath(value.generation, OPENCLAW_CRABLINE_PROVIDER_READINESS_PATH),
|
|
255
|
-
smokeArtifactPath: generationArtifactPath(value.generation, OPENCLAW_CRABLINE_CHANNEL_SMOKE_PATH),
|
|
256
271
|
};
|
|
257
272
|
if (typeof value.capabilityMatrixPath !== "string" ||
|
|
258
273
|
value.capabilityMatrixPath !== expected.capabilityMatrixPath ||
|
|
259
274
|
value.manifestPath !== expected.manifestPath ||
|
|
260
|
-
|
|
261
|
-
value.providerReadinessArtifactPath !== expected.providerReadinessArtifactPath) ||
|
|
262
|
-
(value.providerReadinessArtifactPath !== undefined &&
|
|
263
|
-
value.providerReadinessArtifactPath !== expected.providerReadinessArtifactPath) ||
|
|
264
|
-
(value.smokeArtifactPath !== undefined &&
|
|
265
|
-
value.smokeArtifactPath !== expected.smokeArtifactPath) ||
|
|
266
|
-
(value.providerReadinessArtifactPath === undefined && value.smokeArtifactPath === undefined)) {
|
|
275
|
+
value.providerReadinessArtifactPath !== expected.providerReadinessArtifactPath) {
|
|
267
276
|
throw new Error("OpenClaw Crabline artifact pointer is malformed.");
|
|
268
277
|
}
|
|
269
|
-
if (value.
|
|
278
|
+
if (value.recorderSnapshotPath !== null && typeof value.recorderSnapshotPath !== "string") {
|
|
270
279
|
throw new Error("OpenClaw Crabline artifact pointer is malformed.");
|
|
271
280
|
}
|
|
272
|
-
if (value.
|
|
273
|
-
|
|
281
|
+
if (typeof value.recorderSnapshotPath === "string") {
|
|
282
|
+
const recorderFileName = path.basename(value.recorderSnapshotPath);
|
|
283
|
+
if (!recorderFileName.endsWith(".jsonl") ||
|
|
284
|
+
value.recorderSnapshotPath !== generationArtifactPath(value.generation, recorderFileName)) {
|
|
274
285
|
throw new Error("OpenClaw Crabline artifact pointer is malformed.");
|
|
275
286
|
}
|
|
276
|
-
if (typeof value.recorderSnapshotPath === "string") {
|
|
277
|
-
const recorderFileName = path.basename(value.recorderSnapshotPath);
|
|
278
|
-
if (!recorderFileName.endsWith(".jsonl") ||
|
|
279
|
-
value.recorderSnapshotPath !== generationArtifactPath(value.generation, recorderFileName)) {
|
|
280
|
-
throw new Error("OpenClaw Crabline artifact pointer is malformed.");
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
287
|
}
|
|
284
|
-
|
|
288
|
+
return {
|
|
285
289
|
capabilityMatrixPath: value.capabilityMatrixPath,
|
|
286
290
|
generation: value.generation,
|
|
287
291
|
...(value.previousGeneration ? { previousGeneration: value.previousGeneration } : {}),
|
|
288
292
|
manifestPath: value.manifestPath,
|
|
289
|
-
providerReadinessArtifactPath: value.providerReadinessArtifactPath
|
|
290
|
-
|
|
293
|
+
providerReadinessArtifactPath: value.providerReadinessArtifactPath,
|
|
294
|
+
recorderSnapshotPath: value.recorderSnapshotPath,
|
|
295
|
+
version: 3,
|
|
291
296
|
};
|
|
292
|
-
return value.version === 1
|
|
293
|
-
? { ...pointer, version: 1 }
|
|
294
|
-
: {
|
|
295
|
-
...pointer,
|
|
296
|
-
recorderSnapshotPath: value.recorderSnapshotPath,
|
|
297
|
-
version: 2,
|
|
298
|
-
};
|
|
299
297
|
}
|
|
300
298
|
export async function readOpenClawCrablineArtifactPointer(outputDir) {
|
|
301
299
|
try {
|
|
@@ -377,7 +375,6 @@ async function assertArtifactGenerationExists(outputDir, pointer) {
|
|
|
377
375
|
const capabilityMatrix = await readArtifactObject(pointer.capabilityMatrixPath);
|
|
378
376
|
const readiness = await readArtifactObject(pointer.providerReadinessArtifactPath);
|
|
379
377
|
const providerReadiness = readiness.providerReadiness;
|
|
380
|
-
const smoke = readiness.smoke;
|
|
381
378
|
if (!isGeneratedManifest(manifest) ||
|
|
382
379
|
capabilityMatrix.version !== 1 ||
|
|
383
380
|
capabilityMatrix.source !== "openclaw/crabline" ||
|
|
@@ -388,43 +385,22 @@ async function assertArtifactGenerationExists(outputDir, pointer) {
|
|
|
388
385
|
capabilityMatrix.report === null ||
|
|
389
386
|
typeof capabilityMatrix.report !== "object" ||
|
|
390
387
|
Array.isArray(capabilityMatrix.report) ||
|
|
391
|
-
readiness.version !==
|
|
388
|
+
readiness.version !== 2 ||
|
|
392
389
|
readiness.source !== "openclaw/crabline" ||
|
|
393
390
|
readiness.manifestPath !== pointer.manifestPath ||
|
|
394
391
|
readiness.channelDriver !== "crabline" ||
|
|
395
392
|
readiness.selectedChannel !== capabilityMatrix.selectedChannel ||
|
|
396
393
|
manifest.provider !== readiness.selectedChannel ||
|
|
397
|
-
!isReadinessSection(
|
|
398
|
-
(pointer.version === 2 &&
|
|
399
|
-
(!isReadinessSection(providerReadiness, manifest, pointer.manifestPath, true) ||
|
|
400
|
-
!isDeepStrictEqual(providerReadiness, smoke))) ||
|
|
401
|
-
(pointer.version === 1 &&
|
|
402
|
-
providerReadiness !== undefined &&
|
|
403
|
-
(!isReadinessSection(providerReadiness, manifest, pointer.manifestPath, true) ||
|
|
404
|
-
!isDeepStrictEqual(providerReadiness, smoke)))) {
|
|
394
|
+
!isReadinessSection(providerReadiness, manifest, pointer.manifestPath, true)) {
|
|
405
395
|
throw new Error("OpenClaw Crabline current artifact generation is incomplete.");
|
|
406
396
|
}
|
|
407
397
|
const manifestRecorderPath = typeof manifest.recorderPath === "string" ? manifest.recorderPath : undefined;
|
|
408
|
-
const providerReadinessRecorderPath =
|
|
409
|
-
|
|
410
|
-
: undefined;
|
|
411
|
-
const smokeRecorderPath = readNestedRecorderPath(smoke);
|
|
412
|
-
const readinessRecorderPaths = [
|
|
413
|
-
...(isRecord(providerReadiness) ? [providerReadinessRecorderPath] : []),
|
|
414
|
-
smokeRecorderPath,
|
|
415
|
-
];
|
|
416
|
-
const recorderPaths = [manifestRecorderPath, ...readinessRecorderPaths];
|
|
398
|
+
const providerReadinessRecorderPath = readNestedRecorderPath(providerReadiness);
|
|
399
|
+
const recorderPaths = [manifestRecorderPath, providerReadinessRecorderPath];
|
|
417
400
|
if (manifest.recorderPath !== undefined && typeof manifest.recorderPath !== "string") {
|
|
418
401
|
throw new Error("OpenClaw Crabline current artifact generation is incomplete.");
|
|
419
402
|
}
|
|
420
|
-
|
|
421
|
-
if (pointer.version === 1 &&
|
|
422
|
-
readinessRecorderPaths.every((recorderPath) => recorderPath === undefined) &&
|
|
423
|
-
(manifestRecorderPath === undefined ||
|
|
424
|
-
path.dirname(path.resolve(outputDir, manifestRecorderPath)) !== generationDirectory)) {
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
if (pointer.version === 2 && pointer.recorderSnapshotPath === null) {
|
|
403
|
+
if (pointer.recorderSnapshotPath === null) {
|
|
428
404
|
if (recorderPaths.some((recorderPath) => recorderPath !== undefined)) {
|
|
429
405
|
throw new Error("OpenClaw Crabline current artifact generation is incomplete.");
|
|
430
406
|
}
|
|
@@ -436,8 +412,7 @@ async function assertArtifactGenerationExists(outputDir, pointer) {
|
|
|
436
412
|
throw new Error("OpenClaw Crabline current artifact generation is incomplete.");
|
|
437
413
|
}
|
|
438
414
|
const recorderPath = resolvedRecorderPaths[0];
|
|
439
|
-
if (pointer.
|
|
440
|
-
pointer.recorderSnapshotPath !== null &&
|
|
415
|
+
if (pointer.recorderSnapshotPath !== null &&
|
|
441
416
|
recorderPath !== path.resolve(outputDir, pointer.recorderSnapshotPath)) {
|
|
442
417
|
throw new Error("OpenClaw Crabline current artifact generation is incomplete.");
|
|
443
418
|
}
|
|
@@ -577,8 +552,7 @@ export async function publishOpenClawCrablineArtifactGeneration(params, dependen
|
|
|
577
552
|
...(currentPointer ? { previousGeneration: currentPointer.generation } : {}),
|
|
578
553
|
providerReadinessArtifactPath: generationArtifactPath(generation, providerReadinessArtifactPath),
|
|
579
554
|
recorderSnapshotPath: recorderSnapshotPath ?? null,
|
|
580
|
-
|
|
581
|
-
version: 2,
|
|
555
|
+
version: 3,
|
|
582
556
|
};
|
|
583
557
|
const publishedManifest = recorderSnapshotPath
|
|
584
558
|
? { ...params.manifest, recorderPath: recorderSnapshotPath }
|
|
@@ -606,13 +580,12 @@ export async function publishOpenClawCrablineArtifactGeneration(params, dependen
|
|
|
606
580
|
},
|
|
607
581
|
{
|
|
608
582
|
contents: `${JSON.stringify({
|
|
609
|
-
version:
|
|
583
|
+
version: 2,
|
|
610
584
|
source: "openclaw/crabline",
|
|
611
585
|
channelDriver: params.selection.channelDriver,
|
|
612
586
|
selectedChannel: params.selection.channel,
|
|
613
587
|
manifestPath: pointer.manifestPath,
|
|
614
588
|
providerReadiness,
|
|
615
|
-
smoke: providerReadiness,
|
|
616
589
|
}, null, 2)}\n`,
|
|
617
590
|
fileName: providerReadinessArtifactPath,
|
|
618
591
|
},
|
|
@@ -688,7 +661,6 @@ export async function publishOpenClawCrablineArtifactGeneration(params, dependen
|
|
|
688
661
|
...pointer,
|
|
689
662
|
pointerPath: OPENCLAW_CRABLINE_ARTIFACT_POINTER_PATH,
|
|
690
663
|
providerReadiness,
|
|
691
|
-
smoke: providerReadiness,
|
|
692
664
|
...(warnings ? { warnings } : {}),
|
|
693
665
|
};
|
|
694
666
|
}
|