@hasna/todos 0.15.33 → 0.15.34
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/cli/cloud-router.d.ts +32 -46
- package/dist/cli/cloud-router.d.ts.map +1 -1
- package/dist/cli/index.js +94 -89
- package/dist/cli/stage-a.d.ts +3 -1
- package/dist/cli/stage-a.d.ts.map +1 -1
- package/dist/contracts.js +32 -26
- package/dist/index.js +71 -82
- package/dist/lib/assignee-validation.d.ts.map +1 -1
- package/dist/mcp/index.js +70 -80
- package/dist/mcp.js +2 -4
- package/dist/project-registration.js +32 -26
- package/dist/registry.js +32 -26
- package/dist/release-provenance.json +5 -5
- package/dist/server/index.js +1288 -7253
- package/dist/storage/config.d.ts +24 -4
- package/dist/storage/config.d.ts.map +1 -1
- package/dist/storage/hybrid.d.ts +5 -3
- package/dist/storage/hybrid.d.ts.map +1 -1
- package/dist/storage.js +30 -22
- package/dist/task-manifest.js +3 -3
- package/dist/testing.d.ts +16 -7
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +10 -6
- package/package.json +2 -4
package/dist/contracts.js
CHANGED
|
@@ -4177,6 +4177,7 @@ __export(exports_config, {
|
|
|
4177
4177
|
TODOS_STORAGE_FALLBACK_ENV: () => TODOS_STORAGE_FALLBACK_ENV,
|
|
4178
4178
|
TODOS_STORAGE_ENV: () => TODOS_STORAGE_ENV,
|
|
4179
4179
|
STORAGE_TABLES: () => STORAGE_TABLES,
|
|
4180
|
+
REMOVED_STORAGE_MODE_ENV_KEYS: () => REMOVED_STORAGE_MODE_ENV_KEYS,
|
|
4180
4181
|
CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV: () => CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV,
|
|
4181
4182
|
CANONICAL_TODOS_RDS_DATABASE: () => CANONICAL_TODOS_RDS_DATABASE,
|
|
4182
4183
|
CANONICAL_TODOS_RDS_CLUSTER_ENV: () => CANONICAL_TODOS_RDS_CLUSTER_ENV
|
|
@@ -4238,25 +4239,36 @@ function assertTodosRemoteStorageConfig(config) {
|
|
|
4238
4239
|
if (!isTodosPostgresBackend(config))
|
|
4239
4240
|
return;
|
|
4240
4241
|
if (!config.database?.url) {
|
|
4241
|
-
throw new Error(`${TODOS_STORAGE_ENV.databaseUrl} is required when
|
|
4242
|
+
throw new Error(`${TODOS_STORAGE_ENV.databaseUrl} is required when the postgresql backend is selected`);
|
|
4242
4243
|
}
|
|
4243
4244
|
}
|
|
4244
4245
|
function parseStorageBackend(value) {
|
|
4245
4246
|
const normalized = clean(value)?.toLowerCase();
|
|
4246
4247
|
if (!normalized)
|
|
4247
4248
|
return "sqlite";
|
|
4248
|
-
if (normalized === "sqlite"
|
|
4249
|
-
return
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4249
|
+
if (normalized === "sqlite")
|
|
4250
|
+
return "sqlite";
|
|
4251
|
+
if (normalized === "postgres" || normalized === "postgresql")
|
|
4252
|
+
return "postgres";
|
|
4253
|
+
if (["local", "remote", "cloud", "hybrid", "self_hosted"].includes(normalized)) {
|
|
4254
|
+
throw new Error(`${TODOS_STORAGE_ENV.databaseUrl} selects the backend. Deployment modes no longer exist: ` + `delete the storage-mode variable and set ${TODOS_STORAGE_ENV.databaseUrl} to select the ` + `postgresql backend, or leave it unset for sqlite.`);
|
|
4255
|
+
}
|
|
4256
|
+
throw new Error(`Storage backend must be sqlite or postgres`);
|
|
4254
4257
|
}
|
|
4255
4258
|
function parseStorageMode(value) {
|
|
4256
4259
|
return parseStorageBackend(value);
|
|
4257
4260
|
}
|
|
4258
4261
|
function getTodosStorageBackend(env = process.env) {
|
|
4259
|
-
|
|
4262
|
+
for (const key of REMOVED_STORAGE_MODE_ENV_KEYS) {
|
|
4263
|
+
if (Object.hasOwn(env, key) && env[key] !== undefined) {
|
|
4264
|
+
throw new Error(`${key} was removed. Deployment modes no longer exist: delete the storage-mode variable. ` + `Set ${TODOS_STORAGE_ENV.databaseUrl} to select the postgresql backend, ` + `or leave it unset for sqlite.`);
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
if (!getTodosStorageDatabaseUrl(env))
|
|
4268
|
+
return "sqlite";
|
|
4269
|
+
if (isTodosShadowEnabled(env))
|
|
4270
|
+
return "sqlite";
|
|
4271
|
+
return "postgres";
|
|
4260
4272
|
}
|
|
4261
4273
|
function getTodosStorageMode(env = process.env) {
|
|
4262
4274
|
return getTodosStorageBackend(env);
|
|
@@ -4330,7 +4342,7 @@ function parsePositiveInteger(value, fallback) {
|
|
|
4330
4342
|
}
|
|
4331
4343
|
return parsed;
|
|
4332
4344
|
}
|
|
4333
|
-
var TODOS_STORAGE_TABLES, STORAGE_TABLES, TODOS_STORAGE_ENV, TODOS_STORAGE_FALLBACK_ENV, CANONICAL_TODOS_RDS_CLUSTER_ENV = "HASNA_TODOS_RDS_CLUSTER", CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV = "HASNA_TODOS_RDS_RUNTIME_PATH", CANONICAL_TODOS_RDS_DATABASE = "todos"
|
|
4345
|
+
var TODOS_STORAGE_TABLES, STORAGE_TABLES, TODOS_STORAGE_ENV, TODOS_STORAGE_FALLBACK_ENV, REMOVED_STORAGE_MODE_ENV_KEYS, CANONICAL_TODOS_RDS_CLUSTER_ENV = "HASNA_TODOS_RDS_CLUSTER", CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV = "HASNA_TODOS_RDS_RUNTIME_PATH", CANONICAL_TODOS_RDS_DATABASE = "todos";
|
|
4334
4346
|
var init_config = __esm(() => {
|
|
4335
4347
|
TODOS_STORAGE_TABLES = [
|
|
4336
4348
|
"todos_sync_records",
|
|
@@ -4338,7 +4350,6 @@ var init_config = __esm(() => {
|
|
|
4338
4350
|
];
|
|
4339
4351
|
STORAGE_TABLES = TODOS_STORAGE_TABLES;
|
|
4340
4352
|
TODOS_STORAGE_ENV = {
|
|
4341
|
-
mode: "HASNA_TODOS_STORAGE_MODE",
|
|
4342
4353
|
shadow: "HASNA_TODOS_SHADOW",
|
|
4343
4354
|
databaseUrl: "HASNA_TODOS_DATABASE_URL",
|
|
4344
4355
|
databaseSsl: "HASNA_TODOS_DATABASE_SSL",
|
|
@@ -4355,7 +4366,6 @@ var init_config = __esm(() => {
|
|
|
4355
4366
|
syncDryRun: "HASNA_TODOS_SYNC_DRY_RUN"
|
|
4356
4367
|
};
|
|
4357
4368
|
TODOS_STORAGE_FALLBACK_ENV = {
|
|
4358
|
-
mode: "TODOS_STORAGE_MODE",
|
|
4359
4369
|
shadow: "TODOS_SHADOW",
|
|
4360
4370
|
databaseUrl: "TODOS_DATABASE_URL",
|
|
4361
4371
|
databaseSsl: "TODOS_DATABASE_SSL",
|
|
@@ -4371,14 +4381,12 @@ var init_config = __esm(() => {
|
|
|
4371
4381
|
syncBatchSize: "TODOS_SYNC_BATCH_SIZE",
|
|
4372
4382
|
syncDryRun: "TODOS_SYNC_DRY_RUN"
|
|
4373
4383
|
};
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
cloud: "postgres"
|
|
4381
|
-
};
|
|
4384
|
+
REMOVED_STORAGE_MODE_ENV_KEYS = [
|
|
4385
|
+
"HASNA_TODOS_STORAGE_MODE",
|
|
4386
|
+
"HASNA_TODOS_MODE",
|
|
4387
|
+
"TODOS_STORAGE_MODE",
|
|
4388
|
+
"TODOS_MODE"
|
|
4389
|
+
];
|
|
4382
4390
|
});
|
|
4383
4391
|
|
|
4384
4392
|
// src/storage/shadow-outbox-schema.ts
|
|
@@ -7227,8 +7235,8 @@ var init_secret_redaction = __esm(() => {
|
|
|
7227
7235
|
SECRET_REDACTION_SCHEMA = ["todos", "secret_redaction", "v1"].join(".");
|
|
7228
7236
|
DEFAULT_PATTERNS = [
|
|
7229
7237
|
{ name: "openai_sk", pattern: /\bsk-[a-zA-Z0-9]{10,}\b/g },
|
|
7230
|
-
{ name: "github_pat", pattern: /\
|
|
7231
|
-
{ name: "github_oauth", pattern: /\
|
|
7238
|
+
{ name: "github_pat", pattern: /\bgh[p]_[a-zA-Z0-9]{20,}\b/g },
|
|
7239
|
+
{ name: "github_oauth", pattern: /\bgh[o]_[a-zA-Z0-9]{20,}\b/g },
|
|
7232
7240
|
{ name: "aws_access_key", pattern: /\bAKIA[0-9A-Z]{16}\b/g },
|
|
7233
7241
|
{ name: "bearer_token", pattern: /\bBearer\s+[a-zA-Z0-9\-._~+/]+=*\b/gi },
|
|
7234
7242
|
{ name: "jwt", pattern: /\beyJ[a-zA-Z0-9_-]+\.eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\b/g },
|
|
@@ -7240,7 +7248,7 @@ var init_secret_redaction = __esm(() => {
|
|
|
7240
7248
|
/example\.com/i,
|
|
7241
7249
|
/your-api-key-here/i,
|
|
7242
7250
|
/sk-test/i,
|
|
7243
|
-
/
|
|
7251
|
+
/gh[p]_xxx/i
|
|
7244
7252
|
];
|
|
7245
7253
|
customRedactors = [];
|
|
7246
7254
|
});
|
|
@@ -12720,7 +12728,7 @@ var init_tasks = __esm(() => {
|
|
|
12720
12728
|
// package.json
|
|
12721
12729
|
var package_default = {
|
|
12722
12730
|
name: "@hasna/todos",
|
|
12723
|
-
version: "0.15.
|
|
12731
|
+
version: "0.15.34",
|
|
12724
12732
|
description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
|
|
12725
12733
|
type: "module",
|
|
12726
12734
|
main: "dist/index.js",
|
|
@@ -12794,9 +12802,7 @@ var package_default = {
|
|
|
12794
12802
|
"verify:release": "bun run scripts/verify-public-release.ts --mode=review",
|
|
12795
12803
|
"verify:release-review": "bun run scripts/verify-npm-release-agent-review.ts",
|
|
12796
12804
|
"verify:attested-container-candidate": "bun run scripts/attested-container-candidate.ts verify",
|
|
12797
|
-
"test:attested-container-candidate": "bun test scripts/attested-container-candidate.test.ts
|
|
12798
|
-
"emit:iapp-deployment-compatibility-vector": "bun run scripts/attested-container-compatibility-vector.ts emit",
|
|
12799
|
-
"verify:iapp-deployment-compatibility-vector": "bun run scripts/attested-container-compatibility-vector.ts verify",
|
|
12805
|
+
"test:attested-container-candidate": "bun test scripts/attested-container-candidate.test.ts",
|
|
12800
12806
|
"issue:release-review": "bun run scripts/issue-npm-release-agent-review.ts",
|
|
12801
12807
|
prepublishOnly: "bun run scripts/verify-public-release.ts --mode=publish",
|
|
12802
12808
|
postinstall: "mkdir -p $HOME/.hasna/todos $HOME/.hasna/todos/training 2>/dev/null || true"
|
package/dist/index.js
CHANGED
|
@@ -4177,6 +4177,7 @@ __export(exports_config, {
|
|
|
4177
4177
|
TODOS_STORAGE_FALLBACK_ENV: () => TODOS_STORAGE_FALLBACK_ENV,
|
|
4178
4178
|
TODOS_STORAGE_ENV: () => TODOS_STORAGE_ENV,
|
|
4179
4179
|
STORAGE_TABLES: () => STORAGE_TABLES,
|
|
4180
|
+
REMOVED_STORAGE_MODE_ENV_KEYS: () => REMOVED_STORAGE_MODE_ENV_KEYS,
|
|
4180
4181
|
CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV: () => CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV,
|
|
4181
4182
|
CANONICAL_TODOS_RDS_DATABASE: () => CANONICAL_TODOS_RDS_DATABASE,
|
|
4182
4183
|
CANONICAL_TODOS_RDS_CLUSTER_ENV: () => CANONICAL_TODOS_RDS_CLUSTER_ENV
|
|
@@ -4238,25 +4239,36 @@ function assertTodosRemoteStorageConfig(config) {
|
|
|
4238
4239
|
if (!isTodosPostgresBackend(config))
|
|
4239
4240
|
return;
|
|
4240
4241
|
if (!config.database?.url) {
|
|
4241
|
-
throw new Error(`${TODOS_STORAGE_ENV.databaseUrl} is required when
|
|
4242
|
+
throw new Error(`${TODOS_STORAGE_ENV.databaseUrl} is required when the postgresql backend is selected`);
|
|
4242
4243
|
}
|
|
4243
4244
|
}
|
|
4244
4245
|
function parseStorageBackend(value) {
|
|
4245
4246
|
const normalized = clean(value)?.toLowerCase();
|
|
4246
4247
|
if (!normalized)
|
|
4247
4248
|
return "sqlite";
|
|
4248
|
-
if (normalized === "sqlite"
|
|
4249
|
-
return
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4249
|
+
if (normalized === "sqlite")
|
|
4250
|
+
return "sqlite";
|
|
4251
|
+
if (normalized === "postgres" || normalized === "postgresql")
|
|
4252
|
+
return "postgres";
|
|
4253
|
+
if (["local", "remote", "cloud", "hybrid", "self_hosted"].includes(normalized)) {
|
|
4254
|
+
throw new Error(`${TODOS_STORAGE_ENV.databaseUrl} selects the backend. Deployment modes no longer exist: ` + `delete the storage-mode variable and set ${TODOS_STORAGE_ENV.databaseUrl} to select the ` + `postgresql backend, or leave it unset for sqlite.`);
|
|
4255
|
+
}
|
|
4256
|
+
throw new Error(`Storage backend must be sqlite or postgres`);
|
|
4254
4257
|
}
|
|
4255
4258
|
function parseStorageMode(value) {
|
|
4256
4259
|
return parseStorageBackend(value);
|
|
4257
4260
|
}
|
|
4258
4261
|
function getTodosStorageBackend(env = process.env) {
|
|
4259
|
-
|
|
4262
|
+
for (const key of REMOVED_STORAGE_MODE_ENV_KEYS) {
|
|
4263
|
+
if (Object.hasOwn(env, key) && env[key] !== undefined) {
|
|
4264
|
+
throw new Error(`${key} was removed. Deployment modes no longer exist: delete the storage-mode variable. ` + `Set ${TODOS_STORAGE_ENV.databaseUrl} to select the postgresql backend, ` + `or leave it unset for sqlite.`);
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
if (!getTodosStorageDatabaseUrl(env))
|
|
4268
|
+
return "sqlite";
|
|
4269
|
+
if (isTodosShadowEnabled(env))
|
|
4270
|
+
return "sqlite";
|
|
4271
|
+
return "postgres";
|
|
4260
4272
|
}
|
|
4261
4273
|
function getTodosStorageMode(env = process.env) {
|
|
4262
4274
|
return getTodosStorageBackend(env);
|
|
@@ -4330,7 +4342,7 @@ function parsePositiveInteger(value, fallback) {
|
|
|
4330
4342
|
}
|
|
4331
4343
|
return parsed;
|
|
4332
4344
|
}
|
|
4333
|
-
var TODOS_STORAGE_TABLES, STORAGE_TABLES, TODOS_STORAGE_ENV, TODOS_STORAGE_FALLBACK_ENV, CANONICAL_TODOS_RDS_CLUSTER_ENV = "HASNA_TODOS_RDS_CLUSTER", CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV = "HASNA_TODOS_RDS_RUNTIME_PATH", CANONICAL_TODOS_RDS_DATABASE = "todos"
|
|
4345
|
+
var TODOS_STORAGE_TABLES, STORAGE_TABLES, TODOS_STORAGE_ENV, TODOS_STORAGE_FALLBACK_ENV, REMOVED_STORAGE_MODE_ENV_KEYS, CANONICAL_TODOS_RDS_CLUSTER_ENV = "HASNA_TODOS_RDS_CLUSTER", CANONICAL_TODOS_RDS_RUNTIME_PATH_ENV = "HASNA_TODOS_RDS_RUNTIME_PATH", CANONICAL_TODOS_RDS_DATABASE = "todos";
|
|
4334
4346
|
var init_config = __esm(() => {
|
|
4335
4347
|
TODOS_STORAGE_TABLES = [
|
|
4336
4348
|
"todos_sync_records",
|
|
@@ -4338,7 +4350,6 @@ var init_config = __esm(() => {
|
|
|
4338
4350
|
];
|
|
4339
4351
|
STORAGE_TABLES = TODOS_STORAGE_TABLES;
|
|
4340
4352
|
TODOS_STORAGE_ENV = {
|
|
4341
|
-
mode: "HASNA_TODOS_STORAGE_MODE",
|
|
4342
4353
|
shadow: "HASNA_TODOS_SHADOW",
|
|
4343
4354
|
databaseUrl: "HASNA_TODOS_DATABASE_URL",
|
|
4344
4355
|
databaseSsl: "HASNA_TODOS_DATABASE_SSL",
|
|
@@ -4355,7 +4366,6 @@ var init_config = __esm(() => {
|
|
|
4355
4366
|
syncDryRun: "HASNA_TODOS_SYNC_DRY_RUN"
|
|
4356
4367
|
};
|
|
4357
4368
|
TODOS_STORAGE_FALLBACK_ENV = {
|
|
4358
|
-
mode: "TODOS_STORAGE_MODE",
|
|
4359
4369
|
shadow: "TODOS_SHADOW",
|
|
4360
4370
|
databaseUrl: "TODOS_DATABASE_URL",
|
|
4361
4371
|
databaseSsl: "TODOS_DATABASE_SSL",
|
|
@@ -4371,14 +4381,12 @@ var init_config = __esm(() => {
|
|
|
4371
4381
|
syncBatchSize: "TODOS_SYNC_BATCH_SIZE",
|
|
4372
4382
|
syncDryRun: "TODOS_SYNC_DRY_RUN"
|
|
4373
4383
|
};
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
cloud: "postgres"
|
|
4381
|
-
};
|
|
4384
|
+
REMOVED_STORAGE_MODE_ENV_KEYS = [
|
|
4385
|
+
"HASNA_TODOS_STORAGE_MODE",
|
|
4386
|
+
"HASNA_TODOS_MODE",
|
|
4387
|
+
"TODOS_STORAGE_MODE",
|
|
4388
|
+
"TODOS_MODE"
|
|
4389
|
+
];
|
|
4382
4390
|
});
|
|
4383
4391
|
|
|
4384
4392
|
// src/storage/shadow-outbox-schema.ts
|
|
@@ -7227,8 +7235,8 @@ var init_secret_redaction = __esm(() => {
|
|
|
7227
7235
|
SECRET_REDACTION_SCHEMA = ["todos", "secret_redaction", "v1"].join(".");
|
|
7228
7236
|
DEFAULT_PATTERNS = [
|
|
7229
7237
|
{ name: "openai_sk", pattern: /\bsk-[a-zA-Z0-9]{10,}\b/g },
|
|
7230
|
-
{ name: "github_pat", pattern: /\
|
|
7231
|
-
{ name: "github_oauth", pattern: /\
|
|
7238
|
+
{ name: "github_pat", pattern: /\bgh[p]_[a-zA-Z0-9]{20,}\b/g },
|
|
7239
|
+
{ name: "github_oauth", pattern: /\bgh[o]_[a-zA-Z0-9]{20,}\b/g },
|
|
7232
7240
|
{ name: "aws_access_key", pattern: /\bAKIA[0-9A-Z]{16}\b/g },
|
|
7233
7241
|
{ name: "bearer_token", pattern: /\bBearer\s+[a-zA-Z0-9\-._~+/]+=*\b/gi },
|
|
7234
7242
|
{ name: "jwt", pattern: /\beyJ[a-zA-Z0-9_-]+\.eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\b/g },
|
|
@@ -7240,7 +7248,7 @@ var init_secret_redaction = __esm(() => {
|
|
|
7240
7248
|
/example\.com/i,
|
|
7241
7249
|
/your-api-key-here/i,
|
|
7242
7250
|
/sk-test/i,
|
|
7243
|
-
/
|
|
7251
|
+
/gh[p]_xxx/i
|
|
7244
7252
|
];
|
|
7245
7253
|
customRedactors = [];
|
|
7246
7254
|
});
|
|
@@ -12833,7 +12841,7 @@ var init_dispatches = __esm(() => {
|
|
|
12833
12841
|
// package.json
|
|
12834
12842
|
var package_default = {
|
|
12835
12843
|
name: "@hasna/todos",
|
|
12836
|
-
version: "0.15.
|
|
12844
|
+
version: "0.15.34",
|
|
12837
12845
|
description: "Universal task management for AI coding agents - CLI + MCP server + interactive TUI",
|
|
12838
12846
|
type: "module",
|
|
12839
12847
|
main: "dist/index.js",
|
|
@@ -12907,9 +12915,7 @@ var package_default = {
|
|
|
12907
12915
|
"verify:release": "bun run scripts/verify-public-release.ts --mode=review",
|
|
12908
12916
|
"verify:release-review": "bun run scripts/verify-npm-release-agent-review.ts",
|
|
12909
12917
|
"verify:attested-container-candidate": "bun run scripts/attested-container-candidate.ts verify",
|
|
12910
|
-
"test:attested-container-candidate": "bun test scripts/attested-container-candidate.test.ts
|
|
12911
|
-
"emit:iapp-deployment-compatibility-vector": "bun run scripts/attested-container-compatibility-vector.ts emit",
|
|
12912
|
-
"verify:iapp-deployment-compatibility-vector": "bun run scripts/attested-container-compatibility-vector.ts verify",
|
|
12918
|
+
"test:attested-container-candidate": "bun test scripts/attested-container-candidate.test.ts",
|
|
12913
12919
|
"issue:release-review": "bun run scripts/issue-npm-release-agent-review.ts",
|
|
12914
12920
|
prepublishOnly: "bun run scripts/verify-public-release.ts --mode=publish",
|
|
12915
12921
|
postinstall: "mkdir -p $HOME/.hasna/todos $HOME/.hasna/todos/training 2>/dev/null || true"
|
|
@@ -43481,54 +43487,49 @@ function createTodosTaskManifestHttpClient(options) {
|
|
|
43481
43487
|
import { createHash as createHash16 } from "crypto";
|
|
43482
43488
|
// src/cli/cloud-router.ts
|
|
43483
43489
|
import { resolveStorageClient } from "@hasna/contracts/client/storage";
|
|
43484
|
-
import { normalizeStorageMode } from "@hasna/contracts/mode";
|
|
43485
43490
|
init_types();
|
|
43486
43491
|
init_redaction();
|
|
43487
|
-
var TRANSPORT_TOKENS = {
|
|
43488
|
-
sqlite: "sqlite",
|
|
43489
|
-
http: "http",
|
|
43490
|
-
local: "sqlite",
|
|
43491
|
-
remote: "http",
|
|
43492
|
-
self_hosted: "http",
|
|
43493
|
-
cloud: "http",
|
|
43494
|
-
hybrid: "http"
|
|
43495
|
-
};
|
|
43496
43492
|
var completionCapabilityCache = new Map;
|
|
43497
43493
|
var retryCapabilityCache = new Map;
|
|
43498
43494
|
var taskCreatorCapabilityCache = new Map;
|
|
43499
43495
|
var gitRefCapabilityCache = new Map;
|
|
43500
43496
|
var remoteCommandCapabilityCache = new Map;
|
|
43501
|
-
|
|
43502
|
-
|
|
43503
|
-
|
|
43497
|
+
var LEGACY_STORAGE_MODE_KEYS = [
|
|
43498
|
+
"HASNA_TODOS_STORAGE_MODE",
|
|
43499
|
+
"HASNA_TODOS_MODE",
|
|
43500
|
+
"TODOS_STORAGE_MODE",
|
|
43501
|
+
"TODOS_MODE"
|
|
43502
|
+
];
|
|
43503
|
+
function assertNoLegacyStorageMode(env = process.env) {
|
|
43504
|
+
for (const key2 of LEGACY_STORAGE_MODE_KEYS) {
|
|
43505
|
+
if (Object.hasOwn(env, key2) && env[key2] !== undefined) {
|
|
43506
|
+
throw new Error(`REMOTE_STORAGE_MODE_REMOVED: ${key2} was removed. Deployment modes no longer exist: delete the storage-mode variable. ` + `The client uses the on-box SQLite store, or the HTTP API selected by ` + `HASNA_TODOS_API_URL + HASNA_TODOS_API_KEY. ` + `On the server, set HASNA_TODOS_DATABASE_URL to select the postgresql backend, ` + `or leave it unset for sqlite.`);
|
|
43507
|
+
}
|
|
43508
|
+
}
|
|
43504
43509
|
}
|
|
43505
43510
|
function resolveTodosCliStorageMode(env = process.env) {
|
|
43506
|
-
|
|
43507
|
-
|
|
43508
|
-
|
|
43509
|
-
|
|
43511
|
+
assertNoLegacyStorageMode(env);
|
|
43512
|
+
const urlValue = env.HASNA_TODOS_API_URL?.trim();
|
|
43513
|
+
const keyValue = env.HASNA_TODOS_API_KEY?.trim();
|
|
43514
|
+
if (urlValue && keyValue) {
|
|
43515
|
+
return {
|
|
43516
|
+
mode: "http",
|
|
43517
|
+
transport: "http",
|
|
43518
|
+
selected: true,
|
|
43519
|
+
source: "HASNA_TODOS_API_URL+HASNA_TODOS_API_KEY"
|
|
43520
|
+
};
|
|
43510
43521
|
}
|
|
43511
|
-
|
|
43512
|
-
|
|
43513
|
-
for (const [source9, value] of [
|
|
43514
|
-
["HASNA_TODOS_STORAGE_MODE", canonical],
|
|
43515
|
-
["TODOS_STORAGE_MODE", fallback]
|
|
43516
|
-
]) {
|
|
43517
|
-
if (value && !(value in TRANSPORT_TOKENS)) {
|
|
43518
|
-
throw new Error(`REMOTE_STORAGE_MODE_INVALID: ${source9}=${value} must be sqlite (local file) or http (hosted /v1 authority); ` + "legacy values local and remote are accepted; " + "local SQLite fallback is disabled for invalid routing state");
|
|
43519
|
-
}
|
|
43522
|
+
if (urlValue) {
|
|
43523
|
+
throw new Error("REMOTE_API_KEY_MISSING: remote Todos storage requires HASNA_TODOS_API_KEY; local SQLite fallback is disabled");
|
|
43520
43524
|
}
|
|
43521
|
-
|
|
43522
|
-
|
|
43523
|
-
if (canonicalTransport && fallbackTransport && canonicalTransport !== fallbackTransport) {
|
|
43524
|
-
throw new Error(`REMOTE_STORAGE_MODE_CONFLICT: HASNA_TODOS_STORAGE_MODE=${canonical} conflicts with ` + `TODOS_STORAGE_MODE=${fallback}; local SQLite fallback is disabled`);
|
|
43525
|
+
if (keyValue) {
|
|
43526
|
+
throw new Error("REMOTE_API_URL_MISSING: remote Todos storage requires HASNA_TODOS_API_URL; local SQLite fallback is disabled");
|
|
43525
43527
|
}
|
|
43526
|
-
const transport = canonicalTransport ?? fallbackTransport ?? "sqlite";
|
|
43527
43528
|
return {
|
|
43528
|
-
mode:
|
|
43529
|
-
transport,
|
|
43530
|
-
selected:
|
|
43531
|
-
source:
|
|
43529
|
+
mode: "sqlite",
|
|
43530
|
+
transport: "sqlite",
|
|
43531
|
+
selected: false,
|
|
43532
|
+
source: "default"
|
|
43532
43533
|
};
|
|
43533
43534
|
}
|
|
43534
43535
|
function requestedTransport(env) {
|
|
@@ -43572,7 +43573,7 @@ function getTodosRemoteAuthorityConfigStatus(env = process.env) {
|
|
|
43572
43573
|
return {
|
|
43573
43574
|
selected: true,
|
|
43574
43575
|
ok: false,
|
|
43575
|
-
mode:
|
|
43576
|
+
mode: "invalid",
|
|
43576
43577
|
api_url_configured: Boolean(env.HASNA_TODOS_API_URL?.trim()),
|
|
43577
43578
|
api_key_configured: Boolean(env.HASNA_TODOS_API_KEY?.trim()),
|
|
43578
43579
|
v1_base_url: null,
|
|
@@ -43618,29 +43619,12 @@ function getTodosRemoteAuthorityConfigStatus(env = process.env) {
|
|
|
43618
43619
|
local_fallback: false
|
|
43619
43620
|
};
|
|
43620
43621
|
}
|
|
43621
|
-
var SERVER_MODE_CANDIDATES = ["postgres", "cloud", "self_hosted"];
|
|
43622
|
-
var cachedServerMode = null;
|
|
43623
|
-
function serverStorageMode(normalize2 = normalizeStorageMode) {
|
|
43624
|
-
const useCache = normalize2 === normalizeStorageMode;
|
|
43625
|
-
if (useCache && cachedServerMode !== null)
|
|
43626
|
-
return cachedServerMode;
|
|
43627
|
-
for (const candidate of SERVER_MODE_CANDIDATES) {
|
|
43628
|
-
try {
|
|
43629
|
-
normalize2(candidate);
|
|
43630
|
-
if (useCache)
|
|
43631
|
-
cachedServerMode = candidate;
|
|
43632
|
-
return candidate;
|
|
43633
|
-
} catch {}
|
|
43634
|
-
}
|
|
43635
|
-
throw new Error(`REMOTE_STORAGE_MODE_UNSUPPORTED: no known server storage mode is accepted by the installed ` + `@hasna/contracts (tried ${SERVER_MODE_CANDIDATES.join(", ")}); the storage-mode enum has changed. ` + `Add the new server token to SERVER_MODE_CANDIDATES in src/cli/cloud-router.ts; ` + `local SQLite fallback is disabled.`);
|
|
43636
|
-
}
|
|
43637
43622
|
function requireTodosRemoteAuthorityEnv(env) {
|
|
43638
43623
|
const status2 = getTodosRemoteAuthorityConfigStatus(env);
|
|
43639
43624
|
if (!status2.ok)
|
|
43640
43625
|
throw new Error(status2.issues[0]);
|
|
43641
43626
|
return {
|
|
43642
43627
|
...env,
|
|
43643
|
-
HASNA_TODOS_STORAGE_MODE: serverStorageMode(),
|
|
43644
43628
|
HASNA_TODOS_API_URL: status2.v1_base_url.replace(/\/v1$/, ""),
|
|
43645
43629
|
HASNA_TODOS_API_KEY: env.HASNA_TODOS_API_KEY.trim()
|
|
43646
43630
|
};
|
|
@@ -43732,7 +43716,12 @@ function getTodosCloudClient(env = process.env) {
|
|
|
43732
43716
|
const resolved = resolveStorageClient("todos", requireTodosRemoteAuthorityEnv(env), {
|
|
43733
43717
|
fetchImpl: (input, init) => globalThis.fetch(input, { ...init, redirect: "manual" })
|
|
43734
43718
|
});
|
|
43735
|
-
|
|
43719
|
+
if (resolved.transport === "cloud-http")
|
|
43720
|
+
return protectRemoteClient(resolved.client);
|
|
43721
|
+
const transportName = resolved.transport;
|
|
43722
|
+
if (transportName === "http")
|
|
43723
|
+
return protectRemoteClient(resolved.client);
|
|
43724
|
+
return null;
|
|
43736
43725
|
}
|
|
43737
43726
|
function unwrapTask(raw) {
|
|
43738
43727
|
if (raw && typeof raw === "object" && "task" in raw) {
|
|
@@ -45527,7 +45516,7 @@ function getNativeStorageStatus(env = process.env) {
|
|
|
45527
45516
|
const remoteEnabled = isTodosPostgresBackend(config);
|
|
45528
45517
|
const remoteFieldsConfigured = Boolean(config.database || config.objectStorage);
|
|
45529
45518
|
if (!remoteEnabled && remoteFieldsConfigured) {
|
|
45530
|
-
warnings.push(`the sqlite backend
|
|
45519
|
+
warnings.push(`the sqlite backend ignores configured remote storage fields`);
|
|
45531
45520
|
}
|
|
45532
45521
|
if (remoteEnabled && !config.objectStorage) {
|
|
45533
45522
|
warnings.push(`${TODOS_STORAGE_ENV.s3Bucket} is not configured, so artifact sync will stay local`);
|
|
@@ -45620,7 +45609,7 @@ function storageEnvStatus(env) {
|
|
|
45620
45609
|
function fallbackConfig(env) {
|
|
45621
45610
|
let mode;
|
|
45622
45611
|
try {
|
|
45623
|
-
mode =
|
|
45612
|
+
mode = getTodosStorageBackend(env);
|
|
45624
45613
|
} catch {
|
|
45625
45614
|
mode = "sqlite";
|
|
45626
45615
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assignee-validation.d.ts","sourceRoot":"","sources":["../../src/lib/assignee-validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assignee-validation.d.ts","sourceRoot":"","sources":["../../src/lib/assignee-validation.ts"],"names":[],"mappings":"AA0CA,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,gEAAgE;IAChE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACtC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACnF;IACE,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;CAC3B,CAAC;AAEN;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,GACd;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,GAAG,oBAAoB,CAgChH;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAK9C;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAgC,GAAG,GAAG,CAAC,MAAM,CAAC,CAajF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,eAAe,CAsErF"}
|