codeden 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +8 -2
  2. package/dist/cli.js +1 -1
  3. package/dist/{main-DgpYK_Si.js → main-Bubch4fJ.js} +2 -2
  4. package/dist/{main-DgpYK_Si.js.map → main-Bubch4fJ.js.map} +1 -1
  5. package/dist/{main-BAX1sPiD.js → main-f5CBW7t4.js} +1196 -198
  6. package/dist/main-f5CBW7t4.js.map +1 -0
  7. package/dist/{runner-DGomZl80.js → runner-Doy0yaNT.js} +198 -3
  8. package/dist/runner-Doy0yaNT.js.map +1 -0
  9. package/dist/runner.js +1 -1
  10. package/dist/web/apple-touch-icon.png +0 -0
  11. package/dist/web/assets/{core-D2h_xdbh.js → core-BnICSmTX.js} +1 -1
  12. package/dist/web/assets/engine-oniguruma-Tz65MLLK.js +1 -0
  13. package/dist/web/assets/{highlighted-body-JLMTFACH-DpId3Lg2.js → highlighted-body-JLMTFACH-DiAsPNHI.js} +1 -1
  14. package/dist/web/assets/{highlights-C1SeynWZ.js → highlights-mfetlXdJ.js} +1 -1
  15. package/dist/web/assets/index-CXjq9NOS.js +914 -0
  16. package/dist/web/assets/index-DcErU_f1.css +1 -0
  17. package/dist/web/assets/langs-B69Lxr5B.js +1 -0
  18. package/dist/web/assets/mermaid-WFAXDIZX-CbtYONW-.js +1 -0
  19. package/dist/web/assets/{shiki-h6vxFpD2.js → shiki-B1ZU2vss.js} +2 -2
  20. package/dist/web/assets/{stream-tokenizer-D8Euixi9.js → stream-tokenizer-1i17e6mT.js} +1 -1
  21. package/dist/web/assets/{themes-Bi1mPEwQ.js → themes-CmE23Ko0.js} +2 -2
  22. package/dist/web/icons/icon-192.png +0 -0
  23. package/dist/web/icons/icon-512.png +0 -0
  24. package/dist/web/icons/maskable-192.png +0 -0
  25. package/dist/web/icons/maskable-512.png +0 -0
  26. package/dist/web/index.html +10 -2
  27. package/dist/web/manifest.webmanifest +28 -0
  28. package/package.json +1 -1
  29. package/dist/main-BAX1sPiD.js.map +0 -1
  30. package/dist/runner-DGomZl80.js.map +0 -1
  31. package/dist/web/assets/engine-oniguruma-CG0oBFVI.js +0 -1
  32. package/dist/web/assets/index-BPuGYbOr.css +0 -1
  33. package/dist/web/assets/index-BXhyz2mO.js +0 -914
  34. package/dist/web/assets/langs-NwkcQ-R2.js +0 -1
  35. package/dist/web/assets/mermaid-WFAXDIZX-jqhY_qSL.js +0 -1
@@ -11010,6 +11010,201 @@ object({
11010
11010
  message: string()
11011
11011
  }).optional()
11012
11012
  });
