@agent-relay/config 9.2.1 → 9.2.3
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/reflex-config.d.ts +13 -0
- package/dist/reflex-config.d.ts.map +1 -0
- package/dist/reflex-config.js +41 -0
- package/dist/reflex-config.js.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './bridge-utils.js';
|
|
|
4
4
|
export * from './teams-config.js';
|
|
5
5
|
export * from './shadow-config.js';
|
|
6
6
|
export * from './trajectory-config.js';
|
|
7
|
+
export * from './reflex-config.js';
|
|
7
8
|
export * from './agent-config.js';
|
|
8
9
|
export * from './cli-auth-config.js';
|
|
9
10
|
export * from './cloud-config.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from './bridge-utils.js';
|
|
|
4
4
|
export * from './teams-config.js';
|
|
5
5
|
export * from './shadow-config.js';
|
|
6
6
|
export * from './trajectory-config.js';
|
|
7
|
+
export * from './reflex-config.js';
|
|
7
8
|
export * from './agent-config.js';
|
|
8
9
|
export * from './cli-auth-config.js';
|
|
9
10
|
export * from './cloud-config.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ReflexState {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
enabledAt?: string;
|
|
4
|
+
}
|
|
5
|
+
/** Absolute path to the reflex state file (`~/.agentworkforce/reflex.json`). */
|
|
6
|
+
export declare function getReflexStateFile(home?: string): string;
|
|
7
|
+
/** Read the reflex state, or `null` when it was never written / is malformed. */
|
|
8
|
+
export declare function readReflexState(home?: string): ReflexState | null;
|
|
9
|
+
/** Persist the reflex state (creates `~/.agentworkforce/` as needed). */
|
|
10
|
+
export declare function writeReflexState(state: ReflexState, home?: string): void;
|
|
11
|
+
/** Whether Reflex capture is currently enabled. */
|
|
12
|
+
export declare function isReflexEnabled(home?: string): boolean;
|
|
13
|
+
//# sourceMappingURL=reflex-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflex-config.d.ts","sourceRoot":"","sources":["../src/reflex-config.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAEnE;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAkB,GAAG,WAAW,GAAG,IAAI,CAQ5E;AAED,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,GAAE,MAAkB,GAAG,IAAI,CAGnF;AAED,mDAAmD;AACnD,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAkB,GAAG,OAAO,CAEjE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reflex feature state.
|
|
3
|
+
*
|
|
4
|
+
* A single global toggle stored at `~/.agentworkforce/reflex.json` (NOT
|
|
5
|
+
* per-repo). Written by `agent-relay reflex on/off`; read by the runtime to
|
|
6
|
+
* decide whether to capture + push session history to relayhistory-cloud
|
|
7
|
+
* in-process. This module is the single source of truth for the file shape and
|
|
8
|
+
* location so the command and the runtime never drift.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { homedir } from 'node:os';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
function reflexDir(home = homedir()) {
|
|
14
|
+
return join(home, '.agentworkforce');
|
|
15
|
+
}
|
|
16
|
+
/** Absolute path to the reflex state file (`~/.agentworkforce/reflex.json`). */
|
|
17
|
+
export function getReflexStateFile(home = homedir()) {
|
|
18
|
+
return join(reflexDir(home), 'reflex.json');
|
|
19
|
+
}
|
|
20
|
+
/** Read the reflex state, or `null` when it was never written / is malformed. */
|
|
21
|
+
export function readReflexState(home = homedir()) {
|
|
22
|
+
const file = getReflexStateFile(home);
|
|
23
|
+
if (!existsSync(file))
|
|
24
|
+
return null;
|
|
25
|
+
try {
|
|
26
|
+
return JSON.parse(readFileSync(file, 'utf-8'));
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** Persist the reflex state (creates `~/.agentworkforce/` as needed). */
|
|
33
|
+
export function writeReflexState(state, home = homedir()) {
|
|
34
|
+
mkdirSync(reflexDir(home), { recursive: true });
|
|
35
|
+
writeFileSync(getReflexStateFile(home), JSON.stringify(state, null, 2), 'utf-8');
|
|
36
|
+
}
|
|
37
|
+
/** Whether Reflex capture is currently enabled. */
|
|
38
|
+
export function isReflexEnabled(home = homedir()) {
|
|
39
|
+
return readReflexState(home)?.enabled === true;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=reflex-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflex-config.js","sourceRoot":"","sources":["../src/reflex-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAOjC,SAAS,SAAS,CAAC,OAAe,OAAO,EAAE;IACzC,OAAO,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;AACvC,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,kBAAkB,CAAC,OAAe,OAAO,EAAE;IACzD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,CAAC;AAC9C,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,eAAe,CAAC,OAAe,OAAO,EAAE;IACtD,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAgB,CAAC;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,gBAAgB,CAAC,KAAkB,EAAE,OAAe,OAAO,EAAE;IAC3E,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,aAAa,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;AACnF,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,eAAe,CAAC,OAAe,OAAO,EAAE;IACtD,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AACjD,CAAC"}
|