@alpacakit/integrations-conventions 0.1.0-beta.36 → 0.1.0-beta.39
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 +13 -1
- package/dist/index.d.ts +17 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -11
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
# @alpacakit/integrations-conventions
|
|
2
2
|
|
|
3
3
|
Published AlpacaLoop-family XDG path and keyring conventions for
|
|
4
|
-
`@alpacakit/integrations
|
|
4
|
+
`@alpacakit/integrations`: the `ALPACA_INTEGRATIONS_HOME` /
|
|
5
|
+
`~/.config/alpacaloop/integrations` config root and the `alpaca.integrations`
|
|
6
|
+
keychain service.
|
|
7
|
+
|
|
8
|
+
The keychain itself is not implemented here. This package names the service
|
|
9
|
+
and the account layout, then opens it through `@alpacakit/core/keyring` — the
|
|
10
|
+
one module in the workspace that talks to an OS keychain.
|
|
11
|
+
|
|
12
|
+
A keychain account is `profile:<profileId>:<materialKind>:<revision>`. The
|
|
13
|
+
`revision` is supplied by the caller and identifies **the stored material**,
|
|
14
|
+
not the profile: a rotation writes the new secret under a new locator before
|
|
15
|
+
retiring the old one, so two revisions of one profile must never share a
|
|
16
|
+
locator or retiring the old revision would delete the key just saved.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { IntegrationAuthMaterialKind,
|
|
1
|
+
import type { IntegrationAuthMaterialKind, IntegrationAuthProfileId, SecretRef } from "@alpacakit/integrations";
|
|
2
2
|
import { integrationsConfigPaths } from "@alpacakit/integrations/config";
|
|
3
|
-
|
|
3
|
+
/** Keychain service for integration credentials — distinct from agents (I1). */
|
|
4
|
+
export declare const ALPACA_LOOP_INTEGRATIONS_KEYRING_SERVICE = "alpaca.integrations";
|
|
4
5
|
export declare const ALPACA_LOOP_INTEGRATIONS_KEYRING_RESOLVER = "integrations-keyring";
|
|
5
6
|
export type IntegrationsConventionInput = {
|
|
6
7
|
readonly homeDir: string;
|
|
@@ -8,8 +9,19 @@ export type IntegrationsConventionInput = {
|
|
|
8
9
|
};
|
|
9
10
|
export declare function resolveIntegrationsConfigRoot(input: IntegrationsConventionInput): string;
|
|
10
11
|
export declare function resolveIntegrationsConfigPaths(input: IntegrationsConventionInput): ReturnType<typeof integrationsConfigPaths>;
|
|
11
|
-
export
|
|
12
|
-
|
|
12
|
+
export type IntegrationKeyringSecretRefInput = {
|
|
13
|
+
readonly profileId: IntegrationAuthProfileId;
|
|
14
|
+
readonly materialKind: IntegrationAuthMaterialKind;
|
|
15
|
+
/**
|
|
16
|
+
* Caller-supplied unique string identifying THIS stored material, not the
|
|
17
|
+
* profile. A rotation writes the new secret under a new locator before
|
|
18
|
+
* retiring the old one, so two revisions of one profile must never collide:
|
|
19
|
+
* a deterministic `profile:<id>:<kind>` locator would make the retirement of
|
|
20
|
+
* the old revision delete the key that was just saved.
|
|
21
|
+
*/
|
|
22
|
+
readonly revision: string;
|
|
23
|
+
};
|
|
24
|
+
export declare function createIntegrationKeyringSecretRef(input: IntegrationKeyringSecretRefInput): SecretRef;
|
|
13
25
|
export declare function integrationKeyringResolver(): import("@alpacakit/integrations").SecretResolver;
|
|
14
|
-
export declare function integrationKeyringSecretStore(): import("@alpacakit/
|
|
26
|
+
export declare function integrationKeyringSecretStore(): import("@alpacakit/core/keyring").KeyringSecretStore;
|
|
15
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,wBAAwB,EACxB,SAAS,EACV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAKzE,gFAAgF;AAChF,eAAO,MAAM,wCAAwC,wBAAwB,CAAC;AAC9E,eAAO,MAAM,yCAAyC,yBAAyB,CAAC;AAEhF,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC5D,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,2BAA2B,GACjC,MAAM,CAYR;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,2BAA2B,GACjC,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAE5C;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;IAC7C,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAC;IACnD;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,gCAAgC,GACtC,SAAS,CAKX;AAED,wBAAgB,0BAA0B,qDAEzC;AAED,wBAAgB,6BAA6B,yDAI5C"}
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { keyringResolver, keyringSecretStore } from "@alpacakit/core/keyring";
|
|
2
3
|
import { integrationsConfigPaths } from "@alpacakit/integrations/config";
|
|
3
|
-
import { keyringResolver, keyringSecretStore, } from "@alpacakit/integrations/keyring";
|
|
4
4
|
const ALPACA_LOOP_INTEGRATIONS_CONFIG_ENV_VAR = "ALPACA_INTEGRATIONS_HOME";
|
|
5
5
|
const ALPACA_LOOP_INTEGRATIONS_CONFIG_DIRECTORY = ".config/alpacaloop/integrations";
|
|
6
|
-
|
|
6
|
+
/** Keychain service for integration credentials — distinct from agents (I1). */
|
|
7
|
+
export const ALPACA_LOOP_INTEGRATIONS_KEYRING_SERVICE = "alpaca.integrations";
|
|
7
8
|
export const ALPACA_LOOP_INTEGRATIONS_KEYRING_RESOLVER = "integrations-keyring";
|
|
8
9
|
export function resolveIntegrationsConfigRoot(input) {
|
|
9
10
|
const override = readNonBlank(input.env, ALPACA_LOOP_INTEGRATIONS_CONFIG_ENV_VAR);
|
|
@@ -18,22 +19,19 @@ export function resolveIntegrationsConfigRoot(input) {
|
|
|
18
19
|
export function resolveIntegrationsConfigPaths(input) {
|
|
19
20
|
return integrationsConfigPaths(resolveIntegrationsConfigRoot(input));
|
|
20
21
|
}
|
|
21
|
-
export function createIntegrationKeyringSecretRef(
|
|
22
|
+
export function createIntegrationKeyringSecretRef(input) {
|
|
22
23
|
return {
|
|
23
24
|
resolver: ALPACA_LOOP_INTEGRATIONS_KEYRING_RESOLVER,
|
|
24
|
-
id: `profile:${profileId}:${materialKind}`,
|
|
25
|
+
id: `profile:${input.profileId}:${input.materialKind}:${input.revision}`,
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
export function isManagedIntegrationKeyringProfile(profile) {
|
|
28
|
-
const expected = createIntegrationKeyringSecretRef(profile.id, profile.material.kind);
|
|
29
|
-
return (profile.material.secret.resolver === expected.resolver &&
|
|
30
|
-
profile.material.secret.id === expected.id);
|
|
31
|
-
}
|
|
32
28
|
export function integrationKeyringResolver() {
|
|
33
|
-
return keyringResolver(
|
|
29
|
+
return keyringResolver({ service: ALPACA_LOOP_INTEGRATIONS_KEYRING_SERVICE });
|
|
34
30
|
}
|
|
35
31
|
export function integrationKeyringSecretStore() {
|
|
36
|
-
return keyringSecretStore(
|
|
32
|
+
return keyringSecretStore({
|
|
33
|
+
service: ALPACA_LOOP_INTEGRATIONS_KEYRING_SERVICE,
|
|
34
|
+
});
|
|
37
35
|
}
|
|
38
36
|
function readNonBlank(env, name) {
|
|
39
37
|
const value = env[name];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpacakit/integrations-conventions",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.39",
|
|
4
4
|
"description": "AlpacaKit-family conventions for @alpacakit/integrations machine-local config.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"LICENSE"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@alpacakit/
|
|
24
|
+
"@alpacakit/core": "0.1.0-beta.39",
|
|
25
|
+
"@alpacakit/integrations": "0.1.0-beta.39"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"typescript": "^5.9.3",
|