@pithy-sh/support 0.2.7 → 0.2.9
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/dist/capability.d.ts.map +1 -1
- package/dist/capability.js +2 -1
- package/dist/provision/resolveSupportConfig.d.ts +6 -0
- package/dist/provision/resolveSupportConfig.d.ts.map +1 -1
- package/dist/provision/resolveSupportConfig.js +4 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +7 -7
- package/src/capability.ts +6 -3
- package/src/provision/resolveSupportConfig.ts +14 -1
- package/src/version.generated.ts +1 -1
package/dist/capability.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAGnE,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,0CAA0C,CAAC;AAC7F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAItE,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EAGxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAO9E,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,+FAA+F;AAC/F,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB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} from "./inbound/handler.js";
|
|
13
13
|
import { support_0001_threads } from "./migrations/0001_threads.js";
|
|
14
14
|
import { supportExampleSeed } from "./seeds/example.js";
|
|
15
|
-
import { PACKAGE_VERSION } from "./version.generated.js";
|
|
15
|
+
import { PACKAGE_NAME, PACKAGE_VERSION } from "./version.generated.js";
|
|
16
16
|
import { noopEmit } from "@pithy-sh/core/src/audit/recorder";
|
|
17
17
|
import { defineCapability } from "@pithy-sh/core/src/capability/capability";
|
|
18
18
|
import { workflowBindings } from "@pithy-sh/core/src/workflow/bindings";
|
|
@@ -141,6 +141,7 @@ function support(options = {}) {
|
|
|
141
141
|
const capability = defineCapability({
|
|
142
142
|
name: "support",
|
|
143
143
|
version: PACKAGE_VERSION,
|
|
144
|
+
package: PACKAGE_NAME,
|
|
144
145
|
dependsOn: ["secrets"],
|
|
145
146
|
secretRegistry: supportSecretsRegistry,
|
|
146
147
|
inapplicableSecrets: inapplicableAttachmentSecrets(resolved),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: 2026 Pithy
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
|
+
import type { FeatureIdentity } from "@pithy-sh/core/src/naming/feature";
|
|
3
4
|
import { type WorkflowHostTemplate } from "@pithy-sh/core/src/workflow/host";
|
|
4
5
|
import type { ManagedEnvironment } from "@pithy-sh/secrets/src/scope";
|
|
5
6
|
import type { SupportConfig } from "../config/config";
|
|
@@ -31,6 +32,11 @@ export interface SupportConfigParams {
|
|
|
31
32
|
project: string;
|
|
32
33
|
/** The target environment. */
|
|
33
34
|
env: ManagedEnvironment;
|
|
35
|
+
/**
|
|
36
|
+
* **The feature this host serves, when it serves one (#643).** Its Worker, its Workflows and every store
|
|
37
|
+
* entry it binds then take the feature's names, as every feature host's do; `env` is `feature`.
|
|
38
|
+
*/
|
|
39
|
+
feature?: FeatureIdentity;
|
|
34
40
|
/** The app database id for this environment — where the support tables live. */
|
|
35
41
|
appDatabaseId: string;
|
|
36
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSupportConfig.d.ts","sourceRoot":"","sources":["../../src/provision/resolveSupportConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyC,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACpH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8FAA8F;AAC9F,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,GAAG,EAAE,kBAAkB,CAAC;IACxB,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,6CAA6C;AAC7C,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,mBAAmB,GAC1B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"resolveSupportConfig.d.ts","sourceRoot":"","sources":["../../src/provision/resolveSupportConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAyC,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACpH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8FAA8F;AAC9F,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,GAAG,EAAE,kBAAkB,CAAC;IACxB;;;OAGG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,6CAA6C;AAC7C,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,EAAE,mBAAmB,GAC1B,oBAAoB,CAoBtB"}
|
|
@@ -5,18 +5,21 @@ import { hostWorkflowsFor, resolveWorkflowHost } from "@pithy-sh/core/src/workfl
|
|
|
5
5
|
//#region src/provision/resolveSupportConfig.ts
|
|
6
6
|
/** Fill the template for one environment. */
|
|
7
7
|
function resolveSupportConfig(template, params) {
|
|
8
|
+
const feature = params.feature;
|
|
8
9
|
const { project, env } = params;
|
|
9
10
|
return resolveWorkflowHost(template, {
|
|
10
11
|
project,
|
|
11
12
|
capability: SUPPORT_CAPABILITY,
|
|
12
13
|
env,
|
|
14
|
+
...feature ? { feature } : {},
|
|
13
15
|
databaseIds: { DB: params.appDatabaseId },
|
|
14
16
|
remoteBindings: ["AI"],
|
|
15
17
|
vars: { SUPPORT_CONFIG: JSON.stringify(params.supportConfig) },
|
|
16
18
|
workflows: hostWorkflowsFor(supportWorkflowRegistry, {
|
|
17
19
|
project,
|
|
18
20
|
capability: SUPPORT_CAPABILITY,
|
|
19
|
-
env
|
|
21
|
+
env,
|
|
22
|
+
...feature ? { feature } : {}
|
|
20
23
|
}).workflows
|
|
21
24
|
});
|
|
22
25
|
}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
/** This package's npm name — the join key against a release feed. */
|
|
4
4
|
export declare const PACKAGE_NAME = "@pithy-sh/support";
|
|
5
5
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
6
|
-
export declare const PACKAGE_VERSION = "0.2.
|
|
6
|
+
export declare const PACKAGE_VERSION = "0.2.9";
|
|
7
7
|
//# sourceMappingURL=version.generated.d.ts.map
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
/** This package's npm name — the join key against a release feed. */
|
|
5
5
|
const PACKAGE_NAME = "@pithy-sh/support";
|
|
6
6
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
7
|
-
const PACKAGE_VERSION = "0.2.
|
|
7
|
+
const PACKAGE_VERSION = "0.2.9";
|
|
8
8
|
//#endregion
|
|
9
9
|
export { PACKAGE_NAME, PACKAGE_VERSION };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pithy-sh/support",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"tldts": "^7.4.10"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@pithy-sh/auth": "^0.6.
|
|
44
|
-
"@pithy-sh/core": "^0.7.
|
|
45
|
-
"@pithy-sh/email": "^0.3.
|
|
46
|
-
"@pithy-sh/payments": "^0.3.
|
|
47
|
-
"@pithy-sh/secrets": "^0.2.
|
|
48
|
-
"@pithy-sh/storage": "^0.2.
|
|
43
|
+
"@pithy-sh/auth": "^0.6.3",
|
|
44
|
+
"@pithy-sh/core": "^0.7.4",
|
|
45
|
+
"@pithy-sh/email": "^0.3.8",
|
|
46
|
+
"@pithy-sh/payments": "^0.3.6",
|
|
47
|
+
"@pithy-sh/secrets": "^0.2.7",
|
|
48
|
+
"@pithy-sh/storage": "^0.2.7",
|
|
49
49
|
"hono": "^4.13.2",
|
|
50
50
|
"kysely": "^0.29.0",
|
|
51
51
|
"zod": "^4.4.0"
|
package/src/capability.ts
CHANGED
|
@@ -28,7 +28,7 @@ import { support_0001_threads } from "./migrations/0001_threads";
|
|
|
28
28
|
import { resolveReplies, type SupportReplySnippets } from "./reply/snippets";
|
|
29
29
|
import { inapplicableAttachmentSecrets, SUPPORT_BUCKET_BINDING, supportSecretsRegistry } from "./secret/registry";
|
|
30
30
|
import { supportExampleSeed } from "./seeds/example";
|
|
31
|
-
import { PACKAGE_VERSION } from "./version.generated";
|
|
31
|
+
import { PACKAGE_NAME, PACKAGE_VERSION } from "./version.generated";
|
|
32
32
|
import { supportWorkflows } from "./workflows/specs";
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -235,9 +235,12 @@ export function support(options: SupportOptions = {}): SupportCapability {
|
|
|
235
235
|
|
|
236
236
|
const capability = defineCapability({
|
|
237
237
|
name: "support",
|
|
238
|
-
// The package
|
|
239
|
-
// cannot read its own package.json. Reported per capability by
|
|
238
|
+
// The package this capability ships in and the version it ships at, both stamped by
|
|
239
|
+
// `scripts/stampVersions.ts` — a Worker cannot read its own package.json. Reported per capability by
|
|
240
|
+
// the control-plane manifest, and reported together: a release feed is keyed by package name, so the
|
|
241
|
+
// version alone leaves a client guessing the key (#626).
|
|
240
242
|
version: PACKAGE_VERSION,
|
|
243
|
+
package: PACKAGE_NAME,
|
|
241
244
|
// Attachment presigning reads an R2 credential bundle through @pithy-sh/secrets.
|
|
242
245
|
dependsOn: ["secrets"],
|
|
243
246
|
secretRegistry: supportSecretsRegistry,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// SPDX-FileCopyrightText: 2026 Pithy
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
|
+
import type { FeatureIdentity } from "@pithy-sh/core/src/naming/feature";
|
|
4
5
|
import { hostWorkflowsFor, resolveWorkflowHost, type WorkflowHostTemplate } from "@pithy-sh/core/src/workflow/host";
|
|
5
6
|
import type { ManagedEnvironment } from "@pithy-sh/secrets/src/scope";
|
|
6
7
|
import type { SupportConfig } from "../config/config";
|
|
@@ -35,6 +36,11 @@ export interface SupportConfigParams {
|
|
|
35
36
|
project: string;
|
|
36
37
|
/** The target environment. */
|
|
37
38
|
env: ManagedEnvironment;
|
|
39
|
+
/**
|
|
40
|
+
* **The feature this host serves, when it serves one (#643).** Its Worker, its Workflows and every store
|
|
41
|
+
* entry it binds then take the feature's names, as every feature host's do; `env` is `feature`.
|
|
42
|
+
*/
|
|
43
|
+
feature?: FeatureIdentity;
|
|
38
44
|
/** The app database id for this environment — where the support tables live. */
|
|
39
45
|
appDatabaseId: string;
|
|
40
46
|
/**
|
|
@@ -52,16 +58,23 @@ export function resolveSupportConfig(
|
|
|
52
58
|
template: WorkflowHostTemplate,
|
|
53
59
|
params: SupportConfigParams,
|
|
54
60
|
): WorkflowHostTemplate {
|
|
61
|
+
const feature = params.feature;
|
|
55
62
|
const { project, env } = params;
|
|
56
63
|
return resolveWorkflowHost(template, {
|
|
57
64
|
project,
|
|
58
65
|
capability: SUPPORT_CAPABILITY,
|
|
59
66
|
env,
|
|
67
|
+
...(feature ? { feature } : {}),
|
|
60
68
|
databaseIds: { DB: params.appDatabaseId },
|
|
61
69
|
remoteBindings: ["AI"],
|
|
62
70
|
vars: { SUPPORT_CONFIG: JSON.stringify(params.supportConfig) },
|
|
63
71
|
// The classification Workflow, derived from support's own specs. A Workflow name is
|
|
64
72
|
// account-scoped, so it has to carry the project, and only the registry knows the job.
|
|
65
|
-
workflows: hostWorkflowsFor(supportWorkflowRegistry, {
|
|
73
|
+
workflows: hostWorkflowsFor(supportWorkflowRegistry, {
|
|
74
|
+
project,
|
|
75
|
+
capability: SUPPORT_CAPABILITY,
|
|
76
|
+
env,
|
|
77
|
+
...(feature ? { feature } : {}),
|
|
78
|
+
}).workflows,
|
|
66
79
|
});
|
|
67
80
|
}
|
package/src/version.generated.ts
CHANGED