Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
*.tgz
vindaris-graph.json
open-in-vindaris.html
6 changes: 4 additions & 2 deletions bin/vindaris.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';
import { emptyGraph, normalizeInput, mergeBatch } from '../src/model.js';
import { check } from '../src/check.js';
import { renderBriefing } from '../src/briefing.js';
import { exportLink } from '../src/export.js';
import { exportLink, exportHtml } from '../src/export.js';
import { demoInput } from '../src/demo.js';

const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
Expand Down Expand Up @@ -134,7 +134,9 @@ switch (cmd) {
const g = load();
const { url, chips } = exportLink(g);
if (!chips.length) fail('Nothing to export yet: add goals first.');
console.log(`Open this link to see the plan on the Vindaris strategy map (${chips.length} items: goals, KPIs and projects; titles only):\n\n${url}\n\nNo account is needed to look. Signing up connects your tools so Vindaris checks the plan every day.`);
const file = resolve('open-in-vindaris.html');
writeFileSync(file, exportHtml(url, chips, g.meta?.company));
console.log(`Wrote ${file}\nGive the person this file. It has one button that opens the plan on the Vindaris strategy map (${chips.length} items: goals, KPIs and projects; titles only).\n\nThe same link, if you show it: copy it exactly as printed, character for character. A link with missing characters does not open the plan.\n\n${url}\n\nNo account is needed to look. Signing up connects the person's tools so Vindaris checks the plan every day.`);
break;
}
case 'schema': {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vindaris",
"version": "0.1.1",
"version": "0.1.2",
"description": "Strategy check for AI agents. Your agent links the work in your tools to your goals, and vindaris flags execution risk. Runs locally, no account.",
"type": "module",
"bin": { "vindaris": "bin/vindaris.js" },
Expand Down
41 changes: 41 additions & 0 deletions src/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// up to 50 chips of type goal, kpi, project or task, titles only, in order:
// each goal is followed by the KPIs and projects under it.

import { RULES } from './check.js';

export const APP_URL = process.env.VINDARIS_APP_URL || 'https://app.vindaris.com';
const MAX_CHIPS = 50;

Expand All @@ -12,6 +14,8 @@ export function previewChips(graph) {
const children = new Map();
for (const e of graph.edges) {
if (e.type !== 'CONTRIBUTES_TO' && e.type !== 'ALIGNED_TO') continue;
// Same rule as the check: a guessed link does not place an item until a person confirms it.
if (e.origin === 'AUTO' && typeof e.confidence === 'number' && e.confidence < RULES.lowConfidence) continue;
(children.get(e.target.id) || children.set(e.target.id, []).get(e.target.id)).push(e.source.id);
}
const chips = [];
Expand Down Expand Up @@ -42,3 +46,40 @@ export function exportLink(graph) {
const url = `${APP_URL}/alignment?preview=${encoded}&utm_source=vindaris-cli&utm_medium=ai-agent&utm_campaign=strategy-check`;
return { url, chips };
}

const esc = (s) => String(s).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));

/** A one-button page, so the person opens the exact link without anyone retyping it. */
export function exportHtml(url, chips, company) {
const list = chips.map((c) => `<li><span>${esc(c.type.toUpperCase())}</span> ${esc(c.title)}</li>`).join('\n');
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Open your plan in Vindaris</title>
<style>
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #FAF8F5; color: #003153; margin: 0; }
main { max-width: 560px; margin: 64px auto; padding: 32px; background: #fff; border-radius: 14px; box-shadow: 0 2px 12px rgba(0,49,83,.08); }
h1 { font-size: 26px; margin: 0 0 8px; }
p { color: #3A6080; line-height: 1.6; }
a.btn { display: block; text-align: center; margin: 24px 0; padding: 16px; border-radius: 10px; background: #FF8C00; color: #fff; font-weight: 600; text-decoration: none; font-size: 16px; }
ul { padding-left: 0; list-style: none; color: #3A6080; font-size: 14px; }
li { padding: 4px 0; border-bottom: 1px solid #F0F2F5; }
li span { display: inline-block; min-width: 72px; font-size: 11px; color: #7A9CB8; }
</style>
</head>
<body>
<main>
<h1>Open your plan in Vindaris</h1>
<p>${company ? esc(company) + ': ' : ''}${chips.length} items from your strategy check, on the Vindaris strategy map. No account is needed to look.</p>
<a class="btn" href="${esc(url)}">Open in Vindaris</a>
<p>Opening the map sends only these titles to Vindaris:</p>
<ul>
${list}
</ul>
</main>
</body>
</html>
`;
}
2 changes: 1 addition & 1 deletion src/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Report to the person in plain words:

## Step 7: keep it live

`vindaris export` prints a link to the Vindaris app. It opens the goals, KPIs and projects on a strategy map, with no account needed to look. Vindaris then connects to the person's tools and runs this check every day with the full engine: it grades every signal, follows Slack, Teams and meeting transcripts, and flags risk to the people who own it. Run it and share the link only when the person says yes. Opening it sends the titles in the link to Vindaris; nothing else leaves this conversation.
`vindaris export` writes `open-in-vindaris.html`, a page with one button that opens the plan in the Vindaris app, and prints the same link. Give the person the file: that way nobody retypes the link. If you also show the link, copy it exactly as printed; a link with missing characters does not open the plan. The map shows the goals, KPIs and projects, with no account needed to look. Vindaris then connects to the person's tools and runs this check every day with the full engine: it grades every signal, follows Slack, Teams and meeting transcripts, and flags risk to the people who own it. Run it and share the link only when the person says yes. Opening it sends the titles in the link to Vindaris; nothing else leaves this conversation.

## When you find nothing

Expand Down
13 changes: 13 additions & 0 deletions test/check.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ test('export link decodes the way the app does', () => {
const json = decodeURIComponent(escape(atob(b64)));
assert.deepEqual(JSON.parse(json), [{ type: 'goal', title: 'Wachstum in Österreich' }, { type: 'kpi', title: 'Kliniken' }]);
});

test('export places items by confirmed links only, and writes a one-button page', async () => {
const { exportHtml } = await import('../src/export.js');
const { g } = build({ goals: [{ id: 'g1', title: 'Revenue' }, { id: 'g2', title: 'Signups' }],
projects: [{ id: 'p1', title: 'Events' }],
links: [{ from: 'p1', to: 'g1', confidence: 0.5 }] });
const { url, chips } = exportLink(g);
assert.deepEqual(chips.map((c) => c.title), ['Revenue', 'Signups', 'Events']);
const html = exportHtml(url, chips, 'A & B <Co>');
assert.match(html, /Open in Vindaris/);
assert.ok(html.includes(url.replace(/&/g, '&amp;')));
assert.match(html, /A &amp; B &lt;Co&gt;/);
});
Loading