11013
+ /** The password rules in plain words, shown next to the password field. */
11014
+ const PASSWORD_RULE_TEXT = "Use at least 15 characters. A short sentence or a few random words works well. Very common passwords, repeated characters and simple sequences such as abcdef… or 12345… are refused.";
11015
+ /** Base words of very common passwords; a password made of one of these plus digits is refused. */
11016
+ const COMMON_WORDS = /* @__PURE__ */ new Set([
11017
+ "password",
11018
+ "passw0rd",
11019
+ "letmein",
11020
+ "welcome",
11021
+ "admin",
11022
+ "administrator",
11023
+ "iloveyou",
11024
+ "qwerty",
11025
+ "monkey",
11026
+ "dragon",
11027
+ "football",
11028
+ "baseball",
11029
+ "sunshine",
11030
+ "princess",
11031
+ "superman",
11032
+ "batman",
11033
+ "trustno",
11034
+ "master",
11035
+ "shadow",
11036
+ "michael",
11037
+ "jennifer",
11038
+ "computer",
11039
+ "secret",
11040
+ "changeme",
11041
+ "codeden",
11042
+ "default",
11043
+ "login",
11044
+ "hello",
11045
+ "abc",
11046
+ "test",
11047
+ "guest",
11048
+ "root",
11049
+ "starwars",
11050
+ "whatever",
11051
+ "freedom",
11052
+ "mustang",
11053
+ "pokemon",
11054
+ "charlie",
11055
+ "correcthorsebatterystaple"
11056
+ ]);
11057
+ /** Character runs a "sequence" password walks along (alphabet, digits, keyboard rows). */
11058
+ const SEQUENCES = [
11059
+ "abcdefghijklmnopqrstuvwxyz",
11060
+ "0123456789",
11061
+ "qwertyuiopasdfghjklzxcvbnm",
11062
+ "qwertzuiopasdfghjklyxcvbnm",
11063
+ "azertyuiopqsdfghjklmwxcvbn",
11064
+ "1qaz2wsx3edc4rfv5tgb6yhn7ujm8ik9ol0p",
11065
+ "qazwsxedcrfvtgbyhnujmikolp",
11066
+ "1234567890qwertyuiopasdfghjklzxcvbnm"
11067
+ ];
11068
+ /** True when `text` is one short unit repeated (`abcabcabc`, `passwordpassword`). */
11069
+ function isRepeatedUnit(text) {
11070
+ for (let size = 1; size <= text.length / 2; size++) {
11071
+ if (text.length % size !== 0) continue;
11072
+ if (text.slice(0, size).repeat(text.length / size) === text) return true;
11073
+ }
11074
+ return false;
11075
+ }
11076
+ /** True when `text` walks along one of the known sequences, forwards or backwards (wrapping). */
11077
+ function isSequence(text) {
11078
+ return SEQUENCES.some((seq) => {
11079
+ const looped = seq.repeat(Math.ceil(text.length / seq.length) + 2);
11080
+ const reversed = [...looped].reverse().join("");
11081
+ return looped.includes(text) || reversed.includes(text);
11082
+ });
11083
+ }
11084
+ /**
11085
+ * Why `password` can't be used for network access, in plain words, or null when it is fine.
11086
+ * Shared by the server (which enforces it) and the UI (which explains it as you type).
11087
+ */
11088
+ function passwordProblem(password) {
11089
+ if (password.length < 15) return `Use at least 15 characters (this one has ${password.length}).`;
11090
+ if (password.length > 256) return `Use at most 256 characters.`;
11091
+ const lower = password.toLowerCase();
11092
+ const compact = lower.replace(/\s+/g, "");
11093
+ if (new Set(compact).size < 5 || isRepeatedUnit(compact)) return "That repeats the same few characters. Try a few random words instead.";
11094
+ if (isSequence(compact)) return "That is a simple sequence. Try a few random words instead.";
11095
+ const letters = lower.replace(/[^a-z]/g, "");
11096
+ const words = lower.split(/[^a-z]+/).filter(Boolean);
11097
+ if (letters.length > 0 && (COMMON_WORDS.has(letters) || isRepeatedUnitOf(letters, COMMON_WORDS) || words.length > 0 && words.every((w) => COMMON_WORDS.has(w)))) return "That is too close to a very common password. Try a few random words instead.";
11098
+ return null;
11099
+ }
11100
+ function isRepeatedUnitOf(text, units) {
11101
+ for (const unit of units) if (text.length % unit.length === 0 && unit.repeat(text.length / unit.length) === text) return true;
11102
+ return false;
11103
+ }
11104
+ /** One address CodeDen can be opened on, with the URL a phone would scan. */
11105
+ const NetworkAddress = object({
11106
+ kind: _enum([
11107
+ "local",
11108
+ "lan",
11109
+ "vpn"
11110
+ ]),
11111
+ /** Human label, e.g. "This computer", "Wi-Fi (192.168.1.20)", "Tailscale". */
11112
+ label: string(),
11113
+ /** The interface the address belongs to (`Wi-Fi`, `eth0`, `tailscale0`), or null for localhost. */
11114
+ interfaceName: string().nullable(),
11115
+ /** The bare host: `localhost` or an IPv4 address. */
11116
+ host: string(),
11117
+ /** `http://<host>:<port>`. */
11118
+ url: string()
11119
+ });
11120
+ /** A signed-in remote device, as listed in Settings › Network access (never the token). */
11121
+ const RemoteDevice = object({
11122
+ id: string(),
11123
+ /** The browser's user agent when it signed in (trimmed). */
11124
+ label: string(),
11125
+ /** The address it signed in from. */
11126
+ address: string().nullable(),
11127
+ createdAt: Timestamp,
11128
+ lastSeenAt: Timestamp,
11129
+ expiresAt: Timestamp,
11130
+ /** The device making this request. */
11131
+ current: boolean()
11132
+ });
11133
+ /**
11134
+ * `GET /api/network`: whether network access is on, where CodeDen answers, and who is signed
11135
+ * in. `remote` tells the caller whether it is itself a remote device (management is
11136
+ * loopback-only, so the UI shows the controls read-only there).
11137
+ */
11138
+ const NetworkStatus = object({
11139
+ enabled: boolean(),
11140
+ passwordSet: boolean(),
11141
+ passwordSetAt: Timestamp.nullable(),
11142
+ /** Where the HTTP listener is bound right now. */
11143
+ listening: _enum(["loopback", "network"]),
11144
+ port: int().nonnegative(),
11145
+ /** Addresses CodeDen answers on: localhost always, LAN and VPN addresses when enabled. */
11146
+ addresses: array(NetworkAddress),
11147
+ /** Addresses it would answer on once enabled (for the off state's preview). */
11148
+ candidates: array(NetworkAddress),
11149
+ devices: array(RemoteDevice),
11150
+ remote: boolean()
11151
+ });
11152
+ /**
11153
+ * `POST /api/network/password` (loopback only): set a password, or let the server generate a
11154
+ * passphrase. Either way every remote device is signed out.
11155
+ */
11156
+ const SetNetworkPasswordRequest = union([object({ password: string().min(1).max(256) }), object({ generate: literal(true) })]);
11157
+ /** Response to setting the password: the generated passphrase is returned once, never again. */
11158
+ const SetNetworkPasswordResponse = object({
11159
+ status: NetworkStatus,
11160
+ generated: string().nullable()
11161
+ });
11162
+ /** `PUT /api/network` (loopback only): turn network access on or off. */
11163
+ const SetNetworkAccessRequest = object({ enabled: boolean() });
11164
+ /** `POST /api/auth/sign-in` from a remote device. */
11165
+ const SignInRequest = object({ password: string().max(256) });
11166
+ object({
11167
+ /** The caller is not on this machine. */
11168
+ remote: boolean(),
11169
+ /** The caller has a valid session (remote) or install-token cookie (local). */
11170
+ signedIn: boolean(),
11171
+ networkEnabled: boolean()
11172
+ });
11173
+ object({ error: object({
11174
+ code: _enum([
11175
+ "invalid_password",
11176
+ "rate_limited",
11177
+ "locked_out",
11178
+ "network_off"
11179
+ ]),
11180
+ message: string(),
11181
+ retryAfterSec: int().nonnegative().nullable()
11182
+ }) });
11183
+ /** A stored remote session: only the SHA-256 hash of its token is kept. */
11184
+ const RemoteSessionRecord = object({
11185
+ id: string(),
11186
+ tokenHash: string().regex(/^[0-9a-f]{64}$/),
11187
+ label: string(),
11188
+ address: string().nullable(),
11189
+ createdAt: Timestamp,
11190
+ lastSeenAt: Timestamp,
11191
+ expiresAt: Timestamp
11192
+ });
11193
+ /**
11194
+ * `<home>/remote-access.json` (mode 0600): the network switch, the password hash (scrypt,
11195
+ * salted; never the password) and the remote sessions. Kept out of `settings.json` so the
11196
+ * settings API can't switch network access on without the checks.
11197
+ */
11198
+ const RemoteAccessFile = object({
11199
+ schemaVersion: literal(1).default(1),
11200
+ enabled: boolean().default(false),
11201
+ password: object({
11202
+ /** `scrypt$<N>$<r>$<p>$<salt b64>$<hash b64>`. */
11203
+ hash: string().startsWith("scrypt$"),
11204
+ setAt: Timestamp
11205
+ }).nullable().default(null),
11206
+ sessions: array(RemoteSessionRecord).default([])
11207
+ });
11013
11208
  object({ session: Session.nullable() });
