Commit Graph

10707 Commits

Author SHA1 Message Date
31ea69be66 feat(cli): add release pipeline (#36365) 2026-05-19 14:51:28 +08:00
6de46024a3 fix(cli): CJK table alignment, workflow plain-text output, HITL label rename
- formatTable: use displayWidth() for CJK/fullwidth chars instead of
  String.length, so double-wide characters don't misalign columns
- workflowTextHandler: print value directly when outputs has exactly one
  string key; fall back to JSON for multi-key or non-string outputs
- hitl-render: rename 'Prompt:' label to 'Message:' — less ambiguous
  than 'prompt' in an LLM context
2026-05-18 23:03:07 -07:00
0d5173f73f fix(cli): client-side --mode enum validation, EPIPE guard, stderr redirects
- Reject invalid --mode values before HTTP (e.g. "chatbot" → clear error)
- Add options field to FlagDefinition + validateFlagOptions in parseArgv
- EPIPE exit-0 guard in run.ts catch block
- tree:gen/tree:check diagnostic output redirected to stderr
- Tailwind class sort in web/app/device/components/code-input.tsx
2026-05-18 21:54:49 -07:00
fd1ebdd6cb chore(web): device-flow lint fixes 2026-05-18 21:54:49 -07:00
9fe7adaf69 test(web): terminal state tests — tighter reset assertions + lookup_failed reset coverage 2026-05-18 21:54:49 -07:00
7a6c84dca3 test(web): device-flow terminal state ghost reset buttons 2026-05-18 21:54:49 -07:00
75a8120152 test(web): authorize-sso — add approveExternal args, loadErr, onError, mock reset coverage 2026-05-18 21:54:49 -07:00
ca103b60cc feat(web): device-flow authorize-sso — Avatar card + Button 2026-05-18 21:54:48 -07:00
2c90cfa00f test(web): authorize-account — add onDenied, error-path, mock reset coverage 2026-05-18 21:54:48 -07:00
6851624dbe feat(web): device-flow authorize-account — Avatar card + accountName/avatarUrl props 2026-05-18 21:54:48 -07:00
44d1b66c93 test(web): chooser — add encodeURIComponent + SSO href coverage 2026-05-18 21:54:48 -07:00
f372eb8e5b test(web): assert setPostLoginRedirect called in chooser account button test 2026-05-18 21:54:48 -07:00
36101c7126 feat(web): device-flow chooser — Button + icons 2026-05-18 21:54:48 -07:00
fe212003b1 fix(web): clear errMsg when resetting to code_entry from terminal states 2026-05-18 21:54:47 -07:00
948214fe6a feat(web): device-flow page — signin shell, Button, terminal icons + ghost actions 2026-05-18 21:54:47 -07:00
14328634b5 feat(web): device-flow layout shell + header (signin parity) 2026-05-18 21:54:47 -07:00
de0a44be06 Merge branch 'main' into feat/cli 2026-05-19 10:37:42 +08:00
6153a6b663 [autofix.ci] apply automated fixes 2026-05-19 02:29:28 +00:00
d5dee5326e feat(cli): align HITL pause envelope, split resume into top-level command, JSON purity
- Match server SSE envelope: HitlPausePayload now mirrors {event, task_id,
  workflow_run_id, data:{...}}; renamed user_actions → actions.
- New shared hitl-render.ts: text-mode block, JSON-mode pretty pure JSON
  (no ANSI), colored stderr hint. Exit 0 on pause (no longer a process error).
- Move RunAppResume → top-level ResumeApp at commands/resume/app/; rewire
  imports + regen tree.generated.ts. User-facing strings updated to
  `difyctl resume app`.
- Spinner gated on text mode: structured strategy passes
  enabled = isText && !livePrint so -o json/yaml never spin.
- Hint emits external-channel note when form_token is null (email-only
  delivery to OPENAPI/SERVICE_API surface returns no resume token).
- ColorScheme extended with dim/cyan/green/yellow/magenta methods.
- dify-mock fixture + tests updated to envelope shape; HITL pause test
  split into text + json variants.
2026-05-18 19:25:13 -07:00
49b33647e7 fix(api): map OPENAPI invoke_from to STANDALONE_WEB_APP token surface
OPENAPI workflow runs previously resolved form_token via console-priority
fallback, returning a CONSOLE token that the OPENAPI resume endpoint rejects
with 404. Add a dispatch map so SERVICE_API and OPENAPI invocations both
filter recipients down to their allowed surface; everything else keeps the
priority fallback.
2026-05-18 19:24:53 -07:00
badfd7689a feat(cli): build-time command-tree codegen + hidden/deprecated framework flags
Replaces the hand-written src/commands/tree.ts with a build-time-generated
artifact derived from src/commands/**/index.ts. tree.ts becomes a one-line
re-export of tree.generated.ts. Determinism: lexicographic sort, LF pinned
via .gitattributes, atomic write (tmp + rename), CI-gated by `pnpm tree:check`.

Codegen script (cli/scripts/generate-command-tree.ts) walks the commands
tree, derives canonical PascalCase identifiers (with reserved-word + hyphen
handling), and emits a static ESM module with sorted default imports and a
nested literal of shape CommandTree. Shared exclusion predicate
(isExcludedCommandPath) consumed by both codegen and coverage.test.ts so
underscore-prefixed segments stay non-commands.

Wired pre* lifecycle hooks (prebuild/predev/pretest) and ci composite
gating `tree:check` first. Pack now emits .js outputs (fixedExtension:false)
to drop .mjs; bin/run.js stays on .js. Vitest test.include extended to
cover scripts/.

Framework additions bundled in:
- static hidden = true       omits command from printTopLevelHelp listing
                              (still resolves and runs when invoked)
- static deprecated = '...'  prints "deprecated: <msg>" to stderr before
                              constructing the command

Verified: pnpm ci green (tree:check ok, tsc clean, lint clean, 702 tests
pass, build complete). Smoke: node bin/run.js version + auth login --help,
add-a-command flow, loose-file error case all behave as expected.
2026-05-18 18:25:57 -07:00
0ff00e742f fix(cli): restore BaseError catch routing post-oclif removal
PR #36328 (remove oclif) dropped the DifyCommand.catch() override that
routed BaseError through formatErrorForCli with semantic exit codes.
The replacement catch in framework/run.ts wrote raw err.message and
always exited 1, losing the code prefix, hint, http_status line, JSON
envelope path, and Auth/Usage/VersionCompat exit codes.

framework/run.ts:
- Add sniffOutputFormat(argv) helper: detects --output / -o (= and space
  forms), stops at --, first-occurrence-wins. Schema-free so it survives
  command-construction failures and pre-parse throws.
- Rewrite catch block: branch BaseError -> Error -> non-Error. BaseError
  branch routes through formatErrorForCli({ format: sniffOutputFormat(argv) })
  and exits via err.exit(). Explicit return after each process.exit
  defends against stubbed exits in tests.

run/app/sse-collector.ts:
- decodeStreamError now unwraps openapi-v1 InvokeError envelopes
  ({error_type, args, message}) buried inside env.message. Prefers
  args.description, falls back to inner.message, then raw on shape
  mismatch.

framework/command.ts:
- Sort named imports (fix pre-existing lint error).

Tests (run.test.ts new, sse-collector.test.ts extended):
- 10 sniffOutputFormat cases.
- 12 run() catch-routing cases: BaseError human/JSON, Usage/Server5xx
  exit codes, withRequest method+url in human and JSON, generic Error,
  non-Error throw, success path, constructor-time BaseError, --
  separator.
- 5 decodeStreamError unwrap cases.

Full suite: 675/675. type-check + lint clean. No subclass changes.
2026-05-18 16:34:32 -07:00
2d5186fb28 fix(offline): guard marketplace I/O paths for ENG-421 (#36335)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-18 13:53:42 +00:00
a89b43bccc simplify type signature 2026-05-18 20:30:57 +08:00
c6792ce415 [autofix.ci] apply automated fixes 2026-05-18 11:13:20 +00:00
8918142ce1 refactor: remove oclif (#36328) 2026-05-18 19:07:23 +08:00
06f076e0ff fix: no model selected but params keep loading (#36342) 2026-05-18 10:19:52 +00:00
5b79f7e99d docs: fix docker README numbering and refresh stale references (#36303) 2026-05-18 10:17:49 +00:00
1cee1a25b6 fix(console): require admin/owner to set default builtin tool credential (#36264)
Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2026-05-18 10:15:51 +00:00
c0f237bf35 feat(web): allow annotation reply score threshold below 0.8 (#36337) 2026-05-18 10:05:13 +00:00
75d7fc0526 ci: add hotfix cherry-pick provenance check (#36340) 2026-05-18 10:03:56 +00:00
c057b5c5ff chore: Filter model presets by supported parameters (#36339) 2026-05-18 10:03:46 +00:00
5468c4ec96 fix: can not create empty knowledge (#36336)
Co-authored-by: Joel <iamjoel007@gmail.com>
2026-05-18 09:41:57 +00:00
f4c02e4c6b fix: fallback phoenix parent trace when parent tracing disabled (#36290)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-18 08:56:50 +00:00
9dc95eeb20 test(api): isolate container DB between tests (#36310)
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
2026-05-18 08:52:19 +00:00
76bba64b79 chore: add type to test (#36324)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-18 08:47:47 +00:00
59e96fbb2a fix(dev): handle empty pyrefly target paths (#36325) 2026-05-18 08:04:03 +00:00
yyh
06ea0f7ac2 fix: improve API extension dialog controls (#36323) 2026-05-18 08:03:08 +00:00
730a0bef9e refactor: add console client migration demo (#36300) 2026-05-18 07:41:23 +00:00
2eb37caf2e refactor(api): migrate console.app.workflow to BaseModel (#36216)
Co-authored-by: WH-2099 <wh2099@pm.me>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-18 07:31:37 +00:00
7e8147295b refactor: convert isinstance chains to match/case (part 5) (#36298)
Co-authored-by: Stephen Zhou <hi@hyoban.cc>
2026-05-18 07:16:31 +00:00
c07686928a fix(api): close base64 file lookup sessions (#36308)
Co-authored-by: Stephen Zhou <hi@hyoban.cc>
2026-05-18 07:13:12 +00:00
d1238180ed fix: use Generator type annotation with @contextmanager decorators (#36297)
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
2026-05-18 07:12:49 +00:00
yyh
969760364d ci: ensure pnpm is available in setup-web action (#36315) 2026-05-18 06:55:38 +00:00
ceabfeb3a7 chore(docker): upgrade plugin daemon to 0.6.1 (#36312) 2026-05-18 06:51:30 +00:00
yyh
c407f40e0d refactor(web): simplify github install focus (#36314) 2026-05-18 06:45:12 +00:00
yyh
28818f2e2a fix(web): constrain dialog overflow layouts (#36302) 2026-05-18 06:11:58 +00:00
e2d6ae818c Merge remote-tracking branch 'upstream/main' into feat/cli 2026-05-18 14:00:59 +08:00
yyh
e2c52c9b0f refactor: migrate checkbox to dify-ui (#36295)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-05-18 05:27:42 +00:00
1925d58369 chore: generate contract in ci (#36286) 2026-05-18 03:13:40 +00:00