@danceiny/gotry 0.0.1-rc.16 → 0.0.1-rc.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 +47 -13
- package/README.zh-CN.md +20 -10
- package/bin/gotry-booking-copilot.js +53 -0
- package/bin/gotry-bootstrap.js +111 -51
- package/bin/gotry-inner.js +442 -60
- package/bin/gotry-runtime-resolution.d.ts +27 -0
- package/bin/gotry-runtime-resolution.js +50 -0
- package/bin/gotry.js +1 -1
- package/cordis.gotry-patch.yml +5 -1
- package/dist/capabilities/agent-reach-deep.js +1 -1
- package/dist/capabilities/agent-reach.js +1 -1
- package/dist/capabilities/anything.js +1 -1
- package/dist/capabilities/artifacts.js +1 -1
- package/dist/capabilities/effect.js +1 -1
- package/dist/capabilities/fact-log.js +1 -1
- package/dist/capabilities/flyai.js +20 -6
- package/dist/capabilities/hbcli.js +1 -1
- package/dist/capabilities/incident-log.js +1 -1
- package/dist/capabilities/model-override.js +18 -0
- package/dist/capabilities/opensky.js +1 -1
- package/dist/capabilities/resilience.js +1 -1
- package/dist/capabilities/session/action-cache.js +1 -1
- package/dist/capabilities/session/adapters/ctrip-flight.js +1 -1
- package/dist/capabilities/session/adapters/meituan-local.js +1 -1
- package/dist/capabilities/session/benchmark.js +1 -1
- package/dist/capabilities/session/extension-bridge.js +19 -6
- package/dist/capabilities/session/extension-channel.js +3 -3
- package/dist/capabilities/session/extension-distribution.js +234 -0
- package/dist/capabilities/session/extract.js +1 -1
- package/dist/capabilities/session/golden-score.js +92 -0
- package/dist/capabilities/session/health-watch.js +1 -1
- package/dist/capabilities/session/read-guard.js +1 -1
- package/dist/capabilities/session/static-flight-golden.js +137 -0
- package/dist/capabilities/session/transport.js +1 -1
- package/dist/capabilities/session/wizard.js +21 -251
- package/dist/capabilities/session-consent.js +1 -1
- package/dist/capabilities/session-login.js +11 -5
- package/dist/capabilities/session-search.js +46 -4
- package/dist/capabilities/weather.js +168 -46
- package/dist/data/session-golden-20.json +25 -0
- package/dist/data/sf-golden-manifest.json +102 -0
- package/dist/data/sf-static-routes.json +91 -0
- package/dist/scripts/action-cache-tests.js +1 -1
- package/dist/scripts/agent-planning-budget-e2e.js +227 -0
- package/dist/scripts/agent-planning-budget-tests.js +173 -0
- package/dist/scripts/agent-reach-deep-tests.js +1 -1
- package/dist/scripts/agent-reach-tests.js +1 -1
- package/dist/scripts/agent-reach-wrapper-tests.js +1 -1
- package/dist/scripts/anything-tests.js +1 -1
- package/dist/scripts/async-collect.js +1 -1
- package/dist/scripts/benchmark-environment-bridge-e2e.js +981 -0
- package/dist/scripts/benchmark-environment-bridge-tests.js +2544 -0
- package/dist/scripts/booking-copilot-availability-ledger-binding-tests.js +335 -0
- package/dist/scripts/booking-copilot-availability-policy-v2-tests.js +1355 -0
- package/dist/scripts/booking-copilot-bin-proof-tests.js +89 -0
- package/dist/scripts/booking-copilot-crossrepo-fixture-server.js +113 -0
- package/dist/scripts/booking-copilot-dsh-core-proof-tests.js +356 -0
- package/dist/scripts/booking-copilot-dsh-planner-proof-tests.js +557 -0
- package/dist/scripts/booking-copilot-dsh-plugin-proof-tests.js +140 -0
- package/dist/scripts/booking-copilot-event-sequence-concurrency-proof-tests.js +202 -0
- package/dist/scripts/booking-copilot-gap-code-contract-proof-tests.js +102 -0
- package/dist/scripts/booking-copilot-operation-ledger-concurrency-proof-tests.js +374 -0
- package/dist/scripts/booking-copilot-receipt-ledger-concurrency-proof-tests.js +447 -0
- package/dist/scripts/booking-copilot-runtime-proof-tests.js +205 -0
- package/dist/scripts/booking-copilot-server-proof-tests.js +317 -0
- package/dist/scripts/booking-copilot-startup-proof-tests.js +283 -0
- package/dist/scripts/booking-copilot-v2-runtime-proof-tests.js +3935 -0
- package/dist/scripts/booking-saga-tests.js +1 -1
- package/dist/scripts/booking-surface-contract-proof-tests.js +393 -0
- package/dist/scripts/booking-surface-v2-contract-proof-tests.js +1174 -0
- package/dist/scripts/bootstrap-tests.js +30 -10
- package/dist/scripts/build-changelog.js +1 -1
- package/dist/scripts/changelog-tests.js +1 -1
- package/dist/scripts/companion-tests.js +1 -1
- package/dist/scripts/diff-test.js +1 -1
- package/dist/scripts/dsh-runtime-closure-tests.js +225 -0
- package/dist/scripts/dsh-runtime-closure.js +150 -0
- package/dist/scripts/effect-tests.js +1 -1
- package/dist/scripts/engine-run.js +1 -1
- package/dist/scripts/engine-tests.js +1 -1
- package/dist/scripts/evaluation-cadence-tests.js +347 -0
- package/dist/scripts/evaluation-contract-tests.js +574 -0
- package/dist/scripts/extension-distribution-cli.js +35 -0
- package/dist/scripts/extension-distribution-tests.js +341 -0
- package/dist/scripts/extension-tests.js +128 -23
- package/dist/scripts/fact-gate-tests.js +1 -1
- package/dist/scripts/flyai-tests.js +1 -1
- package/dist/scripts/hbcli-e2e-tests.js +1 -1
- package/dist/scripts/hbcli-tests.js +1 -1
- package/dist/scripts/health-watch-cli.js +1 -1
- package/dist/scripts/i18n-tests.js +1 -1
- package/dist/scripts/incident-tests.js +1 -1
- package/dist/scripts/journey-tests.js +1 -1
- package/dist/scripts/ledger-tests.js +1 -1
- package/dist/scripts/ledger-workflow-crash.js +1 -1
- package/dist/scripts/memory-capture-tests.js +1 -1
- package/dist/scripts/memory-decay-tests.js +1 -1
- package/dist/scripts/memory-metrics.js +1 -1
- package/dist/scripts/memory-value-report.js +1 -1
- package/dist/scripts/model-override-e2e.js +176 -0
- package/dist/scripts/nightly-evidence-tests.js +1 -1
- package/dist/scripts/nightly-evidence.js +1 -1
- package/dist/scripts/nudge-digest.js +1 -1
- package/dist/scripts/onboarding-tests.js +21 -53
- package/dist/scripts/opensky-check.js +1 -1
- package/dist/scripts/opensky-tests.js +1 -1
- package/dist/scripts/pnpm-dsh-closure-proof.js +20 -0
- package/dist/scripts/price-drift-tests.js +1 -1
- package/dist/scripts/price-drift-watch.js +1 -1
- package/dist/scripts/probe-poi-tests.js +1 -1
- package/dist/scripts/product-metrics.js +1 -1
- package/dist/scripts/publish-preverify.js +40 -4
- package/dist/scripts/realtime-pricing-tests.js +1 -1
- package/dist/scripts/replay-async.js +1 -1
- package/dist/scripts/replay-real.js +1 -1
- package/dist/scripts/replay.js +1 -1
- package/dist/scripts/session-attach-diagnose.js +1 -1
- package/dist/scripts/session-attach-poc.js +1 -1
- package/dist/scripts/session-benchmark.js +1 -1
- package/dist/scripts/session-extract-tests.js +1 -1
- package/dist/scripts/session-login.js +1 -1
- package/dist/scripts/session-tests.js +70 -20
- package/dist/scripts/sf-live-benchmark.js +338 -0
- package/dist/scripts/sf-live-cli-tests.js +21 -0
- package/dist/scripts/sf-soft-score-tests.js +108 -0
- package/dist/scripts/sf-summary.js +93 -0
- package/dist/scripts/skeleton-check.js +1 -1
- package/dist/scripts/skeleton-integration-test.js +1 -1
- package/dist/scripts/skills-contract-tests.js +1 -1
- package/dist/scripts/smoke-session-gate-tests.js +29 -0
- package/dist/scripts/smoke.js +79 -33
- package/dist/scripts/state-cli-tests.js +1 -1
- package/dist/scripts/state-cli.js +1 -1
- package/dist/scripts/static-golden-tests.js +299 -0
- package/dist/scripts/time-eval-tests.js +1 -1
- package/dist/scripts/travel-timeline-tests.js +1 -1
- package/dist/scripts/unified-tests.js +1 -1
- package/dist/scripts/weather-tests.js +694 -44
- package/dist/scripts/z3-race-tests.js +1 -1
- package/dist/src/artifact-gate.js +1 -1
- package/dist/src/benchmark-agent-conformance.js +370 -0
- package/dist/src/benchmark-environment-bridge.js +384 -0
- package/dist/src/benchmark-headless-child-diagnostics.js +173 -0
- package/dist/src/benchmark-tool-isolation.js +124 -0
- package/dist/src/bookable-facts.js +1 -1
- package/dist/src/booking-saga.js +1 -1
- package/dist/src/booking-surface/availability-policy-v2.js +830 -0
- package/dist/src/booking-surface/canonical-schema.js +113 -0
- package/dist/src/booking-surface/contracts-v2.js +89 -0
- package/dist/src/booking-surface/contracts.js +46 -0
- package/dist/src/booking-surface/dsh-planner.js +453 -0
- package/dist/src/booking-surface/dsh-plugin.js +93 -0
- package/dist/src/booking-surface/error-codes.js +94 -0
- package/dist/src/booking-surface/index.js +15 -0
- package/dist/src/booking-surface/profile.js +68 -0
- package/dist/src/booking-surface/runtime-v2.js +1771 -0
- package/dist/src/booking-surface/runtime.js +351 -0
- package/dist/src/booking-surface/server-v2.js +334 -0
- package/dist/src/booking-surface/server.js +302 -0
- package/dist/src/booking-surface/startup.js +159 -0
- package/dist/src/booking-surface/validation-v2.js +319 -0
- package/dist/src/booking-surface/validation.js +809 -0
- package/dist/src/bridge.js +1 -1
- package/dist/src/companions.js +1 -1
- package/dist/src/contracts.js +1 -1
- package/dist/src/dsh-llm.js +1 -1
- package/dist/src/engine.js +1 -1
- package/dist/src/evaluation-cadence.js +234 -0
- package/dist/src/evaluation-contracts.js +906 -0
- package/dist/src/i18n.js +1 -1
- package/dist/src/index.js +50 -19
- package/dist/src/journey.js +1 -1
- package/dist/src/loop.js +1 -1
- package/dist/src/memory-capture.js +1 -1
- package/dist/src/memory-decay.js +1 -1
- package/dist/src/memory-utility.js +1 -1
- package/dist/src/mock-llm.js +1 -1
- package/dist/src/model.js +1 -1
- package/dist/src/realtime-pricing.js +1 -1
- package/dist/src/slot-spec.js +1 -1
- package/dist/src/state-ledger.js +2 -1
- package/dist/src/time-anchor.js +1 -1
- package/dist/src/tool-budget.js +136 -0
- package/dist/src/tool-packet.js +1 -1
- package/dist/src/travel-slots.js +1 -1
- package/dist/src/travel-timeline.js +1 -1
- package/dist/src/unified.js +1 -1
- package/dist/src/wish-pool.js +1 -1
- package/dist/src/z3-shared.js +1 -1
- package/extension/README.md +31 -7
- package/package.json +286 -11
- package/schemas/booking.surface.v1.schema.json +927 -0
- package/schemas/booking.surface.v2.schema.json +61 -0
- package/ts/capabilities/flyai.ts +16 -3
- package/ts/capabilities/session/extension-bridge.ts +37 -14
- package/ts/capabilities/session/extension-channel.ts +6 -3
- package/ts/capabilities/session/extension-distribution.ts +264 -0
- package/ts/capabilities/session/golden-score.ts +139 -0
- package/ts/capabilities/session/health-watch.ts +1 -1
- package/ts/capabilities/session/static-flight-golden.ts +209 -0
- package/ts/capabilities/session/wizard.ts +34 -176
- package/ts/capabilities/session-login.ts +15 -5
- package/ts/capabilities/session-search.ts +40 -3
- package/ts/capabilities/weather.ts +141 -52
- package/ts/package.json +3 -3
- package/ts/src/benchmark-agent-conformance.ts +448 -0
- package/ts/src/benchmark-environment-bridge.ts +348 -0
- package/ts/src/benchmark-headless-child-diagnostics.ts +184 -0
- package/ts/src/benchmark-tool-isolation.ts +166 -0
- package/ts/src/booking-surface/availability-policy-v2.ts +523 -0
- package/ts/src/booking-surface/canonical-schema.js +113 -0
- package/ts/src/booking-surface/contracts-v2.ts +118 -0
- package/ts/src/booking-surface/contracts.ts +380 -0
- package/ts/src/booking-surface/dsh-planner.ts +452 -0
- package/ts/src/booking-surface/dsh-plugin.js +93 -0
- package/ts/src/booking-surface/error-codes.ts +101 -0
- package/ts/src/booking-surface/index.ts +12 -0
- package/ts/src/booking-surface/profile.ts +42 -0
- package/ts/src/booking-surface/runtime-v2.ts +1466 -0
- package/ts/src/booking-surface/runtime.ts +483 -0
- package/ts/src/booking-surface/server-v2.ts +247 -0
- package/ts/src/booking-surface/server.ts +324 -0
- package/ts/src/booking-surface/startup.ts +196 -0
- package/ts/src/booking-surface/validation-v2.ts +205 -0
- package/ts/src/booking-surface/validation.ts +453 -0
- package/ts/src/index.ts +64 -11
- package/ts/src/state-ledger.ts +1 -0
- package/ts/src/tool-budget.ts +165 -0
- package/dist/scripts/wizard-bootstrap.js +0 -32
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/** Per-agent, per-turn guard for model-driven tool loops. */
|
|
2
|
+
|
|
3
|
+
import { randomUUID } from 'node:crypto'
|
|
4
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
5
|
+
import type { Agent } from '@deepseek-ai/dsh-agent'
|
|
6
|
+
import type { ToolExecutionResult, ToolExecutionToken } from '@deepseek-ai/dsh-tools'
|
|
7
|
+
|
|
8
|
+
export const TOOL_BUDGET_SOFT_CALL = 16
|
|
9
|
+
export const TOOL_BUDGET_HARD_CALL = 18
|
|
10
|
+
export const TOOL_BUDGET_EXHAUSTED = 'TOOL_BUDGET_EXHAUSTED'
|
|
11
|
+
|
|
12
|
+
export type ToolBudgetDecision =
|
|
13
|
+
| { kind: 'allow'; softSignal: boolean; exhaustsBudget: boolean }
|
|
14
|
+
| { kind: 'deny'; reason: string }
|
|
15
|
+
|
|
16
|
+
export function toolBudgetDecision(callNumber: number): ToolBudgetDecision {
|
|
17
|
+
if (callNumber > TOOL_BUDGET_HARD_CALL) {
|
|
18
|
+
return {
|
|
19
|
+
kind: 'deny',
|
|
20
|
+
reason: `${TOOL_BUDGET_EXHAUSTED}: maximum ${TOOL_BUDGET_HARD_CALL} real tool dispatches per agent turn reached; provide a final answer using existing results`,
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
kind: 'allow',
|
|
25
|
+
softSignal: callNumber === TOOL_BUDGET_SOFT_CALL,
|
|
26
|
+
exhaustsBudget: callNumber === TOOL_BUDGET_HARD_CALL,
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function createToolBudgetState(): {
|
|
31
|
+
nextCall(): ToolBudgetDecision & { callNumber: number }
|
|
32
|
+
} {
|
|
33
|
+
let calls = 0
|
|
34
|
+
return {
|
|
35
|
+
nextCall() {
|
|
36
|
+
calls += 1
|
|
37
|
+
return { ...toolBudgetDecision(calls), callNumber: calls }
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function convergenceContext(code: 'TOOL_BUDGET_SOFT' | typeof TOOL_BUDGET_EXHAUSTED, text: string) {
|
|
43
|
+
return {
|
|
44
|
+
id: randomUUID(),
|
|
45
|
+
role: 'user' as const,
|
|
46
|
+
content: [{ type: 'text' as const, text: `${code}: ${text}` }],
|
|
47
|
+
source: { kind: 'plugin' as const, plugin: 'gotry-tool-budget' },
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function exhaustionResult(reason: string): ToolExecutionResult {
|
|
52
|
+
return {
|
|
53
|
+
isError: true,
|
|
54
|
+
error: {
|
|
55
|
+
message: reason,
|
|
56
|
+
info: { name: 'ToolBudgetError', code: TOOL_BUDGET_EXHAUSTED },
|
|
57
|
+
},
|
|
58
|
+
content: [{ type: 'text', text: reason }],
|
|
59
|
+
additionalContexts: [convergenceContext(
|
|
60
|
+
TOOL_BUDGET_EXHAUSTED,
|
|
61
|
+
'No more tool dispatches are permitted in this turn. Produce the final answer from existing results.',
|
|
62
|
+
) as never],
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type RestrictableTools = {
|
|
67
|
+
schemas?: () => Array<{ name: string }>
|
|
68
|
+
restrict?: (filter: { deny: string[] }) => () => void
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Install the runtime boundary, kept separate from the GoTry tool catalog so
|
|
73
|
+
* the actual Cordis waterfalls can be exercised without booting every tool.
|
|
74
|
+
*/
|
|
75
|
+
export function installToolBudget(ctx: Context): void {
|
|
76
|
+
// Some offline contract tests intentionally provide a registration-only
|
|
77
|
+
// Context slice. They do not drive an agent loop, so there is no budget hook
|
|
78
|
+
// to install and no reason to require an event bus.
|
|
79
|
+
if (typeof (ctx as unknown as { on?: unknown }).on !== 'function') return
|
|
80
|
+
|
|
81
|
+
const budgetByAgent = new Map<string, ReturnType<typeof createToolBudgetState>>()
|
|
82
|
+
const softExecutions = new Map<ToolExecutionToken, string>()
|
|
83
|
+
const pendingFinalOnly = new Map<string, Agent>()
|
|
84
|
+
const finalOnlyDisposers = new Map<string, () => void>()
|
|
85
|
+
|
|
86
|
+
const clearAgent = (agentId: string) => {
|
|
87
|
+
budgetByAgent.delete(agentId)
|
|
88
|
+
for (const [token, owner] of softExecutions) {
|
|
89
|
+
if (owner === agentId) softExecutions.delete(token)
|
|
90
|
+
}
|
|
91
|
+
pendingFinalOnly.delete(agentId)
|
|
92
|
+
finalOnlyDisposers.get(agentId)?.()
|
|
93
|
+
finalOnlyDisposers.delete(agentId)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const enterFinalOnly = (agent: Agent) => {
|
|
97
|
+
const agentId = String(agent.id)
|
|
98
|
+
if (finalOnlyDisposers.has(agentId)) return
|
|
99
|
+
const globalTools = ctx.tools as unknown as RestrictableTools
|
|
100
|
+
const scopedTools = agent.ctx?.tools as unknown as RestrictableTools | undefined
|
|
101
|
+
if (typeof globalTools.schemas !== 'function' || typeof scopedTools?.restrict !== 'function') return
|
|
102
|
+
|
|
103
|
+
// GoTry's model-facing tools are inherited globals. Removing their schemas
|
|
104
|
+
// makes the next native-mode request text-only; the execution wrapper below
|
|
105
|
+
// still denies any already-prepared same-step call beyond the hard limit.
|
|
106
|
+
const inheritedNames = globalTools.schemas()
|
|
107
|
+
.map(schema => schema.name)
|
|
108
|
+
.filter(name => name !== 'run_code')
|
|
109
|
+
if (inheritedNames.length === 0) return
|
|
110
|
+
finalOnlyDisposers.set(agentId, scopedTools.restrict({ deny: inheritedNames }))
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
ctx.on('session/event', (subject, event) => {
|
|
114
|
+
const agentId = String(subject.id)
|
|
115
|
+
if (event.type === 'turn/start' || event.type === 'turn/end') {
|
|
116
|
+
clearAgent(agentId)
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
// The live registry re-checks a tool name before starting every call in
|
|
120
|
+
// one assistant response. Restricting immediately on call 18 would turn an
|
|
121
|
+
// already-prepared call 19 into an opaque "unknown tool" before the
|
|
122
|
+
// execute waterfall can return TOOL_BUDGET_EXHAUSTED. step/end is the
|
|
123
|
+
// exact boundary after that batch settles and before the next prompt is
|
|
124
|
+
// assembled, so current-step refusals stay structured while the next
|
|
125
|
+
// native request is text-only.
|
|
126
|
+
if (event.type === 'step/end') {
|
|
127
|
+
const agent = pendingFinalOnly.get(agentId)
|
|
128
|
+
if (agent) {
|
|
129
|
+
pendingFinalOnly.delete(agentId)
|
|
130
|
+
enterFinalOnly(agent)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
ctx.on('session/disposed', subject => clearAgent(String(subject.id)))
|
|
135
|
+
|
|
136
|
+
ctx.on('tools/execute', (exec, next) => {
|
|
137
|
+
// Programmatic/direct calls are not part of a model planner turn.
|
|
138
|
+
if (!exec.agent) return next()
|
|
139
|
+
const agentId = String(exec.agent.id)
|
|
140
|
+
const state = budgetByAgent.get(agentId) ?? createToolBudgetState()
|
|
141
|
+
budgetByAgent.set(agentId, state)
|
|
142
|
+
const decision = state.nextCall()
|
|
143
|
+
if (decision.kind === 'deny') {
|
|
144
|
+
pendingFinalOnly.set(agentId, exec.agent)
|
|
145
|
+
return Promise.resolve(exhaustionResult(decision.reason))
|
|
146
|
+
}
|
|
147
|
+
if (decision.softSignal) softExecutions.set(exec.token, agentId)
|
|
148
|
+
if (decision.exhaustsBudget) pendingFinalOnly.set(agentId, exec.agent)
|
|
149
|
+
return next()
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
ctx.on('tools/post-execute', (exec, _result, next) => {
|
|
153
|
+
if (!softExecutions.delete(exec.token)) return next()
|
|
154
|
+
return next().then(decision => ({
|
|
155
|
+
...decision,
|
|
156
|
+
additionalContexts: [
|
|
157
|
+
...(decision.additionalContexts ?? []),
|
|
158
|
+
convergenceContext(
|
|
159
|
+
'TOOL_BUDGET_SOFT',
|
|
160
|
+
'Tool call 16 reached. Converge now and produce the final answer from gathered evidence.',
|
|
161
|
+
) as never,
|
|
162
|
+
],
|
|
163
|
+
}))
|
|
164
|
+
})
|
|
165
|
+
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import process from 'node:process';
|
|
2
|
-
import { runOnboardingWizard } from '../capabilities/session/wizard.js';
|
|
3
|
-
function parseArgs(argv) {
|
|
4
|
-
const args = {};
|
|
5
|
-
for(let i = 0; i < argv.length; i += 1){
|
|
6
|
-
const cur = argv[i];
|
|
7
|
-
if (cur === '--extension-dir') args.extensionDir = argv[++i];
|
|
8
|
-
else if (cur === '--source-dir') args.sourceDir = argv[++i];
|
|
9
|
-
}
|
|
10
|
-
return args;
|
|
11
|
-
}
|
|
12
|
-
async function main() {
|
|
13
|
-
const args = parseArgs(process.argv.slice(2));
|
|
14
|
-
const result = await runOnboardingWizard({
|
|
15
|
-
dryRun: false,
|
|
16
|
-
...args.extensionDir ? {
|
|
17
|
-
extensionDir: args.extensionDir
|
|
18
|
-
} : {},
|
|
19
|
-
...args.sourceDir ? {
|
|
20
|
-
sourceDir: args.sourceDir
|
|
21
|
-
} : {}
|
|
22
|
-
});
|
|
23
|
-
process.stdout.write(JSON.stringify(result) + '\n');
|
|
24
|
-
process.exit(0);
|
|
25
|
-
}
|
|
26
|
-
main().catch((e)=>{
|
|
27
|
-
process.stderr.write(`[wizard-bootstrap] error: ${e instanceof Error ? e.message : String(e)}\n`);
|
|
28
|
-
process.exit(2);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//# sourceURL=/Users/bytedance/work/gotry-publish/ts/scripts/wizard-bootstrap.ts
|