@alineo-labs/core 0.4.1 → 0.4.2
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.mts +2 -26
- package/dist/index.mjs +1 -40
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConsoleLogger, ILogger, LogLevel, noopLogger } from "@alineo-labs/logger";
|
|
1
2
|
import { CodeContext, CodeLanguage, ControlClient, DiagnosticEvent, DiagnosticEvent as DiagnosticEvent$1, DiagnosticLog, DiagnosticLog as DiagnosticLog$1, EgressPolicyStatus, ExecClient, FileInfo, FileInfo as FileInfo$1, Metrics, Metrics as Metrics$1, NetworkPolicy, NetworkRule, PtyClient, SSEEvent } from "@alineo-labs/opensandbox";
|
|
2
3
|
//#region src/ledger.d.ts
|
|
3
4
|
/** Status of a sandbox session derived from its ledger events. */
|
|
@@ -216,31 +217,6 @@ interface IStorageAdapter {
|
|
|
216
217
|
listEnvironments(): Promise<EnvironmentRecord[]>;
|
|
217
218
|
}
|
|
218
219
|
//#endregion
|
|
219
|
-
//#region src/logger.d.ts
|
|
220
|
-
export declare enum LogLevel {
|
|
221
|
-
Debug = 0,
|
|
222
|
-
Info = 1,
|
|
223
|
-
Warn = 2,
|
|
224
|
-
Error = 3,
|
|
225
|
-
Silent = 4
|
|
226
|
-
}
|
|
227
|
-
interface ILogger {
|
|
228
|
-
debug(msg: string, meta?: Record<string, unknown>): void;
|
|
229
|
-
info(msg: string, meta?: Record<string, unknown>): void;
|
|
230
|
-
warn(msg: string, meta?: Record<string, unknown>): void;
|
|
231
|
-
error(msg: string, meta?: Record<string, unknown>): void;
|
|
232
|
-
}
|
|
233
|
-
export declare class ConsoleLogger implements ILogger {
|
|
234
|
-
private readonly minLevel;
|
|
235
|
-
constructor(minLevel?: LogLevel);
|
|
236
|
-
private log;
|
|
237
|
-
debug(msg: string, meta?: Record<string, unknown>): void;
|
|
238
|
-
info(msg: string, meta?: Record<string, unknown>): void;
|
|
239
|
-
warn(msg: string, meta?: Record<string, unknown>): void;
|
|
240
|
-
error(msg: string, meta?: Record<string, unknown>): void;
|
|
241
|
-
}
|
|
242
|
-
export declare const noopLogger: ILogger;
|
|
243
|
-
//#endregion
|
|
244
220
|
//#region src/credentials.d.ts
|
|
245
221
|
/**
|
|
246
222
|
* How a credential reaches an outbound request.
|
|
@@ -1098,4 +1074,4 @@ export declare class StepTimeoutError extends WorkflowError {
|
|
|
1098
1074
|
constructor(stepId: string, timeoutMs: number);
|
|
1099
1075
|
}
|
|
1100
1076
|
//#endregion
|
|
1101
|
-
export type
|
|
1077
|
+
export { type AttachableSource, type BoundCredential, type CheckpointInfo, type ComposeHooksOptions, ConsoleLogger, type CredentialBinding, type CredentialBroker, type CredentialInjection, type CredentialResolver, type CredentialSource, type DiagnosticEvent, type DiagnosticLog, type EnvironmentRecord, type ExecCodeOptions, type ExecOptions, type ExecResult, type FileInfo, type ILogger, type IStorageAdapter, type LedgerEntry, type ListSandboxOptions, LogLevel, type Metrics, type PendingInteractiveExec, type PtyControls, type ReconstructedEgress, type SandboxDeps, type SandboxDetails, type SandboxHooks, noopLogger };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ConsoleLogger, LogLevel, noopLogger } from "@alineo-labs/logger";
|
|
1
2
|
import { EgressClient, ExecClient, PtyClient, SSEEventType, SandboxState, SnapshotState } from "@alineo-labs/opensandbox";
|
|
2
3
|
//#region src/ledger.ts
|
|
3
4
|
/** Status of a sandbox session derived from its ledger events. */
|
|
@@ -73,46 +74,6 @@ let LedgerEvent = /* @__PURE__ */ function(LedgerEvent) {
|
|
|
73
74
|
return LedgerEvent;
|
|
74
75
|
}({});
|
|
75
76
|
//#endregion
|
|
76
|
-
//#region src/logger.ts
|
|
77
|
-
let LogLevel = /* @__PURE__ */ function(LogLevel) {
|
|
78
|
-
LogLevel[LogLevel["Debug"] = 0] = "Debug";
|
|
79
|
-
LogLevel[LogLevel["Info"] = 1] = "Info";
|
|
80
|
-
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
81
|
-
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
82
|
-
LogLevel[LogLevel["Silent"] = 4] = "Silent";
|
|
83
|
-
return LogLevel;
|
|
84
|
-
}({});
|
|
85
|
-
var ConsoleLogger = class {
|
|
86
|
-
minLevel;
|
|
87
|
-
constructor(minLevel = 1) {
|
|
88
|
-
this.minLevel = minLevel;
|
|
89
|
-
}
|
|
90
|
-
log(level, prefix, msg, meta) {
|
|
91
|
-
if (level < this.minLevel) return;
|
|
92
|
-
const out = meta ? `${prefix} ${msg} ${JSON.stringify(meta)}` : `${prefix} ${msg}`;
|
|
93
|
-
if (level >= 3) console.error(out);
|
|
94
|
-
else console.log(out);
|
|
95
|
-
}
|
|
96
|
-
debug(msg, meta) {
|
|
97
|
-
this.log(0, "[DEBUG]", msg, meta);
|
|
98
|
-
}
|
|
99
|
-
info(msg, meta) {
|
|
100
|
-
this.log(1, "[INFO]", msg, meta);
|
|
101
|
-
}
|
|
102
|
-
warn(msg, meta) {
|
|
103
|
-
this.log(2, "[WARN]", msg, meta);
|
|
104
|
-
}
|
|
105
|
-
error(msg, meta) {
|
|
106
|
-
this.log(3, "[ERROR]", msg, meta);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
const noopLogger = {
|
|
110
|
-
debug: () => {},
|
|
111
|
-
info: () => {},
|
|
112
|
-
warn: () => {},
|
|
113
|
-
error: () => {}
|
|
114
|
-
};
|
|
115
|
-
//#endregion
|
|
116
77
|
//#region src/errors.ts
|
|
117
78
|
/** Base class for all alineo workflow runtime errors. */
|
|
118
79
|
var WorkflowError = class extends Error {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alineo-labs/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"test:watch": "vitest"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@alineo-labs/
|
|
32
|
+
"@alineo-labs/logger": "0.1.0",
|
|
33
|
+
"@alineo-labs/opensandbox": "0.3.1"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"bun-types": "1.4.2",
|