@mondaydotcomorg/z2h-shared-utils 0.19.0 → 0.19.1
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/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -0
- package/dist/esm/constants.d.ts +2 -0
- package/dist/esm/constants.d.ts.map +1 -1
- package/dist/esm/constants.mjs +3 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/observability/events.d.ts +9 -0
- package/dist/esm/observability/events.d.ts.map +1 -1
- package/dist/esm/observability/events.mjs +19 -0
- package/dist/index.js +1 -0
- package/dist/observability/events.d.ts +9 -0
- package/dist/observability/events.d.ts.map +1 -1
- package/dist/observability/events.js +19 -0
- package/package.json +1 -1
- package/src/constants.ts +4 -0
- package/src/observability/events.ts +19 -0
package/dist/constants.d.ts
CHANGED
|
@@ -13,4 +13,6 @@ export declare const PREVIEW_APP_NAME_PREFIX = "zth-preview-";
|
|
|
13
13
|
export declare const APP_USAGE_BUCKET_NAME = "de-integration-bigbrain";
|
|
14
14
|
export declare const APP_USAGE_PREFIX = "prod/studio/entity=app_usage";
|
|
15
15
|
export declare const appUsageFolder: (appName: string, appId: number) => string;
|
|
16
|
+
export declare const RECOVERY_SNAPSHOT_RESULTS: readonly ["saved", "clean", "no-remote", "no-master"];
|
|
17
|
+
export type RecoverySnapshotResult = (typeof RECOVERY_SNAPSHOT_RESULTS)[number];
|
|
16
18
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AACpE,eAAO,MAAM,MAAM,cAAc,CAAC;AAClC,eAAO,MAAM,gBAAgB,wEAA4D,CAAC;AAE1F,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,+CAAgD,CAAC;AAGjF,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAI7C,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,iBAAiB,yDAA2C,CAAC;AAG1E,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AAGrE,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAGhD,eAAO,MAAM,gBAAgB,QAA2B,CAAC;AAEzD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAGtD,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAC/D,eAAO,MAAM,gBAAgB,iCAAiC,CAAC;AAC/D,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,WAA8C,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AACpE,eAAO,MAAM,MAAM,cAAc,CAAC;AAClC,eAAO,MAAM,gBAAgB,wEAA4D,CAAC;AAE1F,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,+CAAgD,CAAC;AAGjF,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAI7C,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,iBAAiB,yDAA2C,CAAC;AAG1E,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AAGrE,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAGhD,eAAO,MAAM,gBAAgB,QAA2B,CAAC;AAEzD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAGtD,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAC/D,eAAO,MAAM,gBAAgB,iCAAiC,CAAC;AAC/D,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,WAA8C,CAAC;AAG5G,eAAO,MAAM,yBAAyB,uDAAwD,CAAC;AAC/F,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -22,6 +22,8 @@ const PREVIEW_APP_NAME_PREFIX = 'zth-preview-';
|
|
|
22
22
|
const APP_USAGE_BUCKET_NAME = 'de-integration-bigbrain';
|
|
23
23
|
const APP_USAGE_PREFIX = 'prod/studio/entity=app_usage';
|
|
24
24
|
const appUsageFolder = (appName, appId) => `${APP_USAGE_PREFIX}/${appName}_${appId}`;
|
|
25
|
+
// `z2h-cli recovery-snapshot`'s JSON `result`: what it did with an app's local work. The agent reads it.
|
|
26
|
+
const RECOVERY_SNAPSHOT_RESULTS = ['saved', 'clean', 'no-remote', 'no-master'];
|
|
25
27
|
|
|
26
28
|
exports.APP_NAME_PATTERN = APP_NAME_PATTERN;
|
|
27
29
|
exports.APP_USAGE_BUCKET_NAME = APP_USAGE_BUCKET_NAME;
|
|
@@ -34,6 +36,7 @@ exports.DATAVIZ_SKILLS_PREFIX = DATAVIZ_SKILLS_PREFIX;
|
|
|
34
36
|
exports.MANIFEST_KEY = MANIFEST_KEY;
|
|
35
37
|
exports.MANIFEST_READ_URL = MANIFEST_READ_URL;
|
|
36
38
|
exports.PREVIEW_APP_NAME_PREFIX = PREVIEW_APP_NAME_PREFIX;
|
|
39
|
+
exports.RECOVERY_SNAPSHOT_RESULTS = RECOVERY_SNAPSHOT_RESULTS;
|
|
37
40
|
exports.REGION = REGION;
|
|
38
41
|
exports.S3_PREVIEWS_FOLDER = S3_PREVIEWS_FOLDER;
|
|
39
42
|
exports.S3_SKILLS_BUCKET_NAME = S3_SKILLS_BUCKET_NAME;
|
package/dist/esm/constants.d.ts
CHANGED
|
@@ -13,4 +13,6 @@ export declare const PREVIEW_APP_NAME_PREFIX = "zth-preview-";
|
|
|
13
13
|
export declare const APP_USAGE_BUCKET_NAME = "de-integration-bigbrain";
|
|
14
14
|
export declare const APP_USAGE_PREFIX = "prod/studio/entity=app_usage";
|
|
15
15
|
export declare const appUsageFolder: (appName: string, appId: number) => string;
|
|
16
|
+
export declare const RECOVERY_SNAPSHOT_RESULTS: readonly ["saved", "clean", "no-remote", "no-master"];
|
|
17
|
+
export type RecoverySnapshotResult = (typeof RECOVERY_SNAPSHOT_RESULTS)[number];
|
|
16
18
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AACpE,eAAO,MAAM,MAAM,cAAc,CAAC;AAClC,eAAO,MAAM,gBAAgB,wEAA4D,CAAC;AAE1F,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,+CAAgD,CAAC;AAGjF,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAI7C,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,iBAAiB,yDAA2C,CAAC;AAG1E,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AAGrE,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAGhD,eAAO,MAAM,gBAAgB,QAA2B,CAAC;AAEzD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAGtD,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAC/D,eAAO,MAAM,gBAAgB,iCAAiC,CAAC;AAC/D,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,WAA8C,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,qCAAqC,CAAC;AACpE,eAAO,MAAM,MAAM,cAAc,CAAC;AAClC,eAAO,MAAM,gBAAgB,wEAA4D,CAAC;AAE1F,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,+CAAgD,CAAC;AAGjF,eAAO,MAAM,kBAAkB,aAAa,CAAC;AAI7C,eAAO,MAAM,YAAY,cAAc,CAAC;AACxC,eAAO,MAAM,iBAAiB,yDAA2C,CAAC;AAG1E,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AAGrE,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAGhD,eAAO,MAAM,gBAAgB,QAA2B,CAAC;AAEzD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AAGtD,eAAO,MAAM,qBAAqB,4BAA4B,CAAC;AAC/D,eAAO,MAAM,gBAAgB,iCAAiC,CAAC;AAC/D,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,EAAE,OAAO,MAAM,WAA8C,CAAC;AAG5G,eAAO,MAAM,yBAAyB,uDAAwD,CAAC;AAC/F,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/esm/constants.mjs
CHANGED
|
@@ -20,5 +20,7 @@ const PREVIEW_APP_NAME_PREFIX = 'zth-preview-';
|
|
|
20
20
|
const APP_USAGE_BUCKET_NAME = 'de-integration-bigbrain';
|
|
21
21
|
const APP_USAGE_PREFIX = 'prod/studio/entity=app_usage';
|
|
22
22
|
const appUsageFolder = (appName, appId) => `${APP_USAGE_PREFIX}/${appName}_${appId}`;
|
|
23
|
+
// `z2h-cli recovery-snapshot`'s JSON `result`: what it did with an app's local work. The agent reads it.
|
|
24
|
+
const RECOVERY_SNAPSHOT_RESULTS = ['saved', 'clean', 'no-remote', 'no-master'];
|
|
23
25
|
|
|
24
|
-
export { APP_NAME_PATTERN, APP_USAGE_BUCKET_NAME, APP_USAGE_PREFIX, BUCKET_READ_DNS_NAME, BUCKET_READ_DNS_URL, BUCKET_WRITE_NAME, BUCKET_WRITE_URL, DATAVIZ_SKILLS_PREFIX, MANIFEST_KEY, MANIFEST_READ_URL, PREVIEW_APP_NAME_PREFIX, REGION, S3_PREVIEWS_FOLDER, S3_SKILLS_BUCKET_NAME, appUsageFolder };
|
|
26
|
+
export { APP_NAME_PATTERN, APP_USAGE_BUCKET_NAME, APP_USAGE_PREFIX, BUCKET_READ_DNS_NAME, BUCKET_READ_DNS_URL, BUCKET_WRITE_NAME, BUCKET_WRITE_URL, DATAVIZ_SKILLS_PREFIX, MANIFEST_KEY, MANIFEST_READ_URL, PREVIEW_APP_NAME_PREFIX, RECOVERY_SNAPSHOT_RESULTS, REGION, S3_PREVIEWS_FOLDER, S3_SKILLS_BUCKET_NAME, appUsageFolder };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { APP_NAME_PATTERN, APP_USAGE_BUCKET_NAME, APP_USAGE_PREFIX, BUCKET_READ_DNS_NAME, BUCKET_READ_DNS_URL, BUCKET_WRITE_NAME, BUCKET_WRITE_URL, DATAVIZ_SKILLS_PREFIX, MANIFEST_KEY, MANIFEST_READ_URL, PREVIEW_APP_NAME_PREFIX, REGION, S3_PREVIEWS_FOLDER, S3_SKILLS_BUCKET_NAME, appUsageFolder } from './constants.mjs';
|
|
1
|
+
export { APP_NAME_PATTERN, APP_USAGE_BUCKET_NAME, APP_USAGE_PREFIX, BUCKET_READ_DNS_NAME, BUCKET_READ_DNS_URL, BUCKET_WRITE_NAME, BUCKET_WRITE_URL, DATAVIZ_SKILLS_PREFIX, MANIFEST_KEY, MANIFEST_READ_URL, PREVIEW_APP_NAME_PREFIX, RECOVERY_SNAPSHOT_RESULTS, REGION, S3_PREVIEWS_FOLDER, S3_SKILLS_BUCKET_NAME, appUsageFolder } from './constants.mjs';
|
|
2
2
|
export { z2hAssets } from './z2hAssets.mjs';
|
|
3
3
|
export { ALWAYS_ON_CHANNELS, CUSTOM_INTEGRATION_HOST_STATUSES, DECLARED_INTEGRATIONS } from './integrations.mjs';
|
|
@@ -106,6 +106,15 @@ export declare const Z2hAgentEvents: {
|
|
|
106
106
|
readonly biEvent: "z2h_agent_tool_call";
|
|
107
107
|
};
|
|
108
108
|
readonly gitSync: "z2h.agent_git_sync";
|
|
109
|
+
readonly gracefulShutdown: {
|
|
110
|
+
readonly unfinished: "z2h.agent_graceful_shutdown.unfinished";
|
|
111
|
+
};
|
|
112
|
+
readonly commandTracker: {
|
|
113
|
+
readonly stopped: "z2h.agent_command_tracker.stopped";
|
|
114
|
+
readonly appDetected: "z2h.agent_command_tracker.app_detected";
|
|
115
|
+
readonly backgroundLeft: "z2h.agent_command_tracker.background_left";
|
|
116
|
+
readonly scanIncomplete: "z2h.agent_command_tracker.scan_incomplete";
|
|
117
|
+
};
|
|
109
118
|
};
|
|
110
119
|
/**
|
|
111
120
|
* BI events tracked in `z2h-cli`. Every event the CLI sends is named here.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;CAmCjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;CAWf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -108,6 +108,25 @@ const Z2hAgentEvents = {
|
|
|
108
108
|
// Distribution of a CLI call's duration in ms, tagged by phase (pull, push), status (success, failure) and,
|
|
109
109
|
// on a pull, cold: whether it had to clone the app. A push that lost a race is retried inside the CLI.
|
|
110
110
|
gitSync: 'z2h.agent_git_sync',
|
|
111
|
+
gracefulShutdown: {
|
|
112
|
+
// A turn or a save still running when the shutdown's time ran out, tagged kind (turn, save). Such a turn's work
|
|
113
|
+
// is only in the backup taken at the deadline: its own save never ran.
|
|
114
|
+
unfinished: 'z2h.agent_graceful_shutdown.unfinished',
|
|
115
|
+
},
|
|
116
|
+
commandTracker: {
|
|
117
|
+
// A command (or background processes a finished one left) the tracker stopped, tagged by reason (turn_stopped,
|
|
118
|
+
// turn_end, shutdown) and background: whether its shell had exited already.
|
|
119
|
+
stopped: 'z2h.agent_command_tracker.stopped',
|
|
120
|
+
// An app added to a turn, counted once when it is new to the turn, tagged by the source that found it: z2h-cli's
|
|
121
|
+
// report of the apps it opens (cli), the files a command changed (scan), or a file tool's path (file_tool).
|
|
122
|
+
// `scan` is what neither of the others saw; `other_turn` counts changed apps left to the live turn that owns them.
|
|
123
|
+
appDetected: 'z2h.agent_command_tracker.app_detected',
|
|
124
|
+
// A command left a background job running after its shell exited. What such a job writes later in another app
|
|
125
|
+
// isn't scanned: this shows whether that's worth handling.
|
|
126
|
+
backgroundLeft: 'z2h.agent_command_tracker.background_left',
|
|
127
|
+
// The changed-files scan stopped early (its time limit, or a folder it couldn't read): apps may be missing.
|
|
128
|
+
scanIncomplete: 'z2h.agent_command_tracker.scan_incomplete',
|
|
129
|
+
},
|
|
111
130
|
};
|
|
112
131
|
/**
|
|
113
132
|
* BI events tracked in `z2h-cli`. Every event the CLI sends is named here.
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.DATAVIZ_SKILLS_PREFIX = constants.DATAVIZ_SKILLS_PREFIX;
|
|
|
17
17
|
exports.MANIFEST_KEY = constants.MANIFEST_KEY;
|
|
18
18
|
exports.MANIFEST_READ_URL = constants.MANIFEST_READ_URL;
|
|
19
19
|
exports.PREVIEW_APP_NAME_PREFIX = constants.PREVIEW_APP_NAME_PREFIX;
|
|
20
|
+
exports.RECOVERY_SNAPSHOT_RESULTS = constants.RECOVERY_SNAPSHOT_RESULTS;
|
|
20
21
|
exports.REGION = constants.REGION;
|
|
21
22
|
exports.S3_PREVIEWS_FOLDER = constants.S3_PREVIEWS_FOLDER;
|
|
22
23
|
exports.S3_SKILLS_BUCKET_NAME = constants.S3_SKILLS_BUCKET_NAME;
|
|
@@ -106,6 +106,15 @@ export declare const Z2hAgentEvents: {
|
|
|
106
106
|
readonly biEvent: "z2h_agent_tool_call";
|
|
107
107
|
};
|
|
108
108
|
readonly gitSync: "z2h.agent_git_sync";
|
|
109
|
+
readonly gracefulShutdown: {
|
|
110
|
+
readonly unfinished: "z2h.agent_graceful_shutdown.unfinished";
|
|
111
|
+
};
|
|
112
|
+
readonly commandTracker: {
|
|
113
|
+
readonly stopped: "z2h.agent_command_tracker.stopped";
|
|
114
|
+
readonly appDetected: "z2h.agent_command_tracker.app_detected";
|
|
115
|
+
readonly backgroundLeft: "z2h.agent_command_tracker.background_left";
|
|
116
|
+
readonly scanIncomplete: "z2h.agent_command_tracker.scan_incomplete";
|
|
117
|
+
};
|
|
109
118
|
};
|
|
110
119
|
/**
|
|
111
120
|
* BI events tracked in `z2h-cli`. Every event the CLI sends is named here.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/observability/events.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDtB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCnB,CAAC;AAEX,oDAAoD;AACpD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;CAmCjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;CAWf,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -110,6 +110,25 @@ const Z2hAgentEvents = {
|
|
|
110
110
|
// Distribution of a CLI call's duration in ms, tagged by phase (pull, push), status (success, failure) and,
|
|
111
111
|
// on a pull, cold: whether it had to clone the app. A push that lost a race is retried inside the CLI.
|
|
112
112
|
gitSync: 'z2h.agent_git_sync',
|
|
113
|
+
gracefulShutdown: {
|
|
114
|
+
// A turn or a save still running when the shutdown's time ran out, tagged kind (turn, save). Such a turn's work
|
|
115
|
+
// is only in the backup taken at the deadline: its own save never ran.
|
|
116
|
+
unfinished: 'z2h.agent_graceful_shutdown.unfinished',
|
|
117
|
+
},
|
|
118
|
+
commandTracker: {
|
|
119
|
+
// A command (or background processes a finished one left) the tracker stopped, tagged by reason (turn_stopped,
|
|
120
|
+
// turn_end, shutdown) and background: whether its shell had exited already.
|
|
121
|
+
stopped: 'z2h.agent_command_tracker.stopped',
|
|
122
|
+
// An app added to a turn, counted once when it is new to the turn, tagged by the source that found it: z2h-cli's
|
|
123
|
+
// report of the apps it opens (cli), the files a command changed (scan), or a file tool's path (file_tool).
|
|
124
|
+
// `scan` is what neither of the others saw; `other_turn` counts changed apps left to the live turn that owns them.
|
|
125
|
+
appDetected: 'z2h.agent_command_tracker.app_detected',
|
|
126
|
+
// A command left a background job running after its shell exited. What such a job writes later in another app
|
|
127
|
+
// isn't scanned: this shows whether that's worth handling.
|
|
128
|
+
backgroundLeft: 'z2h.agent_command_tracker.background_left',
|
|
129
|
+
// The changed-files scan stopped early (its time limit, or a folder it couldn't read): apps may be missing.
|
|
130
|
+
scanIncomplete: 'z2h.agent_command_tracker.scan_incomplete',
|
|
131
|
+
},
|
|
113
132
|
};
|
|
114
133
|
/**
|
|
115
134
|
* BI events tracked in `z2h-cli`. Every event the CLI sends is named here.
|
package/package.json
CHANGED
package/src/constants.ts
CHANGED
|
@@ -28,3 +28,7 @@ export const PREVIEW_APP_NAME_PREFIX = 'zth-preview-';
|
|
|
28
28
|
export const APP_USAGE_BUCKET_NAME = 'de-integration-bigbrain';
|
|
29
29
|
export const APP_USAGE_PREFIX = 'prod/studio/entity=app_usage';
|
|
30
30
|
export const appUsageFolder = (appName: string, appId: number) => `${APP_USAGE_PREFIX}/${appName}_${appId}`;
|
|
31
|
+
|
|
32
|
+
// `z2h-cli recovery-snapshot`'s JSON `result`: what it did with an app's local work. The agent reads it.
|
|
33
|
+
export const RECOVERY_SNAPSHOT_RESULTS = ['saved', 'clean', 'no-remote', 'no-master'] as const;
|
|
34
|
+
export type RecoverySnapshotResult = (typeof RECOVERY_SNAPSHOT_RESULTS)[number];
|
|
@@ -110,6 +110,25 @@ export const Z2hAgentEvents = {
|
|
|
110
110
|
// Distribution of a CLI call's duration in ms, tagged by phase (pull, push), status (success, failure) and,
|
|
111
111
|
// on a pull, cold: whether it had to clone the app. A push that lost a race is retried inside the CLI.
|
|
112
112
|
gitSync: 'z2h.agent_git_sync',
|
|
113
|
+
gracefulShutdown: {
|
|
114
|
+
// A turn or a save still running when the shutdown's time ran out, tagged kind (turn, save). Such a turn's work
|
|
115
|
+
// is only in the backup taken at the deadline: its own save never ran.
|
|
116
|
+
unfinished: 'z2h.agent_graceful_shutdown.unfinished',
|
|
117
|
+
},
|
|
118
|
+
commandTracker: {
|
|
119
|
+
// A command (or background processes a finished one left) the tracker stopped, tagged by reason (turn_stopped,
|
|
120
|
+
// turn_end, shutdown) and background: whether its shell had exited already.
|
|
121
|
+
stopped: 'z2h.agent_command_tracker.stopped',
|
|
122
|
+
// An app added to a turn, counted once when it is new to the turn, tagged by the source that found it: z2h-cli's
|
|
123
|
+
// report of the apps it opens (cli), the files a command changed (scan), or a file tool's path (file_tool).
|
|
124
|
+
// `scan` is what neither of the others saw; `other_turn` counts changed apps left to the live turn that owns them.
|
|
125
|
+
appDetected: 'z2h.agent_command_tracker.app_detected',
|
|
126
|
+
// A command left a background job running after its shell exited. What such a job writes later in another app
|
|
127
|
+
// isn't scanned: this shows whether that's worth handling.
|
|
128
|
+
backgroundLeft: 'z2h.agent_command_tracker.background_left',
|
|
129
|
+
// The changed-files scan stopped early (its time limit, or a folder it couldn't read): apps may be missing.
|
|
130
|
+
scanIncomplete: 'z2h.agent_command_tracker.scan_incomplete',
|
|
131
|
+
},
|
|
113
132
|
} as const;
|
|
114
133
|
|
|
115
134
|
/**
|