@hasna/instructions 0.4.15 → 0.4.17
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/README.md +29 -9
- package/dist/cli/index.js +109 -10
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -10
- package/dist/lib/apply-text-format-credential-guard.test.d.ts +2 -0
- package/dist/lib/apply-text-format-credential-guard.test.d.ts.map +1 -0
- package/dist/lib/apply.d.ts.map +1 -1
- package/dist/lib/codewith-shared-todos-storage-standard.d.ts +7 -0
- package/dist/lib/codewith-shared-todos-storage-standard.d.ts.map +1 -0
- package/dist/lib/codewith-shared-todos-storage-standard.test.d.ts +2 -0
- package/dist/lib/codewith-shared-todos-storage-standard.test.d.ts.map +1 -0
- package/dist/lib/redact.d.ts +24 -0
- package/dist/lib/redact.d.ts.map +1 -1
- package/dist/lib/session-apply.d.ts.map +1 -1
- package/dist/lib/session-render.d.ts +11 -0
- package/dist/lib/session-render.d.ts.map +1 -1
- package/dist/lib/sync.d.ts.map +1 -1
- package/dist/mcp/index.js +59 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
# @hasna/instructions
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
share all your AI coding configs and instruction sources. CLI + MCP + HTTP API
|
|
8
|
-
(`instructions-serve`) + generated SDK + Dashboard.
|
|
3
|
+
`@hasna/instructions` stores, versions, renders, and applies configuration and
|
|
4
|
+
instruction sources for developers and platform teams operating AI coding
|
|
5
|
+
agents. Install the CLI with `bun add --global @hasna/instructions`; the package
|
|
6
|
+
also provides MCP, HTTP API, and SDK surfaces.
|
|
9
7
|
|
|
10
8
|
[](https://www.npmjs.com/package/@hasna/instructions)
|
|
11
9
|
[](LICENSE)
|
|
@@ -13,9 +11,24 @@ share all your AI coding configs and instruction sources. CLI + MCP + HTTP API
|
|
|
13
11
|
## Install
|
|
14
12
|
|
|
15
13
|
```bash
|
|
16
|
-
|
|
14
|
+
bun add --global @hasna/instructions
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
instructions --help
|
|
21
|
+
instructions init
|
|
22
|
+
instructions list
|
|
23
|
+
instructions profile resolve
|
|
17
24
|
```
|
|
18
25
|
|
|
26
|
+
## Migrating from `@hasna/configs`
|
|
27
|
+
|
|
28
|
+
This package was formerly `@hasna/configs`. The `configs` CLI alias and
|
|
29
|
+
`configs-mcp` alias remain available for existing integrations; new usage can
|
|
30
|
+
use the `instructions` names.
|
|
31
|
+
|
|
19
32
|
## CLI Usage
|
|
20
33
|
|
|
21
34
|
```bash
|
|
@@ -286,14 +299,21 @@ push safety, no brittle hardcoding when source-of-truth or reusable abstractions
|
|
|
286
299
|
exist, autonomous repair, Hasna CLI source-of-truth usage, conversation surface
|
|
287
300
|
routing, and unbudgeted Codewith goals unless a user asks for budgets.
|
|
288
301
|
|
|
289
|
-
They also seed `dangerous-operation-guard-standard`, the managed
|
|
290
|
-
|
|
302
|
+
They also seed `dangerous-operation-guard-standard`, the managed guard source
|
|
303
|
+
for risky shell commands, edits, git operations, package installs, and
|
|
291
304
|
secret-adjacent access. The guard excludes Gemini CLI, requires Codewith/Codex
|
|
292
305
|
`PreToolUse` to hard-deny or inject context rather than ask for approval, uses
|
|
293
306
|
`PermissionRequest` for Codewith/Codex approvals, records that Qwen `QWEN.md`
|
|
294
307
|
is policy context only, and records native hook or wrapper/plugin fallback
|
|
295
308
|
expectations for Claude, Qwen, OpenCode, Cursor, and Antigravity.
|
|
296
309
|
|
|
310
|
+
The Codewith-only `codewith-shared-todos-storage-standard` requires every
|
|
311
|
+
operational repository, work or research project, coordinator, worker, and loop
|
|
312
|
+
to use the managed shared Todos route. On-box SQLite or file Todos storage is limited
|
|
313
|
+
to disposable repository tests. Projects linkage and sanitized server-route
|
|
314
|
+
verification are required before mutation; unavailable routing fails closed,
|
|
315
|
+
and prior on-box-only evidence must be explicitly reconciled before use.
|
|
316
|
+
|
|
297
317
|
## Machine-aware Profiles
|
|
298
318
|
|
|
299
319
|
`instructions init` seeds two platform profiles:
|
package/dist/cli/index.js
CHANGED
|
@@ -3412,6 +3412,86 @@ var init_global_agent_rules_standard = __esm(() => {
|
|
|
3412
3412
|
`;
|
|
3413
3413
|
});
|
|
3414
3414
|
|
|
3415
|
+
// src/lib/codewith-shared-todos-storage-standard.ts
|
|
3416
|
+
async function ensureCodewithSharedTodosStorageStandardConfig(store = resolveConfigStore()) {
|
|
3417
|
+
const input = {
|
|
3418
|
+
name: "Codewith Shared Todos Storage Standard",
|
|
3419
|
+
category: "rules",
|
|
3420
|
+
agent: "codewith",
|
|
3421
|
+
format: "markdown",
|
|
3422
|
+
content: CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT,
|
|
3423
|
+
kind: "reference",
|
|
3424
|
+
description: "Managed fail-closed shared Todos routing policy for all operational Codewith work",
|
|
3425
|
+
tags: [
|
|
3426
|
+
"codewith",
|
|
3427
|
+
"shared-todos-storage",
|
|
3428
|
+
"server-backed",
|
|
3429
|
+
"projects-linkage",
|
|
3430
|
+
"operational-routing"
|
|
3431
|
+
]
|
|
3432
|
+
};
|
|
3433
|
+
let config;
|
|
3434
|
+
try {
|
|
3435
|
+
const existing = await store.getConfig(CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG);
|
|
3436
|
+
if (existing.content !== input.content || existing.description !== input.description || existing.category !== input.category || existing.agent !== input.agent || existing.format !== input.format || existing.kind !== input.kind || JSON.stringify(existing.tags) !== JSON.stringify(input.tags)) {
|
|
3437
|
+
config = await store.updateConfig(existing.id, input);
|
|
3438
|
+
} else {
|
|
3439
|
+
config = existing;
|
|
3440
|
+
}
|
|
3441
|
+
} catch {
|
|
3442
|
+
config = await store.createConfig(input);
|
|
3443
|
+
}
|
|
3444
|
+
for (const profile of await store.listProfiles()) {
|
|
3445
|
+
await store.addConfigToProfile(profile.id, config.id);
|
|
3446
|
+
}
|
|
3447
|
+
return config;
|
|
3448
|
+
}
|
|
3449
|
+
var CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG = "codewith-shared-todos-storage-standard", CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE = "codewith/shared-todos-storage/v1", CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT;
|
|
3450
|
+
var init_codewith_shared_todos_storage_standard = __esm(() => {
|
|
3451
|
+
init_config_store();
|
|
3452
|
+
CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT = `# Codewith Shared Todos Storage Standard
|
|
3453
|
+
|
|
3454
|
+
Policy reference: \`${CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE}\`
|
|
3455
|
+
|
|
3456
|
+
## Scope
|
|
3457
|
+
|
|
3458
|
+
- This policy applies to all operational Codewith work: repositories of every
|
|
3459
|
+
name, work projects, research projects, coordinators, delegated workers, and
|
|
3460
|
+
native scheduled or recurring loops. It is not limited to \`open-*\` or
|
|
3461
|
+
\`iapp-*\` repositories.
|
|
3462
|
+
|
|
3463
|
+
## Authoritative Storage
|
|
3464
|
+
|
|
3465
|
+
- Operational Todos state must use the managed shared Todos service.
|
|
3466
|
+
On-box SQLite or file storage is permitted only inside disposable,
|
|
3467
|
+
repository-owned tests using isolated test-controlled paths.
|
|
3468
|
+
- On-box SQLite or file storage must never hold operational tasks, plans, locks or claims,
|
|
3469
|
+
comments, verification evidence, dispatch state, or handoff state. Never
|
|
3470
|
+
fall back to on-box-only storage to keep operational work moving.
|
|
3471
|
+
|
|
3472
|
+
## Pre-Mutation Gate
|
|
3473
|
+
|
|
3474
|
+
- Before any operational Todos mutation, require authoritative Projects
|
|
3475
|
+
linkage and verify from sanitized status or route metadata that Todos resolves
|
|
3476
|
+
to the managed server-backed route. Verification may identify the route class,
|
|
3477
|
+
backend class, and linked project identifiers, but must omit credentials,
|
|
3478
|
+
tokens, DSNs, and full endpoint URLs.
|
|
3479
|
+
- If Projects linkage or server-backed route verification is missing, ambiguous,
|
|
3480
|
+
unavailable, or reports an on-box SQLite or file route, fail closed: do not mutate Todos.
|
|
3481
|
+
Diagnose and repair the owning configuration or service route, re-run the
|
|
3482
|
+
sanitized verification, and report the blockage or repair on the approved
|
|
3483
|
+
operational surface without exposing secrets.
|
|
3484
|
+
|
|
3485
|
+
## Reconciliation
|
|
3486
|
+
|
|
3487
|
+
- Prior on-box-only tasks, plans, comments, locks, verification, dispatch, or
|
|
3488
|
+
handoff evidence are not authoritative. Explicitly reconcile each required
|
|
3489
|
+
record into the Projects-linked shared Todos record, retain bounded provenance
|
|
3490
|
+
identifiers, and independently verify the shared result before treating it as
|
|
3491
|
+
authoritative. Never silently copy, discard, or bless on-box-only evidence.
|
|
3492
|
+
`;
|
|
3493
|
+
});
|
|
3494
|
+
|
|
3415
3495
|
// node_modules/zod/v3/helpers/util.js
|
|
3416
3496
|
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
3417
3497
|
const t = typeof data;
|
|
@@ -7529,6 +7609,14 @@ function reasonFor(key, value) {
|
|
|
7529
7609
|
function isReferenceValue(value) {
|
|
7530
7610
|
return /^\{\{[A-Z][A-Z0-9_]*\}\}$/.test(value) || /^\$\{[A-Z][A-Z0-9_]*\}$/.test(value) || /^\$[A-Z][A-Z0-9_]*$/.test(value) || /^%[A-Z][A-Z0-9_]*%$/.test(value);
|
|
7531
7611
|
}
|
|
7612
|
+
function redactFormatForTarget(targetPath, storedFormat) {
|
|
7613
|
+
const p = targetPath.toLowerCase();
|
|
7614
|
+
if (/(^|\/)\.(zshrc|zprofile|bashrc|bash_profile|profile|zshenv|env)$/.test(p) || p.endsWith(".env"))
|
|
7615
|
+
return "shell";
|
|
7616
|
+
if (/(^|\/)\.(npmrc|yarnrc|curlrc|netrc)$/.test(p))
|
|
7617
|
+
return "ini";
|
|
7618
|
+
return storedFormat;
|
|
7619
|
+
}
|
|
7532
7620
|
function redactContent(content, format) {
|
|
7533
7621
|
switch (format) {
|
|
7534
7622
|
case "shell":
|
|
@@ -10983,6 +11071,7 @@ function planSessionRender(input) {
|
|
|
10983
11071
|
writable: !blocked,
|
|
10984
11072
|
blocked,
|
|
10985
11073
|
blockers,
|
|
11074
|
+
allowEmptySources,
|
|
10986
11075
|
env,
|
|
10987
11076
|
files,
|
|
10988
11077
|
manifest,
|
|
@@ -11005,6 +11094,7 @@ function sourceFromFilePath(path, content, order = 0) {
|
|
|
11005
11094
|
}
|
|
11006
11095
|
function sourceFromConfig(config, order = 0, layer) {
|
|
11007
11096
|
const isAgentOperatingRules = config.slug === GLOBAL_AGENT_RULES_STANDARD_SLUG;
|
|
11097
|
+
const isNonOverridableManagedPolicy = isAgentOperatingRules || config.slug === CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG;
|
|
11008
11098
|
const rules = isAgentOperatingRules ? resolveAgentOperatingRulesPayload(config.content) : null;
|
|
11009
11099
|
return {
|
|
11010
11100
|
id: config.slug,
|
|
@@ -11023,7 +11113,7 @@ function sourceFromConfig(config, order = 0, layer) {
|
|
|
11023
11113
|
configAgent: config.agent
|
|
11024
11114
|
},
|
|
11025
11115
|
metadata: rules ? { ...rules.metadata } : null,
|
|
11026
|
-
nonOverridable:
|
|
11116
|
+
nonOverridable: isNonOverridableManagedPolicy
|
|
11027
11117
|
};
|
|
11028
11118
|
}
|
|
11029
11119
|
function sourcesFromIdentityExport(value, options = {}) {
|
|
@@ -11313,6 +11403,7 @@ function asStringArray(value) {
|
|
|
11313
11403
|
var RAW_STORE_ROOT_ENV = "HASNA_CONFIGS_HOME", ANTIGRAVITY_RULE_FILE_CHAR_LIMIT = 12000, SESSION_RENDERER_OWNER_ID = "instructions-session-renderer", SESSION_RENDER_TOOLS, SESSION_RENDER_PROFILE_ENTRYPOINTS, SESSION_RENDER_OWNED_CONFIG_TARGETS, CODEWITH_FLATTENED_ADAPTER, CODEWITH_NATIVE_ADAPTER, SESSION_TOOL_ADAPTERS, SESSION_RENDER_MANAGED_DIRS, SESSION_RENDER_SHARED_MANAGED_DIRS, SESSION_RENDER_EXCLUSIVE_MANAGED_PATHS, SESSION_LAYER_RANK, CANONICAL_IDENTITY_EXPORT_PACKAGES;
|
|
11314
11404
|
var init_session_render = __esm(() => {
|
|
11315
11405
|
init_global_agent_rules_standard();
|
|
11406
|
+
init_codewith_shared_todos_storage_standard();
|
|
11316
11407
|
init_project_context();
|
|
11317
11408
|
init_config_agents();
|
|
11318
11409
|
init_transforms();
|
|
@@ -11633,7 +11724,7 @@ function wouldDestroyACredential(targetPath, renderedContent, format) {
|
|
|
11633
11724
|
}
|
|
11634
11725
|
if (current === renderedContent)
|
|
11635
11726
|
return [];
|
|
11636
|
-
if (scanSecrets(current, format).length > 0)
|
|
11727
|
+
if (scanSecrets(current, redactFormatForTarget(targetPath, format)).length > 0)
|
|
11637
11728
|
return secretTokens;
|
|
11638
11729
|
return secretTokens.filter((name) => countPlaceholder(current, name) < countPlaceholder(renderedContent, name));
|
|
11639
11730
|
}
|
|
@@ -12354,14 +12445,6 @@ function redactionPlaceholders(storedLine) {
|
|
|
12354
12445
|
}
|
|
12355
12446
|
return found;
|
|
12356
12447
|
}
|
|
12357
|
-
function redactFormatForTarget(targetPath, storedFormat) {
|
|
12358
|
-
const p = targetPath.toLowerCase();
|
|
12359
|
-
if (/(^|\/)\.(zshrc|zprofile|bashrc|bash_profile|profile|zshenv|env)$/.test(p) || p.endsWith(".env"))
|
|
12360
|
-
return "shell";
|
|
12361
|
-
if (/(^|\/)\.(npmrc|yarnrc|curlrc|netrc)$/.test(p))
|
|
12362
|
-
return "ini";
|
|
12363
|
-
return storedFormat;
|
|
12364
|
-
}
|
|
12365
12448
|
function storedPlaceholderIsLiteralOnDisk(storedLine, diskLine) {
|
|
12366
12449
|
return redactionPlaceholders(storedLine).some((p) => !diskLine.includes(p));
|
|
12367
12450
|
}
|
|
@@ -13865,6 +13948,7 @@ function applySessionRenderUnlocked(plan, options, coordination) {
|
|
|
13865
13948
|
...files.map((file) => planFileResult(plan, file, targetHome, previousHashes, previousManifest, options)),
|
|
13866
13949
|
...planStaleFileResults(plan, targetHome, previousManifest, currentRelativePaths, options)
|
|
13867
13950
|
];
|
|
13951
|
+
assertNotSilentManagedWipeout(plan, results);
|
|
13868
13952
|
const conflicts = results.filter((result) => result.action === "conflict");
|
|
13869
13953
|
if (conflicts.length > 0) {
|
|
13870
13954
|
return {
|
|
@@ -14437,6 +14521,19 @@ function planFileResult(plan, file, targetHome, previousHashes, previousManifest
|
|
|
14437
14521
|
reason: "existing unmanaged file differs; pass force to overwrite"
|
|
14438
14522
|
};
|
|
14439
14523
|
}
|
|
14524
|
+
function assertNotSilentManagedWipeout(plan, results) {
|
|
14525
|
+
if (plan.allowEmptySources)
|
|
14526
|
+
return;
|
|
14527
|
+
const managedDir = plan.adapter.managedDir;
|
|
14528
|
+
const underManagedDir = (relativePath) => relativePath === managedDir || relativePath.startsWith(`${managedDir}/`);
|
|
14529
|
+
const staleDeletions = results.filter((result) => result.action === "delete" && underManagedDir(result.relativePath));
|
|
14530
|
+
if (staleDeletions.length === 0)
|
|
14531
|
+
return;
|
|
14532
|
+
const managedRetained = results.some((result) => result.action !== "delete" && underManagedDir(result.relativePath));
|
|
14533
|
+
if (managedRetained)
|
|
14534
|
+
return;
|
|
14535
|
+
throw new SessionApplyError(`Session render plan for ${plan.tool} (${plan.adapter.mode}) would delete ${staleDeletions.length} ` + `previously managed file(s) under "${managedDir}" and create or update none there: ` + `${staleDeletions.map((result) => result.relativePath).join(", ")}. ` + "Pass --allow-empty-sources only for explicit empty renders.");
|
|
14536
|
+
}
|
|
14440
14537
|
function planStaleFileResults(plan, targetHome, previousManifest, currentRelativePaths, options) {
|
|
14441
14538
|
if (!previousManifest)
|
|
14442
14539
|
return [];
|
|
@@ -14974,6 +15071,7 @@ async function ensureDangerousOperationGuardStandardConfig(store = resolveConfig
|
|
|
14974
15071
|
}
|
|
14975
15072
|
|
|
14976
15073
|
// src/cli/index.tsx
|
|
15074
|
+
init_codewith_shared_todos_storage_standard();
|
|
14977
15075
|
init_project_context();
|
|
14978
15076
|
|
|
14979
15077
|
// src/status.ts
|
|
@@ -16431,6 +16529,7 @@ Keys: ANTHROPIC_API_KEY, OPENAI_API_KEY, EXA_API_KEY, NPM_TOKEN, GITHUB_TOKEN`,
|
|
|
16431
16529
|
}
|
|
16432
16530
|
await ensureGlobalAgentRulesStandardConfig(store);
|
|
16433
16531
|
await ensureDangerousOperationGuardStandardConfig(store);
|
|
16532
|
+
await ensureCodewithSharedTodosStorageStandardConfig(store);
|
|
16434
16533
|
await ensureProjectDashboardStandardConfig(store);
|
|
16435
16534
|
try {
|
|
16436
16535
|
await store.getProfile("my-setup");
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { PLATFORM_PROFILE_PRESETS, ensurePlatformProfiles } from "./lib/platform
|
|
|
22
22
|
export { PROJECT_DASHBOARD_PROFILE_VARIABLES, PROJECT_DASHBOARD_STANDARD_CONTENT, PROJECT_DASHBOARD_STANDARD_SLUG, ensureProjectDashboardStandardConfig, } from "./lib/project-dashboard-standard.js";
|
|
23
23
|
export { AGENT_OPERATING_RULES_SEMANTIC_POLICY_KEY, AGENT_OPERATING_RULES_SENTINEL_PATTERN, GLOBAL_AGENT_RULES_STANDARD_CONTENT, GLOBAL_AGENT_RULES_STANDARD_SLUG, compareAgentOperatingRulesVersions, ensureGlobalAgentRulesStandardConfig, parseAgentOperatingRulesVersion, resolveAgentOperatingRulesPayload, type AgentOperatingRulesPayload, type AgentOperatingRulesPayloadIntegrity, type AgentOperatingRulesPayloadOrigin, } from "./lib/global-agent-rules-standard.js";
|
|
24
24
|
export { DANGEROUS_OPERATION_GUARD_STANDARD_CONTENT, DANGEROUS_OPERATION_GUARD_STANDARD_SLUG, ensureDangerousOperationGuardStandardConfig, } from "./lib/dangerous-operation-guard-standard.js";
|
|
25
|
+
export { CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE, CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT, CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG, ensureCodewithSharedTodosStorageStandardConfig, } from "./lib/codewith-shared-todos-storage-standard.js";
|
|
25
26
|
export { syncKnown, syncToDisk, syncProject, diffConfig, detectCategory, detectAgent, detectFormat, KNOWN_CONFIGS, PROJECT_CONFIG_FILES } from "./lib/sync.js";
|
|
26
27
|
export { syncFromDir, syncToDir } from "./lib/sync-dir.js";
|
|
27
28
|
export type { SyncKnownOptions, SyncToDiskOptions, SyncProjectOptions, KnownConfig } from "./lib/sync.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AAIjC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGvE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,sBAAsB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/G,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,2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xB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1336,6 +1336,84 @@ async function ensureGlobalAgentRulesStandardConfig(store = resolveConfigStore()
|
|
|
1336
1336
|
return existing;
|
|
1337
1337
|
}
|
|
1338
1338
|
|
|
1339
|
+
// src/lib/codewith-shared-todos-storage-standard.ts
|
|
1340
|
+
var CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG = "codewith-shared-todos-storage-standard";
|
|
1341
|
+
var CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE = "codewith/shared-todos-storage/v1";
|
|
1342
|
+
var CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT = `# Codewith Shared Todos Storage Standard
|
|
1343
|
+
|
|
1344
|
+
Policy reference: \`${CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE}\`
|
|
1345
|
+
|
|
1346
|
+
## Scope
|
|
1347
|
+
|
|
1348
|
+
- This policy applies to all operational Codewith work: repositories of every
|
|
1349
|
+
name, work projects, research projects, coordinators, delegated workers, and
|
|
1350
|
+
native scheduled or recurring loops. It is not limited to \`open-*\` or
|
|
1351
|
+
\`iapp-*\` repositories.
|
|
1352
|
+
|
|
1353
|
+
## Authoritative Storage
|
|
1354
|
+
|
|
1355
|
+
- Operational Todos state must use the managed shared Todos service.
|
|
1356
|
+
On-box SQLite or file storage is permitted only inside disposable,
|
|
1357
|
+
repository-owned tests using isolated test-controlled paths.
|
|
1358
|
+
- On-box SQLite or file storage must never hold operational tasks, plans, locks or claims,
|
|
1359
|
+
comments, verification evidence, dispatch state, or handoff state. Never
|
|
1360
|
+
fall back to on-box-only storage to keep operational work moving.
|
|
1361
|
+
|
|
1362
|
+
## Pre-Mutation Gate
|
|
1363
|
+
|
|
1364
|
+
- Before any operational Todos mutation, require authoritative Projects
|
|
1365
|
+
linkage and verify from sanitized status or route metadata that Todos resolves
|
|
1366
|
+
to the managed server-backed route. Verification may identify the route class,
|
|
1367
|
+
backend class, and linked project identifiers, but must omit credentials,
|
|
1368
|
+
tokens, DSNs, and full endpoint URLs.
|
|
1369
|
+
- If Projects linkage or server-backed route verification is missing, ambiguous,
|
|
1370
|
+
unavailable, or reports an on-box SQLite or file route, fail closed: do not mutate Todos.
|
|
1371
|
+
Diagnose and repair the owning configuration or service route, re-run the
|
|
1372
|
+
sanitized verification, and report the blockage or repair on the approved
|
|
1373
|
+
operational surface without exposing secrets.
|
|
1374
|
+
|
|
1375
|
+
## Reconciliation
|
|
1376
|
+
|
|
1377
|
+
- Prior on-box-only tasks, plans, comments, locks, verification, dispatch, or
|
|
1378
|
+
handoff evidence are not authoritative. Explicitly reconcile each required
|
|
1379
|
+
record into the Projects-linked shared Todos record, retain bounded provenance
|
|
1380
|
+
identifiers, and independently verify the shared result before treating it as
|
|
1381
|
+
authoritative. Never silently copy, discard, or bless on-box-only evidence.
|
|
1382
|
+
`;
|
|
1383
|
+
async function ensureCodewithSharedTodosStorageStandardConfig(store = resolveConfigStore()) {
|
|
1384
|
+
const input = {
|
|
1385
|
+
name: "Codewith Shared Todos Storage Standard",
|
|
1386
|
+
category: "rules",
|
|
1387
|
+
agent: "codewith",
|
|
1388
|
+
format: "markdown",
|
|
1389
|
+
content: CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT,
|
|
1390
|
+
kind: "reference",
|
|
1391
|
+
description: "Managed fail-closed shared Todos routing policy for all operational Codewith work",
|
|
1392
|
+
tags: [
|
|
1393
|
+
"codewith",
|
|
1394
|
+
"shared-todos-storage",
|
|
1395
|
+
"server-backed",
|
|
1396
|
+
"projects-linkage",
|
|
1397
|
+
"operational-routing"
|
|
1398
|
+
]
|
|
1399
|
+
};
|
|
1400
|
+
let config;
|
|
1401
|
+
try {
|
|
1402
|
+
const existing = await store.getConfig(CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG);
|
|
1403
|
+
if (existing.content !== input.content || existing.description !== input.description || existing.category !== input.category || existing.agent !== input.agent || existing.format !== input.format || existing.kind !== input.kind || JSON.stringify(existing.tags) !== JSON.stringify(input.tags)) {
|
|
1404
|
+
config = await store.updateConfig(existing.id, input);
|
|
1405
|
+
} else {
|
|
1406
|
+
config = existing;
|
|
1407
|
+
}
|
|
1408
|
+
} catch {
|
|
1409
|
+
config = await store.createConfig(input);
|
|
1410
|
+
}
|
|
1411
|
+
for (const profile of await store.listProfiles()) {
|
|
1412
|
+
await store.addConfigToProfile(profile.id, config.id);
|
|
1413
|
+
}
|
|
1414
|
+
return config;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1339
1417
|
// src/lib/project-context.ts
|
|
1340
1418
|
import { createHash as createHash2, randomUUID as randomUUID3 } from "crypto";
|
|
1341
1419
|
import { execFileSync } from "child_process";
|
|
@@ -5494,6 +5572,14 @@ function reasonFor(key, value) {
|
|
|
5494
5572
|
function isReferenceValue(value) {
|
|
5495
5573
|
return /^\{\{[A-Z][A-Z0-9_]*\}\}$/.test(value) || /^\$\{[A-Z][A-Z0-9_]*\}$/.test(value) || /^\$[A-Z][A-Z0-9_]*$/.test(value) || /^%[A-Z][A-Z0-9_]*%$/.test(value);
|
|
5496
5574
|
}
|
|
5575
|
+
function redactFormatForTarget(targetPath, storedFormat) {
|
|
5576
|
+
const p = targetPath.toLowerCase();
|
|
5577
|
+
if (/(^|\/)\.(zshrc|zprofile|bashrc|bash_profile|profile|zshenv|env)$/.test(p) || p.endsWith(".env"))
|
|
5578
|
+
return "shell";
|
|
5579
|
+
if (/(^|\/)\.(npmrc|yarnrc|curlrc|netrc)$/.test(p))
|
|
5580
|
+
return "ini";
|
|
5581
|
+
return storedFormat;
|
|
5582
|
+
}
|
|
5497
5583
|
function redactContent(content, format) {
|
|
5498
5584
|
switch (format) {
|
|
5499
5585
|
case "shell":
|
|
@@ -9056,6 +9142,7 @@ function planSessionRender(input) {
|
|
|
9056
9142
|
writable: !blocked,
|
|
9057
9143
|
blocked,
|
|
9058
9144
|
blockers,
|
|
9145
|
+
allowEmptySources,
|
|
9059
9146
|
env,
|
|
9060
9147
|
files,
|
|
9061
9148
|
manifest,
|
|
@@ -9078,6 +9165,7 @@ function sourceFromFilePath(path, content, order = 0) {
|
|
|
9078
9165
|
}
|
|
9079
9166
|
function sourceFromConfig(config, order = 0, layer) {
|
|
9080
9167
|
const isAgentOperatingRules = config.slug === GLOBAL_AGENT_RULES_STANDARD_SLUG;
|
|
9168
|
+
const isNonOverridableManagedPolicy = isAgentOperatingRules || config.slug === CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG;
|
|
9081
9169
|
const rules = isAgentOperatingRules ? resolveAgentOperatingRulesPayload(config.content) : null;
|
|
9082
9170
|
return {
|
|
9083
9171
|
id: config.slug,
|
|
@@ -9096,7 +9184,7 @@ function sourceFromConfig(config, order = 0, layer) {
|
|
|
9096
9184
|
configAgent: config.agent
|
|
9097
9185
|
},
|
|
9098
9186
|
metadata: rules ? { ...rules.metadata } : null,
|
|
9099
|
-
nonOverridable:
|
|
9187
|
+
nonOverridable: isNonOverridableManagedPolicy
|
|
9100
9188
|
};
|
|
9101
9189
|
}
|
|
9102
9190
|
function selectProfileConfigsForSessionRender(configs, tool) {
|
|
@@ -9650,7 +9738,7 @@ function wouldDestroyACredential(targetPath, renderedContent, format) {
|
|
|
9650
9738
|
}
|
|
9651
9739
|
if (current === renderedContent)
|
|
9652
9740
|
return [];
|
|
9653
|
-
if (scanSecrets(current, format).length > 0)
|
|
9741
|
+
if (scanSecrets(current, redactFormatForTarget(targetPath, format)).length > 0)
|
|
9654
9742
|
return secretTokens;
|
|
9655
9743
|
return secretTokens.filter((name) => countPlaceholder(current, name) < countPlaceholder(renderedContent, name));
|
|
9656
9744
|
}
|
|
@@ -10229,6 +10317,7 @@ function applySessionRenderUnlocked(plan, options, coordination) {
|
|
|
10229
10317
|
...files.map((file) => planFileResult(plan, file, targetHome, previousHashes, previousManifest, options)),
|
|
10230
10318
|
...planStaleFileResults(plan, targetHome, previousManifest, currentRelativePaths, options)
|
|
10231
10319
|
];
|
|
10320
|
+
assertNotSilentManagedWipeout(plan, results);
|
|
10232
10321
|
const conflicts = results.filter((result) => result.action === "conflict");
|
|
10233
10322
|
if (conflicts.length > 0) {
|
|
10234
10323
|
return {
|
|
@@ -10801,6 +10890,19 @@ function planFileResult(plan, file, targetHome, previousHashes, previousManifest
|
|
|
10801
10890
|
reason: "existing unmanaged file differs; pass force to overwrite"
|
|
10802
10891
|
};
|
|
10803
10892
|
}
|
|
10893
|
+
function assertNotSilentManagedWipeout(plan, results) {
|
|
10894
|
+
if (plan.allowEmptySources)
|
|
10895
|
+
return;
|
|
10896
|
+
const managedDir = plan.adapter.managedDir;
|
|
10897
|
+
const underManagedDir = (relativePath) => relativePath === managedDir || relativePath.startsWith(`${managedDir}/`);
|
|
10898
|
+
const staleDeletions = results.filter((result) => result.action === "delete" && underManagedDir(result.relativePath));
|
|
10899
|
+
if (staleDeletions.length === 0)
|
|
10900
|
+
return;
|
|
10901
|
+
const managedRetained = results.some((result) => result.action !== "delete" && underManagedDir(result.relativePath));
|
|
10902
|
+
if (managedRetained)
|
|
10903
|
+
return;
|
|
10904
|
+
throw new SessionApplyError(`Session render plan for ${plan.tool} (${plan.adapter.mode}) would delete ${staleDeletions.length} ` + `previously managed file(s) under "${managedDir}" and create or update none there: ` + `${staleDeletions.map((result) => result.relativePath).join(", ")}. ` + "Pass --allow-empty-sources only for explicit empty renders.");
|
|
10905
|
+
}
|
|
10804
10906
|
function planStaleFileResults(plan, targetHome, previousManifest, currentRelativePaths, options) {
|
|
10805
10907
|
if (!previousManifest)
|
|
10806
10908
|
return [];
|
|
@@ -11749,14 +11851,6 @@ function redactionPlaceholders(storedLine) {
|
|
|
11749
11851
|
}
|
|
11750
11852
|
return found;
|
|
11751
11853
|
}
|
|
11752
|
-
function redactFormatForTarget(targetPath, storedFormat) {
|
|
11753
|
-
const p = targetPath.toLowerCase();
|
|
11754
|
-
if (/(^|\/)\.(zshrc|zprofile|bashrc|bash_profile|profile|zshenv|env)$/.test(p) || p.endsWith(".env"))
|
|
11755
|
-
return "shell";
|
|
11756
|
-
if (/(^|\/)\.(npmrc|yarnrc|curlrc|netrc)$/.test(p))
|
|
11757
|
-
return "ini";
|
|
11758
|
-
return storedFormat;
|
|
11759
|
-
}
|
|
11760
11854
|
function storedPlaceholderIsLiteralOnDisk(storedLine, diskLine) {
|
|
11761
11855
|
return redactionPlaceholders(storedLine).some((p) => !diskLine.includes(p));
|
|
11762
11856
|
}
|
|
@@ -12454,6 +12548,7 @@ export {
|
|
|
12454
12548
|
ensurePlatformProfiles,
|
|
12455
12549
|
ensureGlobalAgentRulesStandardConfig,
|
|
12456
12550
|
ensureDangerousOperationGuardStandardConfig,
|
|
12551
|
+
ensureCodewithSharedTodosStorageStandardConfig,
|
|
12457
12552
|
diffConfig,
|
|
12458
12553
|
detectMachineContext,
|
|
12459
12554
|
detectFormat,
|
|
@@ -12519,6 +12614,9 @@ export {
|
|
|
12519
12614
|
CONFIG_FORMATS,
|
|
12520
12615
|
CONFIG_CATEGORIES,
|
|
12521
12616
|
CONFIG_AGENTS,
|
|
12617
|
+
CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG,
|
|
12618
|
+
CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT,
|
|
12619
|
+
CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE,
|
|
12522
12620
|
CODEWITH_NATIVE_IMPORTS_ENV,
|
|
12523
12621
|
AGENT_OPERATING_RULES_SENTINEL_PATTERN,
|
|
12524
12622
|
AGENT_OPERATING_RULES_SEMANTIC_POLICY_KEY
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-text-format-credential-guard.test.d.ts","sourceRoot":"","sources":["../../src/lib/apply-text-format-credential-guard.test.ts"],"names":[],"mappings":""}
|
package/dist/lib/apply.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/lib/ap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AAQ,EAAE,yBAAyB,EAAE,CAAC;CACvC;AA+QD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,WAAW,CAAC,CA+BtB;AA2ED,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,WAAW,EAAE,CAAC,CAMxB;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAiC7B;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,GAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAM,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAE7B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Config } from "../types/index.js";
|
|
2
|
+
import { type ConfigStore } from "../data/config-store.js";
|
|
3
|
+
export declare const CODEWITH_SHARED_TODOS_STORAGE_STANDARD_SLUG = "codewith-shared-todos-storage-standard";
|
|
4
|
+
export declare const CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE = "codewith/shared-todos-storage/v1";
|
|
5
|
+
export declare const CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT = "# Codewith Shared Todos Storage Standard\n\nPolicy reference: `codewith/shared-todos-storage/v1`\n\n## Scope\n\n- This policy applies to all operational Codewith work: repositories of every\n name, work projects, research projects, coordinators, delegated workers, and\n native scheduled or recurring loops. It is not limited to `open-*` or\n `iapp-*` repositories.\n\n## Authoritative Storage\n\n- Operational Todos state must use the managed shared Todos service.\n On-box SQLite or file storage is permitted only inside disposable,\n repository-owned tests using isolated test-controlled paths.\n- On-box SQLite or file storage must never hold operational tasks, plans, locks or claims,\n comments, verification evidence, dispatch state, or handoff state. Never\n fall back to on-box-only storage to keep operational work moving.\n\n## Pre-Mutation Gate\n\n- Before any operational Todos mutation, require authoritative Projects\n linkage and verify from sanitized status or route metadata that Todos resolves\n to the managed server-backed route. Verification may identify the route class,\n backend class, and linked project identifiers, but must omit credentials,\n tokens, DSNs, and full endpoint URLs.\n- If Projects linkage or server-backed route verification is missing, ambiguous,\n unavailable, or reports an on-box SQLite or file route, fail closed: do not mutate Todos.\n Diagnose and repair the owning configuration or service route, re-run the\n sanitized verification, and report the blockage or repair on the approved\n operational surface without exposing secrets.\n\n## Reconciliation\n\n- Prior on-box-only tasks, plans, comments, locks, verification, dispatch, or\n handoff evidence are not authoritative. Explicitly reconcile each required\n record into the Projects-linked shared Todos record, retain bounded provenance\n identifiers, and independently verify the shared result before treating it as\n authoritative. Never silently copy, discard, or bless on-box-only evidence.\n";
|
|
6
|
+
export declare function ensureCodewithSharedTodosStorageStandardConfig(store?: ConfigStore): Promise<Config>;
|
|
7
|
+
//# sourceMappingURL=codewith-shared-todos-storage-standard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codewith-shared-todos-storage-standard.d.ts","sourceRoot":"","sources":["../../src/lib/codewith-shared-todos-storage-standard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE/E,eAAO,MAAM,2CAA2C,2CAA2C,CAAC;AACpG,eAAO,MAAM,8CAA8C,qCAAqC,CAAC;AAEjG,eAAO,MAAM,8CAA8C,2+DAwC1D,CAAC;AAEF,wBAAsB,8CAA8C,CAClE,KAAK,GAAE,WAAkC,GACxC,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codewith-shared-todos-storage-standard.test.d.ts","sourceRoot":"","sources":["../../src/lib/codewith-shared-todos-storage-standard.test.ts"],"names":[],"mappings":""}
|
package/dist/lib/redact.d.ts
CHANGED
|
@@ -21,6 +21,30 @@ export interface RedactedVar {
|
|
|
21
21
|
reason: string;
|
|
22
22
|
}
|
|
23
23
|
export type RedactFormat = "shell" | "json" | "toml" | "ini" | "markdown" | "text" | "yaml";
|
|
24
|
+
/**
|
|
25
|
+
* Pick the redaction dialect for the file actually being read, from its PATH.
|
|
26
|
+
*
|
|
27
|
+
* `ConfigFormat` — what a stored row declares — is
|
|
28
|
+
* `text | json | toml | yaml | markdown | ini` and has NO `shell` member, while
|
|
29
|
+
* `RedactFormat` does. `detectFormat` returns `text` for any extensionless path,
|
|
30
|
+
* so `~/.zshrc`, `~/.bashrc` and `~/.npmrc` are all stored as `text`, and `text`
|
|
31
|
+
* routes to `redactGeneric` — which matches token SHAPES only and never key
|
|
32
|
+
* names. A credential whose key is secret-class but whose value has no
|
|
33
|
+
* recognisable shape is therefore invisible on exactly the files most likely to
|
|
34
|
+
* hold one.
|
|
35
|
+
*
|
|
36
|
+
* Resolving the dialect from the path closes that. It is deliberately
|
|
37
|
+
* PATH-KEYED rather than a widening of `ConfigFormat`: `.md` still resolves to
|
|
38
|
+
* `markdown`, so a rules file documenting `NPM_TOKEN=...` in prose is not
|
|
39
|
+
* mistaken for a shell assignment and frozen from ever shipping an edit.
|
|
40
|
+
*
|
|
41
|
+
* Exported so every caller that must choose a dialect shares ONE definition.
|
|
42
|
+
* Two surfaces need it and they must not drift: `diff`, the last read before a
|
|
43
|
+
* value reaches a transcript, and the `apply` guard, the last check before a
|
|
44
|
+
* value is overwritten. A per-surface copy is how one of them silently keeps the
|
|
45
|
+
* gap (todos e4d9c22e).
|
|
46
|
+
*/
|
|
47
|
+
export declare function redactFormatForTarget(targetPath: string, storedFormat: RedactFormat): RedactFormat;
|
|
24
48
|
export declare function redactContent(content: string, format: RedactFormat): RedactResult;
|
|
25
49
|
/** Detect secrets without modifying content. Returns list of findings. */
|
|
26
50
|
export declare function scanSecrets(content: string, format: RedactFormat): RedactedVar[];
|
package/dist/lib/redact.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/lib/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAgND,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5F,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,YAAY,CAQjF;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,WAAW,EAAE,CAGhF;AAED,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAEzE;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD"}
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/lib/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAgND,MAAM,MAA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
|
|
|
199
199
|
writable: boolean;
|
|
200
200
|
blocked: boolean;
|
|
201
201
|
blockers: string[];
|
|
202
|
+
/**
|
|
203
|
+
* Carries the caller's --allow-empty-sources choice from plan-build time into
|
|
204
|
+
* apply time. Apply-time emptiness (a plan that deletes every previously
|
|
205
|
+
* managed file under the adapter's managed directory while creating or
|
|
206
|
+
* updating none — see planStaleFileResults in session-apply.ts) cannot be
|
|
207
|
+
* detected here, because it depends on the previous manifest on disk, which
|
|
208
|
+
* this function never reads. It can only be detected once the stale-file
|
|
209
|
+
* diff is computed in applySessionRenderUnlocked, so the flag has to travel
|
|
210
|
+
* on the plan rather than being re-decided there.
|
|
211
|
+
*/
|
|
212
|
+
allowEmptySources: boolean;
|
|
202
213
|
env: Record<string, string>;
|
|
203
214
|
files: SessionRenderFile[];
|
|
204
215
|
manifest: SessionRenderManifest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-render.d.ts","sourceRoot":"","sources":["../../src/lib/session-render.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"session-render.d.ts","sourceRoot":"","sources":["../../src/lib/session-render.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAahD,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAEL,0BAA0B,EAI1B,qBAAqB,EAEtB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,uCAAuC,EACvC,6BAA6B,EAC7B,gCAAgC,EAChC,qCAAqC,EACrC,qBAAqB,EACrB,oCAAoC,GACrC,MAAM,8BAA8B,CAAC;AACtC,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,gCAAgC,QAAS,CAAC;AACvD,eAAO,MAAM,yBAAyB,kCAAk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G,YAAY,CAQ3D;AAGD,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/mcp/index.js
CHANGED
|
@@ -1196,6 +1196,53 @@ var init_global_agent_rules_standard = __esm(() => {
|
|
|
1196
1196
|
`;
|
|
1197
1197
|
});
|
|
1198
1198
|
|
|
1199
|
+
// src/lib/codewith-shared-todos-storage-standard.ts
|
|
1200
|
+
var CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE = "codewith/shared-todos-storage/v1", CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT;
|
|
1201
|
+
var init_codewith_shared_todos_storage_standard = __esm(() => {
|
|
1202
|
+
init_config_store();
|
|
1203
|
+
CODEWITH_SHARED_TODOS_STORAGE_STANDARD_CONTENT = `# Codewith Shared Todos Storage Standard
|
|
1204
|
+
|
|
1205
|
+
Policy reference: \`${CODEWITH_SHARED_TODOS_STORAGE_POLICY_REFERENCE}\`
|
|
1206
|
+
|
|
1207
|
+
## Scope
|
|
1208
|
+
|
|
1209
|
+
- This policy applies to all operational Codewith work: repositories of every
|
|
1210
|
+
name, work projects, research projects, coordinators, delegated workers, and
|
|
1211
|
+
native scheduled or recurring loops. It is not limited to \`open-*\` or
|
|
1212
|
+
\`iapp-*\` repositories.
|
|
1213
|
+
|
|
1214
|
+
## Authoritative Storage
|
|
1215
|
+
|
|
1216
|
+
- Operational Todos state must use the managed shared Todos service.
|
|
1217
|
+
On-box SQLite or file storage is permitted only inside disposable,
|
|
1218
|
+
repository-owned tests using isolated test-controlled paths.
|
|
1219
|
+
- On-box SQLite or file storage must never hold operational tasks, plans, locks or claims,
|
|
1220
|
+
comments, verification evidence, dispatch state, or handoff state. Never
|
|
1221
|
+
fall back to on-box-only storage to keep operational work moving.
|
|
1222
|
+
|
|
1223
|
+
## Pre-Mutation Gate
|
|
1224
|
+
|
|
1225
|
+
- Before any operational Todos mutation, require authoritative Projects
|
|
1226
|
+
linkage and verify from sanitized status or route metadata that Todos resolves
|
|
1227
|
+
to the managed server-backed route. Verification may identify the route class,
|
|
1228
|
+
backend class, and linked project identifiers, but must omit credentials,
|
|
1229
|
+
tokens, DSNs, and full endpoint URLs.
|
|
1230
|
+
- If Projects linkage or server-backed route verification is missing, ambiguous,
|
|
1231
|
+
unavailable, or reports an on-box SQLite or file route, fail closed: do not mutate Todos.
|
|
1232
|
+
Diagnose and repair the owning configuration or service route, re-run the
|
|
1233
|
+
sanitized verification, and report the blockage or repair on the approved
|
|
1234
|
+
operational surface without exposing secrets.
|
|
1235
|
+
|
|
1236
|
+
## Reconciliation
|
|
1237
|
+
|
|
1238
|
+
- Prior on-box-only tasks, plans, comments, locks, verification, dispatch, or
|
|
1239
|
+
handoff evidence are not authoritative. Explicitly reconcile each required
|
|
1240
|
+
record into the Projects-linked shared Todos record, retain bounded provenance
|
|
1241
|
+
identifiers, and independently verify the shared result before treating it as
|
|
1242
|
+
authoritative. Never silently copy, discard, or bless on-box-only evidence.
|
|
1243
|
+
`;
|
|
1244
|
+
});
|
|
1245
|
+
|
|
1199
1246
|
// node_modules/zod/v3/helpers/util.js
|
|
1200
1247
|
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
1201
1248
|
const t = typeof data;
|
|
@@ -5166,6 +5213,7 @@ var init_zod = __esm(() => {
|
|
|
5166
5213
|
var exports_redact = {};
|
|
5167
5214
|
__export(exports_redact, {
|
|
5168
5215
|
scanSecrets: () => scanSecrets,
|
|
5216
|
+
redactFormatForTarget: () => redactFormatForTarget,
|
|
5169
5217
|
redactContent: () => redactContent,
|
|
5170
5218
|
isSecretVarName: () => isSecretVarName,
|
|
5171
5219
|
hasSecrets: () => hasSecrets
|
|
@@ -5320,6 +5368,14 @@ function reasonFor(key, value) {
|
|
|
5320
5368
|
function isReferenceValue(value) {
|
|
5321
5369
|
return /^\{\{[A-Z][A-Z0-9_]*\}\}$/.test(value) || /^\$\{[A-Z][A-Z0-9_]*\}$/.test(value) || /^\$[A-Z][A-Z0-9_]*$/.test(value) || /^%[A-Z][A-Z0-9_]*%$/.test(value);
|
|
5322
5370
|
}
|
|
5371
|
+
function redactFormatForTarget(targetPath, storedFormat) {
|
|
5372
|
+
const p = targetPath.toLowerCase();
|
|
5373
|
+
if (/(^|\/)\.(zshrc|zprofile|bashrc|bash_profile|profile|zshenv|env)$/.test(p) || p.endsWith(".env"))
|
|
5374
|
+
return "shell";
|
|
5375
|
+
if (/(^|\/)\.(npmrc|yarnrc|curlrc|netrc)$/.test(p))
|
|
5376
|
+
return "ini";
|
|
5377
|
+
return storedFormat;
|
|
5378
|
+
}
|
|
5323
5379
|
function redactContent(content, format) {
|
|
5324
5380
|
switch (format) {
|
|
5325
5381
|
case "shell":
|
|
@@ -5653,6 +5709,7 @@ var init_transforms = () => {};
|
|
|
5653
5709
|
var ANTIGRAVITY_RULE_FILE_CHAR_LIMIT = 12000, SESSION_RENDERER_OWNER_ID = "instructions-session-renderer", SESSION_RENDER_PROFILE_ENTRYPOINTS, SESSION_RENDER_OWNED_CONFIG_TARGETS, CODEWITH_FLATTENED_ADAPTER, CODEWITH_NATIVE_ADAPTER, SESSION_TOOL_ADAPTERS, SESSION_RENDER_MANAGED_DIRS, SESSION_RENDER_SHARED_MANAGED_DIRS, SESSION_RENDER_EXCLUSIVE_MANAGED_PATHS, CANONICAL_IDENTITY_EXPORT_PACKAGES;
|
|
5654
5710
|
var init_session_render = __esm(() => {
|
|
5655
5711
|
init_global_agent_rules_standard();
|
|
5712
|
+
init_codewith_shared_todos_storage_standard();
|
|
5656
5713
|
init_project_context();
|
|
5657
5714
|
init_config_agents();
|
|
5658
5715
|
init_transforms();
|
|
@@ -5950,7 +6007,7 @@ function wouldDestroyACredential(targetPath, renderedContent, format) {
|
|
|
5950
6007
|
}
|
|
5951
6008
|
if (current === renderedContent)
|
|
5952
6009
|
return [];
|
|
5953
|
-
if (scanSecrets(current, format).length > 0)
|
|
6010
|
+
if (scanSecrets(current, redactFormatForTarget(targetPath, format)).length > 0)
|
|
5954
6011
|
return secretTokens;
|
|
5955
6012
|
return secretTokens.filter((name) => countPlaceholder(current, name) < countPlaceholder(renderedContent, name));
|
|
5956
6013
|
}
|
|
@@ -6581,14 +6638,6 @@ function redactionPlaceholders(storedLine) {
|
|
|
6581
6638
|
}
|
|
6582
6639
|
return found;
|
|
6583
6640
|
}
|
|
6584
|
-
function redactFormatForTarget(targetPath, storedFormat) {
|
|
6585
|
-
const p = targetPath.toLowerCase();
|
|
6586
|
-
if (/(^|\/)\.(zshrc|zprofile|bashrc|bash_profile|profile|zshenv|env)$/.test(p) || p.endsWith(".env"))
|
|
6587
|
-
return "shell";
|
|
6588
|
-
if (/(^|\/)\.(npmrc|yarnrc|curlrc|netrc)$/.test(p))
|
|
6589
|
-
return "ini";
|
|
6590
|
-
return storedFormat;
|
|
6591
|
-
}
|
|
6592
6641
|
function storedPlaceholderIsLiteralOnDisk(storedLine, diskLine) {
|
|
6593
6642
|
return redactionPlaceholders(storedLine).some((p) => !diskLine.includes(p));
|
|
6594
6643
|
}
|
|
@@ -6908,7 +6957,7 @@ var init_sync_dir = __esm(() => {
|
|
|
6908
6957
|
var require_package = __commonJS((exports, module) => {
|
|
6909
6958
|
module.exports = {
|
|
6910
6959
|
name: "@hasna/instructions",
|
|
6911
|
-
version: "0.4.
|
|
6960
|
+
version: "0.4.17",
|
|
6912
6961
|
description: "AI coding agent instruction & configuration manager \u2014 store, version, apply, and share all your AI coding configs. CLI + MCP + HTTP API (instructions-serve) + generated SDK + Dashboard.",
|
|
6913
6962
|
type: "module",
|
|
6914
6963
|
main: "dist/index.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/instructions",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"description": "AI coding agent instruction & configuration manager \u2014 store, version, apply, and share all your AI coding configs. CLI + MCP + HTTP API (instructions-serve) + generated SDK + Dashboard.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|