@hasna/todos 0.15.32 → 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 +124 -101
- 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 +92 -87
- package/dist/lib/assignee-validation.d.ts.map +1 -1
- package/dist/mcp/index.js +93 -87
- package/dist/mcp.js +2 -4
- package/dist/project-registration/authority.d.ts.map +1 -1
- package/dist/project-registration.js +52 -30
- package/dist/registry.js +32 -26
- package/dist/release-provenance.json +5 -5
- package/dist/server/index.js +1311 -7260
- package/dist/server/v1.d.ts.map +1 -1
- 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 +31 -23
- package/dist/task-manifest.js +4 -4
- 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/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"
|
|
@@ -27179,7 +27185,7 @@ function postgresTodosSyncSchemaSql(tableName = DEFAULT_TODOS_POSTGRES_SYNC_TABL
|
|
|
27179
27185
|
AS $$ SELECT unaccent('unaccent', $1) $$`,
|
|
27180
27186
|
`CREATE OR REPLACE FUNCTION todos_try_timestamptz(text)
|
|
27181
27187
|
RETURNS timestamptz
|
|
27182
|
-
LANGUAGE plpgsql IMMUTABLE PARALLEL
|
|
27188
|
+
LANGUAGE plpgsql IMMUTABLE PARALLEL UNSAFE
|
|
27183
27189
|
SET DateStyle TO 'ISO, YMD'
|
|
27184
27190
|
AS $$
|
|
27185
27191
|
BEGIN
|
|
@@ -36455,9 +36461,14 @@ class PackageOwnedTodosProjectRegistrationAuthority {
|
|
|
36455
36461
|
if (request.max_items !== 1) {
|
|
36456
36462
|
throw new TodosProjectRegistrationError("TODOS_PROJECT_REGISTRATION_INVALID_BOUNDS", "max_items must be exactly 1 for terminal receipt lookup");
|
|
36457
36463
|
}
|
|
36458
|
-
if (request.authority !== "todos" || request.authority_id !== this.capabilityValue.authority_id || request.tenant_id !== this.capabilityValue.tenant_id
|
|
36464
|
+
if (request.authority !== "todos" || request.authority_id !== this.capabilityValue.authority_id || request.tenant_id !== this.capabilityValue.tenant_id) {
|
|
36459
36465
|
throw new TodosProjectRegistrationError("TODOS_PROJECT_REGISTRATION_CAPABILITY_MISMATCH", "receipt lookup does not match this authority capability identity");
|
|
36460
36466
|
}
|
|
36467
|
+
requireString(request.corpus_id, "corpus_id", {
|
|
36468
|
+
min: 3,
|
|
36469
|
+
max: 128,
|
|
36470
|
+
pattern: AUTHORITY_ROUTE_PATTERN
|
|
36471
|
+
});
|
|
36461
36472
|
requireString(request.authority_route, "authority_route", {
|
|
36462
36473
|
min: 3,
|
|
36463
36474
|
max: 128,
|
|
@@ -36488,6 +36499,7 @@ class PackageOwnedTodosProjectRegistrationAuthority {
|
|
|
36488
36499
|
}
|
|
36489
36500
|
const receipt = await this.backend.getReceiptForLookup({
|
|
36490
36501
|
...authorityScope(this.capabilityValue),
|
|
36502
|
+
corpus_id: request.corpus_id,
|
|
36491
36503
|
route: request.authority_route,
|
|
36492
36504
|
package_version: request.package_version,
|
|
36493
36505
|
operation_id: request.operation_id,
|
|
@@ -36592,9 +36604,15 @@ class PackageOwnedTodosProjectRegistrationAuthority {
|
|
|
36592
36604
|
max: 128,
|
|
36593
36605
|
pattern: PACKAGE_VERSION_PATTERN
|
|
36594
36606
|
});
|
|
36607
|
+
requireString(sourceRequest.corpus_id, "corpus_id", {
|
|
36608
|
+
min: 3,
|
|
36609
|
+
max: 128,
|
|
36610
|
+
pattern: AUTHORITY_ROUTE_PATTERN
|
|
36611
|
+
});
|
|
36595
36612
|
assertForwardRequest(sourceRequest, {
|
|
36596
36613
|
...this.capabilityValue,
|
|
36597
|
-
package_version: sourceRequest.package_version
|
|
36614
|
+
package_version: sourceRequest.package_version,
|
|
36615
|
+
corpus_id: sourceRequest.corpus_id
|
|
36598
36616
|
});
|
|
36599
36617
|
const validation = await this.backend.transaction(async (transaction) => {
|
|
36600
36618
|
const storedSource = await transaction.getReceiptById(sourceReceipt.receipt_id);
|
|
@@ -36609,7 +36627,11 @@ class PackageOwnedTodosProjectRegistrationAuthority {
|
|
|
36609
36627
|
if (!receiptLineageMatches(storedSource) || !receiptLineageMatches(accepted) || storedSource.outcome === "duplicate_of_accepted" && (storedSource.duplicate_of_receipt_id !== accepted.receipt_id || storedSource.target_id !== accepted.target_id || storedSource.result_revision !== accepted.result_revision || storedSource.result_digest !== accepted.result_digest)) {
|
|
36610
36628
|
throw new TodosProjectRegistrationError("TODOS_PROJECT_REGISTRATION_ADOPTION_REJECTED", "receipt authority, operation, request, precondition, or normalized-call lineage changed");
|
|
36611
36629
|
}
|
|
36612
|
-
const binding = await transaction.getBinding(
|
|
36630
|
+
const binding = await transaction.getBinding({
|
|
36631
|
+
authority_id: sourceRequest.authority_id,
|
|
36632
|
+
tenant_id: sourceRequest.tenant_id,
|
|
36633
|
+
corpus_id: sourceRequest.corpus_id
|
|
36634
|
+
}, sourceRequest.resource_kind, sourceRequest.target_selector);
|
|
36613
36635
|
if (!binding || binding.state !== "accepted" || binding.operation_id !== sourceRequest.operation_id || binding.step_id !== sourceRequest.step_id || binding.direction !== "forward" || binding.idempotency_key !== sourceRequest.idempotency_key || binding.request_digest !== sourceRequest.request_digest || binding.precondition_digest !== sourceRequest.precondition_digest || binding.normalized_call_digest !== accepted.normalized_call_digest || binding.target_id !== accepted.target_id || binding.accepted_receipt_id !== accepted.receipt_id || binding.result_revision !== accepted.result_revision || binding.result_digest !== accepted.result_digest) {
|
|
36614
36636
|
throw new TodosProjectRegistrationError("TODOS_PROJECT_REGISTRATION_ADOPTION_REJECTED", "accepted binding does not match the exact accepted receipt and source lineage");
|
|
36615
36637
|
}
|
|
@@ -43465,54 +43487,49 @@ function createTodosTaskManifestHttpClient(options) {
|
|
|
43465
43487
|
import { createHash as createHash16 } from "crypto";
|
|
43466
43488
|
// src/cli/cloud-router.ts
|
|
43467
43489
|
import { resolveStorageClient } from "@hasna/contracts/client/storage";
|
|
43468
|
-
import { normalizeStorageMode } from "@hasna/contracts/mode";
|
|
43469
43490
|
init_types();
|
|
43470
43491
|
init_redaction();
|
|
43471
|
-
var TRANSPORT_TOKENS = {
|
|
43472
|
-
sqlite: "sqlite",
|
|
43473
|
-
http: "http",
|
|
43474
|
-
local: "sqlite",
|
|
43475
|
-
remote: "http",
|
|
43476
|
-
self_hosted: "http",
|
|
43477
|
-
cloud: "http",
|
|
43478
|
-
hybrid: "http"
|
|
43479
|
-
};
|
|
43480
43492
|
var completionCapabilityCache = new Map;
|
|
43481
43493
|
var retryCapabilityCache = new Map;
|
|
43482
43494
|
var taskCreatorCapabilityCache = new Map;
|
|
43483
43495
|
var gitRefCapabilityCache = new Map;
|
|
43484
43496
|
var remoteCommandCapabilityCache = new Map;
|
|
43485
|
-
|
|
43486
|
-
|
|
43487
|
-
|
|
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
|
+
}
|
|
43488
43509
|
}
|
|
43489
43510
|
function resolveTodosCliStorageMode(env = process.env) {
|
|
43490
|
-
|
|
43491
|
-
|
|
43492
|
-
|
|
43493
|
-
|
|
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
|
+
};
|
|
43494
43521
|
}
|
|
43495
|
-
|
|
43496
|
-
|
|
43497
|
-
for (const [source9, value] of [
|
|
43498
|
-
["HASNA_TODOS_STORAGE_MODE", canonical],
|
|
43499
|
-
["TODOS_STORAGE_MODE", fallback]
|
|
43500
|
-
]) {
|
|
43501
|
-
if (value && !(value in TRANSPORT_TOKENS)) {
|
|
43502
|
-
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");
|
|
43503
|
-
}
|
|
43522
|
+
if (urlValue) {
|
|
43523
|
+
throw new Error("REMOTE_API_KEY_MISSING: remote Todos storage requires HASNA_TODOS_API_KEY; local SQLite fallback is disabled");
|
|
43504
43524
|
}
|
|
43505
|
-
|
|
43506
|
-
|
|
43507
|
-
if (canonicalTransport && fallbackTransport && canonicalTransport !== fallbackTransport) {
|
|
43508
|
-
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");
|
|
43509
43527
|
}
|
|
43510
|
-
const transport = canonicalTransport ?? fallbackTransport ?? "sqlite";
|
|
43511
43528
|
return {
|
|
43512
|
-
mode:
|
|
43513
|
-
transport,
|
|
43514
|
-
selected:
|
|
43515
|
-
source:
|
|
43529
|
+
mode: "sqlite",
|
|
43530
|
+
transport: "sqlite",
|
|
43531
|
+
selected: false,
|
|
43532
|
+
source: "default"
|
|
43516
43533
|
};
|
|
43517
43534
|
}
|
|
43518
43535
|
function requestedTransport(env) {
|
|
@@ -43556,7 +43573,7 @@ function getTodosRemoteAuthorityConfigStatus(env = process.env) {
|
|
|
43556
43573
|
return {
|
|
43557
43574
|
selected: true,
|
|
43558
43575
|
ok: false,
|
|
43559
|
-
mode:
|
|
43576
|
+
mode: "invalid",
|
|
43560
43577
|
api_url_configured: Boolean(env.HASNA_TODOS_API_URL?.trim()),
|
|
43561
43578
|
api_key_configured: Boolean(env.HASNA_TODOS_API_KEY?.trim()),
|
|
43562
43579
|
v1_base_url: null,
|
|
@@ -43602,29 +43619,12 @@ function getTodosRemoteAuthorityConfigStatus(env = process.env) {
|
|
|
43602
43619
|
local_fallback: false
|
|
43603
43620
|
};
|
|
43604
43621
|
}
|
|
43605
|
-
var SERVER_MODE_CANDIDATES = ["postgres", "cloud", "self_hosted"];
|
|
43606
|
-
var cachedServerMode = null;
|
|
43607
|
-
function serverStorageMode(normalize2 = normalizeStorageMode) {
|
|
43608
|
-
const useCache = normalize2 === normalizeStorageMode;
|
|
43609
|
-
if (useCache && cachedServerMode !== null)
|
|
43610
|
-
return cachedServerMode;
|
|
43611
|
-
for (const candidate of SERVER_MODE_CANDIDATES) {
|
|
43612
|
-
try {
|
|
43613
|
-
normalize2(candidate);
|
|
43614
|
-
if (useCache)
|
|
43615
|
-
cachedServerMode = candidate;
|
|
43616
|
-
return candidate;
|
|
43617
|
-
} catch {}
|
|
43618
|
-
}
|
|
43619
|
-
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.`);
|
|
43620
|
-
}
|
|
43621
43622
|
function requireTodosRemoteAuthorityEnv(env) {
|
|
43622
43623
|
const status2 = getTodosRemoteAuthorityConfigStatus(env);
|
|
43623
43624
|
if (!status2.ok)
|
|
43624
43625
|
throw new Error(status2.issues[0]);
|
|
43625
43626
|
return {
|
|
43626
43627
|
...env,
|
|
43627
|
-
HASNA_TODOS_STORAGE_MODE: serverStorageMode(),
|
|
43628
43628
|
HASNA_TODOS_API_URL: status2.v1_base_url.replace(/\/v1$/, ""),
|
|
43629
43629
|
HASNA_TODOS_API_KEY: env.HASNA_TODOS_API_KEY.trim()
|
|
43630
43630
|
};
|
|
@@ -43700,7 +43700,7 @@ async function requiredRemoteRoute(client, route, request, recognized404Codes =
|
|
|
43700
43700
|
return await request();
|
|
43701
43701
|
} catch (error) {
|
|
43702
43702
|
const status2 = error && typeof error === "object" ? error.status : undefined;
|
|
43703
|
-
if (status2 === 404) {
|
|
43703
|
+
if (status2 === 404 || status2 === 405) {
|
|
43704
43704
|
const body2 = error && typeof error === "object" ? error.body : undefined;
|
|
43705
43705
|
const code = body2 && typeof body2 === "object" && !Array.isArray(body2) ? body2.code : undefined;
|
|
43706
43706
|
if (typeof code === "string" && recognized404Codes.includes(code))
|
|
@@ -43716,7 +43716,12 @@ function getTodosCloudClient(env = process.env) {
|
|
|
43716
43716
|
const resolved = resolveStorageClient("todos", requireTodosRemoteAuthorityEnv(env), {
|
|
43717
43717
|
fetchImpl: (input, init) => globalThis.fetch(input, { ...init, redirect: "manual" })
|
|
43718
43718
|
});
|
|
43719
|
-
|
|
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;
|
|
43720
43725
|
}
|
|
43721
43726
|
function unwrapTask(raw) {
|
|
43722
43727
|
if (raw && typeof raw === "object" && "task" in raw) {
|
|
@@ -45511,7 +45516,7 @@ function getNativeStorageStatus(env = process.env) {
|
|
|
45511
45516
|
const remoteEnabled = isTodosPostgresBackend(config);
|
|
45512
45517
|
const remoteFieldsConfigured = Boolean(config.database || config.objectStorage);
|
|
45513
45518
|
if (!remoteEnabled && remoteFieldsConfigured) {
|
|
45514
|
-
warnings.push(`the sqlite backend
|
|
45519
|
+
warnings.push(`the sqlite backend ignores configured remote storage fields`);
|
|
45515
45520
|
}
|
|
45516
45521
|
if (remoteEnabled && !config.objectStorage) {
|
|
45517
45522
|
warnings.push(`${TODOS_STORAGE_ENV.s3Bucket} is not configured, so artifact sync will stay local`);
|
|
@@ -45604,7 +45609,7 @@ function storageEnvStatus(env) {
|
|
|
45604
45609
|
function fallbackConfig(env) {
|
|
45605
45610
|
let mode;
|
|
45606
45611
|
try {
|
|
45607
|
-
mode =
|
|
45612
|
+
mode = getTodosStorageBackend(env);
|
|
45608
45613
|
} catch {
|
|
45609
45614
|
mode = "sqlite";
|
|
45610
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"}
|