11014
11209
  /** `POST .../orchestrator/messages` and `.../projects/:id/pm/messages`. */
11015
11210
  const RoleMessageRequest = object({
@@ -11627,7 +11822,7 @@ object({
11627
11822
  * rest of the bundle, so the package version is the single source of truth at runtime;
11628
11823
  * everywhere else (workspace, tests) it is `SOURCE_VERSION`.
11629
11824
  */
11630
- const CODEDEN_VERSION = packageVersion() ?? "0.3.0";
11825
+ const CODEDEN_VERSION = packageVersion() ?? "0.4.1";
11631
11826
  function packageVersion() {
11632
11827
  const value = globalThis.__CODEDEN_PACKAGE_VERSION__;
11633
11828
  return typeof value === "string" && value.length > 0 ? value : void 0;
@@ -29363,6 +29558,6 @@ async function startRunner(opts) {
29363
29558
  close
29364
29559
  };
29365
29560
  }
29366
- export { ExportAutomationsQuery as $, datetime as $n, TriageIssueRequest as $t, SessionFileQuery as A, SessionOptions as An, UiClientMessage as At, ImageTestRequest as B, InboxItemKind as Bn, UpdateInstallRequest as Bt, isElectronRuntime as C, GitPushRequest as Cn, SecretKey as Ct, CODEDEN_VERSION as D, TerminalClientMessage as Dn, StartSessionRequest as Dt, wrapper_default as E, SpeechSummaryRequest as En, SetSecretRequest as Et, ListConflictsQuery as F, Project as Fn, LOCAL_STT_SAMPLE_RATE as Ft, BrowserNavigateRequest as G, AgentConfigLocator as Gn, NOTICE_BATCH_CODE as Gt, BrowserClientMessage as H, AgentConfigDeleteQuery as Hn, compareVersions$1 as Ht, ListNoticesQuery as I, sortProjects as In, LocalSttModelParams as It, BrowserViewportRequest as J, McpServerTarget as Jn, GithubIssue as Jt, BrowserNewTabRequest as K, AgentConfigWriteRequest as Kn, CreateGithubIssueRequest as Kt, ResolveConflictRequest as L, DEFAULT_VISION_PATH as Ln, SttQuery as Lt, RunnerToServerMessage as M, ConflictDecision as Mn, HealthResponse as Mt, ServerLock as N, StartedBy as Nn, agentEventToNewEvent as Nt, UsageQuery as O, TerminalQuery as On, SteerRequest as Ot, ArchiveSessionRequest as P, WorkKey as Pn, Settings as Pt, DuplicateAutomationRequest as Q, ReasoningEffort as Qn, MergePrRequest as Qt, RoleMessageRequest as R, FactoryLimits as Rn, TtsRequest as Rt, acquireInstallLock as S, GitCommitRequest as Sn, RespondRequest as St, import_websocket_server as T, SessionResult as Tn, SessionStartMeta as Tt, BrowserDevServerRequest as U, AgentConfigDiffRequest as Un, isNewerVersion as Ut, summarizeActivity as V, messageFrom as Vn, UpdateStatus as Vt, BrowserHistoryRequest as W, AgentConfigListQuery as Wn, ConflictRecord as Wt, AUTOMATION_IMPORT_LIMITS as X, AutonomyLevel as Xn, GithubListQuery as Xt, BrowserWsQuery as Y, McpServerUpsertRequest as Yn, GithubLabelRequest as Yt, AutomationImportSource as Z, ProviderId as Zn, GithubPr as Zt, importClaudeSdkFrom as _, TriagePolicy as _n, unknown as _r, FileWriteRequest as _t, Hono as a, FactoryTuning as an, discriminatedUnion as ar, ListAutomationRunsQuery as at, runNpm as b, DiffScope as bn, safeParse$1 as br, ReorderProjectsRequest as bt, serve as c, ReviewVerdict as cn, literal as cr, SetAutomationEnabledRequest as ct, createImageEngineRegistry as d, Artifact as dn, object as dr, TriageReport as dt, githubPrId as en, _enum as er, ImportAutomationsRequest as et, IMAGE_ASPECT_RATIOS as f, Automation as fn, optional as fr, UpcomingRunsQuery as ft, CLAUDE_SDK_VERSION as g, AutomationTrigger as gn, union as gr, FileReadQuery as gt, claudeSdkSource as h, AutomationRun as hn, string as hr, CreateProjectRequest as ht, killTree as i, FactoryTriageRequest as in, custom as ir, CreateAutomationRequest as it, RunnerLock as j, ProjectConfigFile as jn, UpdateProjectRequest as jt, UsageSettings as k, RunnerCommandResults as kn, ThreadItemsQuery as kt, upgradeWebSocket as l, SetAutonomyModeRequest as ln, looseObject as lr, StarterSetRequest as lt, ImageGenerationError as m, AutomationGuards as mn, record as mr, UpdateAutomationRequest as mt, readLock as n, DiscoveryArea as nn, array as nr, AutomationGuardsPatch as nt, tryDecodeURIComponent as o, KillSwitchRequest as on, int as or, ListAutomationsQuery as ot, resolveImageOutput as p, AutomationAction as pn, preprocess as pr, UpdateAutomationProjectSettingsRequest as pt, BrowserOpenRequest as q, McpServerDiffRequest as qn, GithubCommentRequest as qt, isAlive as r, FactoryCandidate as rn, boolean as rr, AutomationProjectRequest as rt, bufferToFormData as s, PutVisionRequest as sn, intersection as sr, RunAutomationRequest as st, startRunner as t, parseGithubPrId as tn, _null as tr, AutomationFileFrontmatter as tt, ImageEngineRegistry as u, isFactoryMode as un, number$1 as ur, TriageDecisionRequest as ut, installClaudeSdk as v, Session as vn, ZodError as vr, ListInboxQuery as vt, ownNodeEnv as w, RestoreFilesRequest as wn, SendMessageRequest as wt, resolveNpm as x, EditQueuedMessageRequest as xn, prettifyError as xr, ResolveInboxRequest as xt, isClaudeSdkInstalled as y, SessionStatus as yn, toJSONSchema as yr, ListSessionsQuery as yt, UpdateSessionRequest as z, InboxItem as zn, AppPointer as zt };
29561
+ export { BrowserNavigateRequest as $, AgentConfigLocator as $n, NOTICE_BATCH_CODE as $t, SessionFileQuery as A, GitCommitRequest as An, RespondRequest as At, NetworkStatus as B, ConflictDecision as Bn, HealthResponse as Bt, isElectronRuntime as C, AutomationRun as Cn, string as Cr, CreateProjectRequest as Ct, CODEDEN_VERSION as D, SessionStatus as Dn, toJSONSchema as Dr, ListSessionsQuery as Dt, wrapper_default as E, Session as En, ZodError as Er, ListInboxQuery as Et, ListConflictsQuery as F, TerminalClientMessage as Fn, StartSessionRequest as Ft, SetNetworkPasswordResponse as G, DEFAULT_VISION_PATH as Gn, SttQuery as Gt, RemoteAccessFile as H, WorkKey as Hn, Settings as Ht, ListNoticesQuery as I, TerminalQuery as In, SteerRequest as It, ImageTestRequest as J, InboxItemKind as Jn, UpdateInstallRequest as Jt, SignInRequest as K, FactoryLimits as Kn, TtsRequest as Kt, ResolveConflictRequest as L, RunnerCommandResults as Ln, ThreadItemsQuery as Lt, RunnerToServerMessage as M, RestoreFilesRequest as Mn, SendMessageRequest as Mt, ServerLock as N, SessionResult as Nn, SessionStartMeta as Nt, UsageQuery as O, DiffScope as On, safeParse$1 as Or, ReorderProjectsRequest as Ot, ArchiveSessionRequest as P, SpeechSummaryRequest as Pn, SetSecretRequest as Pt, BrowserHistoryRequest as Q, AgentConfigListQuery as Qn, ConflictRecord as Qt, RoleMessageRequest as R, SessionOptions as Rn, UiClientMessage as Rt, acquireInstallLock as S, AutomationGuards as Sn, record as Sr, UpdateAutomationRequest as St, import_websocket_server as T, TriagePolicy as Tn, unknown as Tr, FileWriteRequest as Tt, SetNetworkAccessRequest as U, Project as Un, LOCAL_STT_SAMPLE_RATE as Ut, PASSWORD_RULE_TEXT as V, StartedBy as Vn, agentEventToNewEvent as Vt, SetNetworkPasswordRequest as W, sortProjects as Wn, LocalSttModelParams as Wt, BrowserClientMessage as X, AgentConfigDeleteQuery as Xn, compareVersions$1 as Xt, summarizeActivity as Y, messageFrom as Yn, UpdateStatus as Yt, BrowserDevServerRequest as Z, AgentConfigDiffRequest as Zn, isNewerVersion as Zt, importClaudeSdkFrom as _, SetAutonomyModeRequest as _n, looseObject as _r, StarterSetRequest as _t, Hono as a, GithubPr as an, ProviderId as ar, AutomationImportSource as at, runNpm as b, Automation as bn, optional as br, UpcomingRunsQuery as bt, createAdaptorServer as c, githubPrId as cn, _enum as cr, ImportAutomationsRequest as ct, createImageEngineRegistry as d, FactoryCandidate as dn, boolean as dr, AutomationProjectRequest as dt, CreateGithubIssueRequest as en, AgentConfigWriteRequest as er, BrowserNewTabRequest as et, IMAGE_ASPECT_RATIOS as f, FactoryTriageRequest as fn, custom as fr, CreateAutomationRequest as ft, CLAUDE_SDK_VERSION as g, ReviewVerdict as gn, literal as gr, SetAutomationEnabledRequest as gt, claudeSdkSource as h, PutVisionRequest as hn, intersection as hr, RunAutomationRequest as ht, killTree as i, GithubListQuery as in, AutonomyLevel as ir, AUTOMATION_IMPORT_LIMITS as it, RunnerLock as j, GitPushRequest as jn, SecretKey as jt, UsageSettings as k, EditQueuedMessageRequest as kn, prettifyError as kr, ResolveInboxRequest as kt, upgradeWebSocket as l, parseGithubPrId as ln, _null as lr, AutomationFileFrontmatter as lt, ImageGenerationError as m, KillSwitchRequest as mn, int as mr, ListAutomationsQuery as mt, readLock as n, GithubIssue as nn, McpServerTarget as nr, BrowserViewportRequest as nt, tryDecodeURIComponent as o, MergePrRequest as on, ReasoningEffort as or, DuplicateAutomationRequest as ot, resolveImageOutput as p, FactoryTuning as pn, discriminatedUnion as pr, ListAutomationRunsQuery as pt, passwordProblem as q, InboxItem as qn, AppPointer as qt, isAlive as r, GithubLabelRequest as rn, McpServerUpsertRequest as rr, BrowserWsQuery as rt, bufferToFormData as s, TriageIssueRequest as sn, datetime as sr, ExportAutomationsQuery as st, startRunner as t, GithubCommentRequest as tn, McpServerDiffRequest as tr, BrowserOpenRequest as tt, ImageEngineRegistry as u, DiscoveryArea as un, array as ur, AutomationGuardsPatch as ut, installClaudeSdk as v, isFactoryMode as vn, number$1 as vr, TriageDecisionRequest as vt, ownNodeEnv as w, AutomationTrigger as wn, union as wr, FileReadQuery as wt, resolveNpm as x, AutomationAction as xn, preprocess as xr, UpdateAutomationProjectSettingsRequest as xt, isClaudeSdkInstalled as y, Artifact as yn, object as yr, TriageReport as yt, UpdateSessionRequest as z, ProjectConfigFile as zn, UpdateProjectRequest as zt };
29367
29562
 
29368
- //# sourceMappingURL=runner-DGomZl80.js.map
29563
+ //# sourceMappingURL=runner-Doy0yaNT.js.map